mirror of
https://github.com/carp-lang/Carp.git
synced 2024-10-26 05:45:37 +03:00
fix: categorize static calls correctly (#1322)
This commit is contained in:
parent
9e12750842
commit
5f01d64406
@ -224,9 +224,12 @@ eval ctx xobj@(XObj o info ty) preference resolver =
|
|||||||
Left err -> pure (evalError ctx (show err) (xobjInfo xobj))
|
Left err -> pure (evalError ctx (show err) (xobjInfo xobj))
|
||||||
Right x' -> case checkStatic' x' of
|
Right x' -> case checkStatic' x' of
|
||||||
Right _ -> evaluateApp (self : args)
|
Right _ -> evaluateApp (self : args)
|
||||||
Left er -> pure (evalError ctx (show er) (xobjInfo xobj))
|
Left er -> pure (ctx, Left er)
|
||||||
(AppPat (ListPat _) _) -> evaluateApp form'
|
(AppPat (ListPat _) _) -> evaluateApp form'
|
||||||
(AppPat (SymPat _ _) _) -> evaluateApp form'
|
(AppPat (SymPat _ _) _) -> evaluateApp form'
|
||||||
|
(AppPat (XObj other _ _) _)
|
||||||
|
| isResolvableStaticObj other ->
|
||||||
|
pure (ctx, (Left (HasStaticCall xobj info)))
|
||||||
[] -> pure (ctx, dynamicNil)
|
[] -> pure (ctx, dynamicNil)
|
||||||
_ -> pure (throwErr (UnknownForm xobj) ctx (xobjInfo xobj))
|
_ -> pure (throwErr (UnknownForm xobj) ctx (xobjInfo xobj))
|
||||||
checkStatic' (XObj Def _ _) = Left (HasStaticCall xobj info)
|
checkStatic' (XObj Def _ _) = Left (HasStaticCall xobj info)
|
||||||
|
@ -1097,6 +1097,7 @@ isResolvableStaticObj (Deftemplate _) = True
|
|||||||
isResolvableStaticObj (Instantiate _) = True
|
isResolvableStaticObj (Instantiate _) = True
|
||||||
isResolvableStaticObj (Fn _ _) = True
|
isResolvableStaticObj (Fn _ _) = True
|
||||||
isResolvableStaticObj (Interface _ _) = True
|
isResolvableStaticObj (Interface _ _) = True
|
||||||
|
isResolvableStaticObj Ref = True
|
||||||
isResolvableStaticObj _ = False
|
isResolvableStaticObj _ = False
|
||||||
|
|
||||||
-- | Left biased semigroup instance for Envs.
|
-- | Left biased semigroup instance for Envs.
|
||||||
|
Loading…
Reference in New Issue
Block a user