diff options
Diffstat (limited to '')
-rw-r--r-- | new-luxc/source/luxc/analyser/struct.lux | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/new-luxc/source/luxc/analyser/struct.lux b/new-luxc/source/luxc/analyser/struct.lux index 1fbca886f..c1b332155 100644 --- a/new-luxc/source/luxc/analyser/struct.lux +++ b/new-luxc/source/luxc/analyser/struct.lux @@ -130,12 +130,11 @@ type-size (list;size flat)] (if (n.< type-size tag) (do @ - [#let [last? (n.= tag (n.dec type-size)) - variant-type (default (undefined) + [#let [variant-type (default (undefined) (list;nth tag flat))] =value (&;with-expected-type variant-type (analyse value))] - (wrap (#la;Variant tag last? =value))) + (wrap (#la;Variant tag type-size =value))) (&;fail (format "Trying to create variant with tag beyond type's limitations." "\n" " Tag: " (%n tag) "\n" "Type size: " (%n type-size) "\n" |