summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/runtime/haskell/PGF/Expr.hs8
-rw-r--r--testsuite/runtime/typecheck/implicit-arguments.gfs1
-rw-r--r--testsuite/runtime/typecheck/implicit-arguments.gfs.gold2
3 files changed, 9 insertions, 2 deletions
diff --git a/src/runtime/haskell/PGF/Expr.hs b/src/runtime/haskell/PGF/Expr.hs
index 71e35be5e..db6e7cfd3 100644
--- a/src/runtime/haskell/PGF/Expr.hs
+++ b/src/runtime/haskell/PGF/Expr.hs
@@ -354,7 +354,9 @@ apply sig env (EFun f) vs = case Map.lookup f (fst sig) of
Nothing -> VApp f vs
Nothing -> error ("unknown function "++showCId f)
apply sig env (EApp e1 e2) vs = apply sig env e1 (eval sig env e2 : vs)
-apply sig env (EAbs _ x e) (v:vs) = apply sig (v:env) e vs
+apply sig env (EAbs b x e) (v:vs) = case (b,v) of
+ (Implicit,VImplArg v) -> apply sig (v:env) e vs
+ (Explicit, v) -> apply sig (v:env) e vs
apply sig env (EMeta i) vs = case snd sig i of
Just e -> apply sig env e vs
Nothing -> VMeta i env vs
@@ -369,7 +371,9 @@ applyValue sig (VMeta i env vs0) vs = VMeta i env (vs0++vs)
applyValue sig (VGen i vs0) vs = VGen i (vs0++vs)
applyValue sig (VSusp i env vs0 k) vs = VSusp i env vs0 (\v -> applyValue sig (k v) vs)
applyValue sig (VConst f vs0) vs = VConst f (vs0++vs)
-applyValue sig (VClosure env (EAbs b x e)) (v:vs) = apply sig (v:env) e vs
+applyValue sig (VClosure env (EAbs b x e)) (v:vs) = case (b,v) of
+ (Implicit,VImplArg v) -> apply sig (v:env) e vs
+ (Explicit, v) -> apply sig (v:env) e vs
applyValue sig (VImplArg _) vs = error "implicit argument in function position"
-----------------------------------------------------
diff --git a/testsuite/runtime/typecheck/implicit-arguments.gfs b/testsuite/runtime/typecheck/implicit-arguments.gfs
index 5667a2647..49850aeef 100644
--- a/testsuite/runtime/typecheck/implicit-arguments.gfs
+++ b/testsuite/runtime/typecheck/implicit-arguments.gfs
@@ -8,3 +8,4 @@ ai <\x -> x : ({m},n : Node) -> Node>
ai <n1 : ({m} : Node) -> Node>
ai <? : ({m} : Node) -> Node>
ai <link id : Path n1 n1>
+pt -compute <\{n} -> n : ({n} : Node) -> Node> {n1}
diff --git a/testsuite/runtime/typecheck/implicit-arguments.gfs.gold b/testsuite/runtime/typecheck/implicit-arguments.gfs.gold
index e0a83f5b6..3292c2ea1 100644
--- a/testsuite/runtime/typecheck/implicit-arguments.gfs.gold
+++ b/testsuite/runtime/typecheck/implicit-arguments.gfs.gold
@@ -31,3 +31,5 @@ Expression: <link {n1} {n1} (id {n1}) : Path n1 n1>
Type: Path n1 n1
Probability: 1.0
+n1
+