From 4145e966859dccc5bf7fac1f1c74b3efd8b6b7e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Wed, 26 Aug 2026 21:29:08 +0200 Subject: Use closure instead of failing with ambiguous type for argument types with free variables --- src/Parser/Expr.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Parser/Expr.hs') diff --git a/src/Parser/Expr.hs b/src/Parser/Expr.hs index 6b458c4..ec5e2b4 100644 --- a/src/Parser/Expr.hs +++ b/src/Parser/Expr.hs @@ -523,9 +523,9 @@ applyFunctionArguments args sexpr@(SomeExpr (expr :: Expr a)) unexpectedArguments unexpectedArgs t <- fromMaybe (ExprTypeVar tvar) . M.lookup tvar <$> gets testTypeUnif resolveKnownTypeVars res' >>= \case - res''@(ExprTypePrim (Proxy :: Proxy r)) -> + ( res''@(ExprTypePrim (Proxy :: Proxy r)), _ ) -> return $ SomeExpr (ArgsApp used (ExposeFunType args' (TypeApp res'' t expr) :: Expr (FunctionType r))) - r -> + ( r, _ ) -> return $ SomeExpr (ArgsApp used (ExposeFunType args' (TypeApp r t expr) :: Expr (FunctionType DynamicType))) _ -> do unexpectedArguments args @@ -537,7 +537,7 @@ applyFunctionArguments args sexpr@(SomeExpr (expr :: Expr a)) ( used, ( _, unexpectedArgs ) ) <- unifyArguments args' args unexpectedArguments unexpectedArgs resolveKnownTypeVars res' >>= \case - ExprTypePrim (Proxy :: Proxy r) + ( ExprTypePrim (Proxy :: Proxy r), _ ) | Just (Refl :: a :~: FunctionType r) <- eqT -> return $ SomeExpr (ArgsApp used expr) _ -- cgit v1.2.3