Fix desugaring of record updates on data families
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