From 76d209d7b33f713259bd9ddb453d571f814005c9 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 20 May 2017 15:39:29 -0400 Subject: - Some refactoring. --- new-luxc/source/luxc/analyser/struct.lux | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'new-luxc/source/luxc/analyser/struct.lux') 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" -- cgit v1.2.3