Now that there's logic in place to merge 'equivalent' annotations + bodies (i.e. where the patterns are equivalent), is there any reason we still want to merge neighboring annotations+bodies when there's no whitespace, even when they're clearly different?
For example, should we merge these?
S i:l
i=l
(if you can't tell, this is an example derived from fuzzing :stuck_out_tongue_wink: )
I have no idea what I'm looking at, but I'd like to understand, could you give a link to what this merging business is? And also what the output of merging that example would be?
In terms of the parser code, I'm basically asking if I can remove the spaces_middle.len() <= 1 ||
part of this line: https://github.com/roc-lang/roc/blob/main/crates/compiler/parse/src/expr.rs#L3254
Here's a more realistic example of where we definitely do want things to be merged:
UserId x : [ UserId I64 ]
UserId x = UserId 42
The merging is changing that from being two separate/unrelated "Annotation" + "Body" defs, to a single "AnnotatedBody" def
Last updated: Jul 06 2025 at 12:14 UTC