diff options
| author | hallgren <hallgren@chalmers.se> | 2012-12-10 13:25:32 +0000 |
|---|---|---|
| committer | hallgren <hallgren@chalmers.se> | 2012-12-10 13:25:32 +0000 |
| commit | 621291a575cd4462729a178158def39d0d411c8f (patch) | |
| tree | d2269ee041da51ff88af978cd1c3661c0aa90cda | |
| parent | 45a2629ee55863603d9be10723770df8617f1935 (diff) | |
Compute.ConcreteNew: add missing case for variant functions
Also adding a test case in the test suite for this.
| -rw-r--r-- | src/compiler/GF/Compile/Compute/ConcreteNew.hs | 1 | ||||
| -rw-r--r-- | testsuite/compiler/compute/Variants.gf | 7 | ||||
| -rw-r--r-- | testsuite/compiler/compute/Variants.gfs | 2 | ||||
| -rw-r--r-- | testsuite/compiler/compute/Variants.gfs.gold | 1 |
4 files changed, 11 insertions, 0 deletions
diff --git a/src/compiler/GF/Compile/Compute/ConcreteNew.hs b/src/compiler/GF/Compile/Compute/ConcreteNew.hs index 828340279..0519a84bd 100644 --- a/src/compiler/GF/Compile/Compute/ConcreteNew.hs +++ b/src/compiler/GF/Compile/Compute/ConcreteNew.hs @@ -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) = diff --git a/testsuite/compiler/compute/Variants.gf b/testsuite/compiler/compute/Variants.gf new file mode 100644 index 000000000..e77b84469 --- /dev/null +++ b/testsuite/compiler/compute/Variants.gf @@ -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; +} diff --git a/testsuite/compiler/compute/Variants.gfs b/testsuite/compiler/compute/Variants.gfs new file mode 100644 index 000000000..1f512694c --- /dev/null +++ b/testsuite/compiler/compute/Variants.gfs @@ -0,0 +1,2 @@ +i -retain testsuite/compiler/compute/Variants.gf +cc hello diff --git a/testsuite/compiler/compute/Variants.gfs.gold b/testsuite/compiler/compute/Variants.gfs.gold new file mode 100644 index 000000000..cd74b1c23 --- /dev/null +++ b/testsuite/compiler/compute/Variants.gfs.gold @@ -0,0 +1 @@ +variants {"hello"; "hello" ++ "hello"} |
