Skip to content

Commit

Permalink
fixed issue #67 on order of record fields in overloading
Browse files Browse the repository at this point in the history
  • Loading branch information
aarneranta committed Jul 6, 2020
1 parent 5777b85 commit 1360723
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/compiler/GF/Compile/TypeCheck/RConcrete.hs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,9 @@ getOverload gr g mt ot = case appForm ot of
v <- matchOverload f typs ttys
return $ Just v
_ -> return Nothing


-- checkIfEqLType :: SourceGrammar -> Context -> Type -> Type -> Term -> Check (Bool,Type,Type,String)
-- checkEqLType :: SourceGrammar -> Context -> Type -> Type -> Term -> Check Type
where
collectOverloads tr@(Q c) = case lookupOverload gr c of
Ok typs -> typs
Expand Down Expand Up @@ -399,7 +401,7 @@ getOverload gr g mt ot = case appForm ot of
matchVal mt v = elem mt [Nothing,Just v,Just (unlocked v)]

unlocked v = case v of
RecType fs -> RecType $ filter (not . isLockLabel . fst) fs
RecType fs -> RecType $ filter (not . isLockLabel . fst) (sortRec fs)
_ -> v
---- TODO: accept subtypes
---- TODO: use a trie
Expand Down

0 comments on commit 1360723

Please sign in to comment.