Commit 557f37ac authored by Finn Teegen's avatar Finn Teegen

Fix bug in desugaring of record patterns

Fixes #26
parent c5719bed
......@@ -6,6 +6,7 @@ Version 1.0.2 (under development)
* Fixed bug with wrong type of free variables in the intermediate language.
* Fixed bug with generated default implementations of nullary class methods.
* Fixed bug in desugaring of record patterns.
Version 1.0.1
=============
......
......@@ -587,8 +587,8 @@ dsPat p ds (RecordPattern pty c fs) = do
--TODO: Rework
let (ls, tys) = argumentTypes (unpredType pty) c vEnv
tsMap = map field2Tuple fs
anonTs = map (flip VariablePattern anonId . predType) tys
maybeTs = map (flip lookup tsMap) ls
anonTs <- mapM ((uncurry VariablePattern <$>) . freshVar "_#recpat") tys
let maybeTs = map (flip lookup tsMap) ls
ts = zipWith fromMaybe anonTs maybeTs
dsPat p ds (ConstructorPattern pty c ts)
dsPat p ds (TuplePattern ts) =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment