From 0b284ac60916142cadb8b65fa5ca9f9cffcfc200 Mon Sep 17 00:00:00 2001 From: s-ol Date: Sun, 23 Feb 2020 23:16:25 +0100 Subject: lots of fixes --- core/base.moon | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/base.moon') diff --git a/core/base.moon b/core/base.moon index 60ee460..422e631 100644 --- a/core/base.moon +++ b/core/base.moon @@ -34,6 +34,10 @@ class Op assert_types: (...) => num = select '#', ... assert #@inputs >= num, "argument count mismatch" + @assert_first_types ... + + assert_first_types: (...) => + num = select '#', ... for i = 1, num expect = select i, ... assert @inputs[i].type == expect, "expected argument #{i} of #{@} to be of type #{expect} but found #{@inputs[i]}" -- cgit v1.2.3