Skip to content

PrelRules: Ensure that string unpack/append rule fires with source notes

Ben Gamari requested to merge wip/T16740 into master

Previously the presence of source notes could hide nested applications of unpackFoldrCString# from our constant folding logic. For instance, consider the expression:

unpackFoldrCString# "foo" c (unpackFoldrCString# "baz" c n)

Specifically, ticks appearing in two places can defeat the rule:

  1. Surrounding the inner application of unpackFoldrCString#
  2. Surrounding the fold function, c

The latter caused the str_rules testcase to fail when base was built with -g3.

Fixes #16740 (closed).

Edited by Ben Gamari

Merge request reports