From 5ec35f7ab96011cb3c7343d28d9d97690120b39f Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Thu, 20 Jul 2017 20:45:18 +0000 Subject: Fix: main can have any result, but no arguments --- Sil/Check.icl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Sil/Check.icl') diff --git a/Sil/Check.icl b/Sil/Check.icl index 9b24f50..dc9f6a7 100644 --- a/Sil/Check.icl +++ b/Sil/Check.icl @@ -23,7 +23,7 @@ where toString NoMainFunction = "Error: no main function." toString (MainFunctionInvalidType t) - = "Error: function 'main' should have type Void but has type " <+ t <+ "." + = "Error: function 'main' should not have arguments has type " <+ t <+ "." toString (DuplicateFunctionName n) = "Error: multiply defined: '" <+ n <+ "'." toString (DuplicateLocalName f arg) @@ -81,7 +81,7 @@ where _ -> False checkMainFunctionType :: Function -> [CheckError] - checkMainFunctionType f=:{f_name="main",f_type=TVoid,f_args=[]} = [] + checkMainFunctionType f=:{f_name="main",f_args=[]} = [] checkMainFunctionType f=:{f_name="main"} = [MainFunctionInvalidType $ fromOk $ fromJust $ type zero f] checkMainFunctionType _ = [] -- cgit v1.2.3