fix: categorize static calls correctly (#1322)

This commit is contained in:
Veit Heller 2021-10-12 21:23:11 +02:00 committed by GitHub
parent 9e12750842
commit 5f01d64406
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -224,9 +224,12 @@ eval ctx xobj@(XObj o info ty) preference resolver =
Left err -> pure (evalError ctx (show err) (xobjInfo xobj))
Right x' -> case checkStatic' x' of
Right _ -> evaluateApp (self : args)
Left er -> pure (evalError ctx (show er) (xobjInfo xobj))
Left er -> pure (ctx, Left er)
(AppPat (ListPat _) _) -> evaluateApp form'
(AppPat (SymPat _ _) _) -> evaluateApp form'
(AppPat (XObj other _ _) _)
| isResolvableStaticObj other ->
pure (ctx, (Left (HasStaticCall xobj info)))
[] -> pure (ctx, dynamicNil)
_ -> pure (throwErr (UnknownForm xobj) ctx (xobjInfo xobj))
checkStatic' (XObj Def _ _) = Left (HasStaticCall xobj info)

View File

@ -1097,6 +1097,7 @@ isResolvableStaticObj (Deftemplate _) = True
isResolvableStaticObj (Instantiate _) = True
isResolvableStaticObj (Fn _ _) = True
isResolvableStaticObj (Interface _ _) = True
isResolvableStaticObj Ref = True
isResolvableStaticObj _ = False
-- | Left biased semigroup instance for Envs.