From 93c36b88b1d32a5fac2b5cbd44cb93fb326128b7 Mon Sep 17 00:00:00 2001 From: s-ol Date: Thu, 14 May 2020 16:52:10 +0200 Subject: fix nil error when comparing complex types --- alv/type.moon | 2 ++ 1 file changed, 2 insertions(+) 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 -- cgit v1.2.3