From 4448657f8443842e3ef75353c5fa87dfebb3cffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edvard=20Th=C3=B6rnros?= Date: Thu, 21 Jan 2021 20:56:38 +0100 Subject: Add type inference for upvalues --- src/compiler.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/compiler.rs') diff --git a/src/compiler.rs b/src/compiler.rs index 409d6a6..70c9a51 100644 --- a/src/compiler.rs +++ b/src/compiler.rs @@ -87,6 +87,13 @@ impl From<&Value> for Type { } impl Type { + pub fn is_unkown(&self) -> bool { + match self { + Type::UnknownType => true, + _ => false, + } + } + pub fn as_value(&self) -> Value { match self { Type::Void => Value::Nil, -- cgit v1.2.1