aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2020-05-14 14:52:10 +0000
committers-ol <s+removethis@s-ol.nu>2025-03-02 14:24:49 +0000
commit93c36b88b1d32a5fac2b5cbd44cb93fb326128b7 (patch)
tree2cb9b95cb4378593acc4174cff8e359ac9824a90
parentfix bug where symbol results became constant (diff)
downloadalive-93c36b88b1d32a5fac2b5cbd44cb93fb326128b7.tar.gz
alive-93c36b88b1d32a5fac2b5cbd44cb93fb326128b7.zip
fix nil error when comparing complex types
-rw-r--r--alv/type.moon2
1 files changed, 2 insertions, 0 deletions
diff --git a/alv/type.moon b/alv/type.moon
index 686f6c0..ecd1066 100644
--- a/alv/type.moon
+++ b/alv/type.moon
@@ -87,6 +87,7 @@ class Struct extends Type
"{#{inner}}"
eq: (a, b) =>
+ return false unless (type a) == (type b)
for key, type in pairs @types
if not type\eq a[key], b[key]
return false
@@ -120,6 +121,7 @@ class Array extends Type
"[#{inner}]"
eq: (a, b) =>
+ return false unless (type a) == (type b)
for i=1, @size
if not @type\eq a[i], b[i]
return false