mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
Compute.ConcreteNew: add missing case for variant functions
Also adding a test case in the test suite for this.
This commit is contained in:
@@ -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) =
|
||||
|
||||
7
testsuite/compiler/compute/Variants.gf
Normal file
7
testsuite/compiler/compute/Variants.gf
Normal 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;
|
||||
}
|
||||
2
testsuite/compiler/compute/Variants.gfs
Normal file
2
testsuite/compiler/compute/Variants.gfs
Normal file
@@ -0,0 +1,2 @@
|
||||
i -retain testsuite/compiler/compute/Variants.gf
|
||||
cc hello
|
||||
1
testsuite/compiler/compute/Variants.gfs.gold
Normal file
1
testsuite/compiler/compute/Variants.gfs.gold
Normal file
@@ -0,0 +1 @@
|
||||
variants {"hello"; "hello" ++ "hello"}
|
||||
Reference in New Issue
Block a user