Skip to content

Commit 5f01d64

Browse files
authored
fix: categorize static calls correctly (#1322)
1 parent 9e12750 commit 5f01d64

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Eval.hs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,12 @@ eval ctx xobj@(XObj o info ty) preference resolver =
224224
Left err -> pure (evalError ctx (show err) (xobjInfo xobj))
225225
Right x' -> case checkStatic' x' of
226226
Right _ -> evaluateApp (self : args)
227-
Left er -> pure (evalError ctx (show er) (xobjInfo xobj))
227+
Left er -> pure (ctx, Left er)
228228
(AppPat (ListPat _) _) -> evaluateApp form'
229229
(AppPat (SymPat _ _) _) -> evaluateApp form'
230+
(AppPat (XObj other _ _) _)
231+
| isResolvableStaticObj other ->
232+
pure (ctx, (Left (HasStaticCall xobj info)))
230233
[] -> pure (ctx, dynamicNil)
231234
_ -> pure (throwErr (UnknownForm xobj) ctx (xobjInfo xobj))
232235
checkStatic' (XObj Def _ _) = Left (HasStaticCall xobj info)

src/Obj.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,6 +1097,7 @@ isResolvableStaticObj (Deftemplate _) = True
10971097
isResolvableStaticObj (Instantiate _) = True
10981098
isResolvableStaticObj (Fn _ _) = True
10991099
isResolvableStaticObj (Interface _ _) = True
1100+
isResolvableStaticObj Ref = True
11001101
isResolvableStaticObj _ = False
11011102

11021103
-- | Left biased semigroup instance for Envs.

0 commit comments

Comments
 (0)