Skip to content
  • Ben Gamari's avatar
    PrelRules: Ensure that string unpack/append rule fires with source notes · a657543c
    Ben Gamari authored and Marge Bot's avatar Marge Bot committed
    Previously the presence of source notes could hide nested applications
    of `unpackFoldrCString#` from our constant folding logic. For instance,
    consider the expression:
    
    ```haskell
    unpackFoldrCString# "foo" c (unpackFoldrCString# "baz" c n)
    ```
    
    Specifically, ticks appearing in two places can defeat the rule:
    
      a. Surrounding the inner application of `unpackFoldrCString#`
      b. Surrounding the fold function, `c`
    
    The latter caused the `str_rules` testcase to fail when `base` was built
    with `-g3`.
    
    Fixes #16740.
    a657543c