aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/analyser/struct.lux
diff options
context:
space:
mode:
authorEduardo Julian2017-05-20 15:39:29 -0400
committerEduardo Julian2017-05-20 15:39:29 -0400
commit76d209d7b33f713259bd9ddb453d571f814005c9 (patch)
tree831b34bbb951695a2df5af758721d119f1ffc08a /new-luxc/source/luxc/analyser/struct.lux
parentb81f241bd90092f52a47f64f4dc8297cc4f82f56 (diff)
- Some refactoring.
Diffstat (limited to 'new-luxc/source/luxc/analyser/struct.lux')
-rw-r--r--new-luxc/source/luxc/analyser/struct.lux5
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"