Compute.ConcreteNew: add missing case for variant functions

Also adding a test case in the test suite for this.
This commit is contained in:
hallgren
2012-12-10 13:25:32 +00:00
parent 45a2629ee5
commit 621291a575
4 changed files with 11 additions and 0 deletions

View File

@@ -267,6 +267,7 @@ vapply v vs =
-- VClosure env (Abs b x t) -> beta gr env b x t vs
VAbs bt _ (Bind f) -> vbeta bt f vs
VS (VV t fs) s -> VS (VV t [vapply f vs|f<-fs]) s
VFV fs -> vfv [vapply f vs|f<-fs]
v -> bug $ "vapply "++show v++" "++show vs
vbeta bt f (v:vs) =

View File

@@ -0,0 +1,7 @@
resource Variants = {
oper
hello = r.f "hello";
r = { f:Str->Str = (id|dup) };
id : Str->Str = \ s -> s;
dup : Str->Str = \ s -> s++s;
}

View File

@@ -0,0 +1,2 @@
i -retain testsuite/compiler/compute/Variants.gf
cc hello

View File

@@ -0,0 +1 @@
variants {"hello"; "hello" ++ "hello"}