summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Compile
diff options
context:
space:
mode:
authoraarneranta <aarne@chalmers.se>2020-07-06 14:27:49 +0200
committeraarneranta <aarne@chalmers.se>2020-07-06 14:27:49 +0200
commit1360723137a71cf9a6a9573c1bbb05f9b2041860 (patch)
tree06daff695bdef4de4e60fac2cad22894a56a2da1 /src/compiler/GF/Compile
parent5777b8570161bcf646c8862ef45b8fd08bb1c54b (diff)
fixed issue #67 on order of record fields in overloading
Diffstat (limited to 'src/compiler/GF/Compile')
-rw-r--r--src/compiler/GF/Compile/TypeCheck/RConcrete.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/compiler/GF/Compile/TypeCheck/RConcrete.hs b/src/compiler/GF/Compile/TypeCheck/RConcrete.hs
index 4d194e38b..75b789a76 100644
--- a/src/compiler/GF/Compile/TypeCheck/RConcrete.hs
+++ b/src/compiler/GF/Compile/TypeCheck/RConcrete.hs
@@ -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
@@ -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