summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Compile
diff options
context:
space:
mode:
authorJohn J. Camilleri <john@digitalgrammars.com>2021-07-01 13:53:33 +0200
committerJohn J. Camilleri <john@digitalgrammars.com>2021-07-01 13:53:33 +0200
commit78b73fba20d45ed8c3f1c87455795fbf7d670950 (patch)
tree09e6f46adab57e477071de6a6e0aab574702726b /src/compiler/GF/Compile
parente5a2aed5b6e31fe89e94e9fd9c22e2488f85cae8 (diff)
Make cleanupRecordFields also recurse into variants
It's possible that more constructors need to be handled
Diffstat (limited to 'src/compiler/GF/Compile')
-rw-r--r--src/compiler/GF/Compile/GrammarToCanonical.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/GF/Compile/GrammarToCanonical.hs b/src/compiler/GF/Compile/GrammarToCanonical.hs
index 57a761a64..a600573ac 100644
--- a/src/compiler/GF/Compile/GrammarToCanonical.hs
+++ b/src/compiler/GF/Compile/GrammarToCanonical.hs
@@ -12,7 +12,7 @@ import GF.Data.ErrM
import GF.Text.Pretty
import GF.Grammar.Grammar as G
import GF.Grammar.Lookup(lookupOrigInfo,allOrigInfos,allParamValues)
-import GF.Grammar.Macros(typeForm,collectOp,collectPattOp,mkAbs,mkApp,term2patt,sortRec)
+import GF.Grammar.Macros(typeForm,collectOp,collectPattOp,composSafeOp,mkAbs,mkApp,term2patt,sortRec)
import GF.Grammar.Lockfield(isLockLabel)
import GF.Grammar.Predef(cPredef,cInts)
import GF.Compile.Compute.Predef(predef)
@@ -163,6 +163,7 @@ cleanupRecordFields (RecType ls) (R as) =
, let Just ty = M.lookup lbl defnFields
, let t' = cleanupRecordFields ty t
]
+cleanupRecordFields ty t@(FV _) = composSafeOp (cleanupRecordFields ty) t
cleanupRecordFields _ t = t
convert :: G.Grammar -> Term -> LinValue