Fix desugaring of record patterns
Consider the following program.
data Car = Car {company :: String, model :: String, year :: Int}
main =
let
rec = Car {company="Ford", model="Mustang", year=1967}
rec2 = Car {company="Toyota", model="Camry", year=1997}
Car { company = companyVar } = rec
Car { company = companyVar2 } = rec2
in
rec
Compiling the program above leads to an internal error.
[2 of 2] Compiling test ( test.curry, .curry/test.fcy )
pakcs-frontend: Internal error: qualBindTopEnv QualIdent {qidModule =
Nothing, qidIdent = Ident {idPosition = NoPos, idName = "_", idUnique
= 0}}
CallStack (from HasCallStack):
error, called at src/Base/Messages.hs:78:21 in main:Base.Messages
ERROR occurred during parsing!