summaryrefslogtreecommitdiff
path: root/src/elaborate.sml
diff options
context:
space:
mode:
Diffstat (limited to 'src/elaborate.sml')
-rw-r--r--src/elaborate.sml4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/elaborate.sml b/src/elaborate.sml
index 92792cd5..3b147e00 100644
--- a/src/elaborate.sml
+++ b/src/elaborate.sml
@@ -3271,6 +3271,10 @@ and elabDecl (dAll as (d, loc), (env, denv, gs)) =
val env = E.pushDatatype env n' xs xncs
val t = (L'.CNamed n', loc)
+ val nxs = length xs
+ val t = ListUtil.foldli (fn (i, _, t) =>
+ (L'.CApp (t, (L'.CRel (nxs - 1 - i), loc)), loc))
+ t xs
val env = foldl (fn ((x, n, to), env) =>
let
val t = case to of