Skip to content

Fix desugaring of record updates on data families

Ryan Scott requested to merge wip/T18809 into master

This fixes a long-standing bug in the desugaring of record updates for data families, when the latter involves a GADT. It's all explained in Note [Update for GADTs] in GHC.HsToCore.Expr.

Building the correct cast is surprisingly tricky, as that Note explains.

Fixes #18809 (closed). The test case (in indexed-types/should_compile/T18809) contains several examples that exercise the dark corners.

Edited by Ryan Scott

Merge request reports