mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-24 03:52:50 -06:00
contravariance in forgiving lock fields
This commit is contained in:
@@ -912,7 +912,8 @@ checkIfEqLType env t u trm = do
|
|||||||
checkWarn $ "WARNING: missing lock field" +++ unwords (map prt lo)
|
checkWarn $ "WARNING: missing lock field" +++ unwords (map prt lo)
|
||||||
return (True,t',u',[])
|
return (True,t',u',[])
|
||||||
Bad s -> return (False,t',u',s)
|
Bad s -> return (False,t',u',s)
|
||||||
where
|
|
||||||
|
where
|
||||||
|
|
||||||
-- t is a subtype of u
|
-- t is a subtype of u
|
||||||
--- quick hack version of TC.eqVal
|
--- quick hack version of TC.eqVal
|
||||||
@@ -967,6 +968,12 @@ checkIfEqLType env t u trm = do
|
|||||||
in case others of
|
in case others of
|
||||||
_:_ -> Bad $ "missing record fields" +++ unwords (map prt others)
|
_:_ -> Bad $ "missing record fields" +++ unwords (map prt others)
|
||||||
_ -> return locks
|
_ -> return locks
|
||||||
|
-- contravariance
|
||||||
|
(Prod x a b, Prod y c d) -> do
|
||||||
|
ls1 <- missingLock g c a
|
||||||
|
ls2 <- missingLock g b d
|
||||||
|
return $ ls1 ++ ls2
|
||||||
|
|
||||||
_ -> Bad ""
|
_ -> Bad ""
|
||||||
|
|
||||||
sTypes = [typeStr, typeTok, typeString]
|
sTypes = [typeStr, typeTok, typeString]
|
||||||
|
|||||||
Reference in New Issue
Block a user