From 62c9c126ed3eedf981cc087938fd98f7afb17506 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Thu, 20 Jul 2017 20:40:38 +0000 Subject: Check the type of the main function (should be Void) --- Sil/Types.icl | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Sil/Types.icl') diff --git a/Sil/Types.icl b/Sil/Types.icl index 5f17956..40fc0cb 100644 --- a/Sil/Types.icl +++ b/Sil/Types.icl @@ -1,5 +1,6 @@ implementation module Sil.Types +from StdFunc import const import StdList import StdOverloaded import StdString @@ -34,6 +35,8 @@ typeSize TVoid = 0 typeSize TBool = 1 typeSize TInt = 1 +instance zero TypeResolver where zero = const Nothing + instance type Function where type res f = Just $ Ok $ foldr (-->) f.f_type [a.arg_type \\ a <- f.f_args] -- cgit v1.2.3