Skip to content

Propagate long-distance info in generated code

sheaf requested to merge sheaf/ghc:T23445 into master

When desugaring generated pattern matches, we skip pattern match checks.
However, this ended up also discarding long-distance information, which might be needed for user-written sub-expressions.

Example:

okay (GADT di) cd =
  let sr_field :: ()
      sr_field = case getFooBar di of { Foo -> () }
  in case cd of { SomeRec _ -> SomeRec sr_field }

With sr_field a generated FunBind, we still want to propagate the outer long-distance information from the GADT pattern match into the checks for the user-written RHS of sr_field.

Merge request reports