summaryrefslogtreecommitdiff
path: root/src/Parser
diff options
context:
space:
mode:
Diffstat (limited to 'src/Parser')
-rw-r--r--src/Parser/Core.hs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/Parser/Core.hs b/src/Parser/Core.hs
index d1826e1..37c6f12 100644
--- a/src/Parser/Core.hs
+++ b/src/Parser/Core.hs
@@ -329,11 +329,9 @@ evalRemainingArguments off (FunctionArguments remaining) expr = do
arg@( _, SomeArgumentType RequiredArgument _ ) -> err $ "missing " <> showType arg <> " argument"
( _, SomeArgumentType OptionalArgument _ ) -> return Nothing
( kw, SomeArgumentType (ExprDefault def) _ ) -> return $ Just ( kw, def )
- ( kw, SomeArgumentType ContextDefault (ExprTypePrim atype) ) -> do
- SomeExpr context <- gets testContext
- context' <- unifyExpr off atype context
- return $ Just ( kw, SomeExpr context' )
- ( _, SomeArgumentType ContextDefault _ ) -> err "non-primitive context requirement"
+ ( kw, SomeArgumentType ContextDefault atype ) -> do
+ context <- unifySomeExpr off atype =<< gets testContext
+ return $ Just ( kw, context )
sline <- getSourceLine
return (FunctionEval sline $ ArgsApp (FunctionArguments $ M.fromAscList defaults) expr)