From d8420a37ffe9e752816b071fced4a972ca1fad23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Thu, 27 Aug 2026 18:32:42 +0200 Subject: Remove requirement of primitive type for context --- src/Parser/Core.hs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/Parser') 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) -- cgit v1.2.3