aboutsummaryrefslogtreecommitdiff
path: root/Sil
diff options
context:
space:
mode:
authorCamil Staps2017-07-20 20:45:18 +0000
committerCamil Staps2017-07-20 20:45:18 +0000
commit5ec35f7ab96011cb3c7343d28d9d97690120b39f (patch)
tree6fdac0a7a8ade6309f2e167be744560f345a8d3f /Sil
parentCheck the type of the main function (should be Void) (diff)
Fix: main can have any result, but no arguments
Diffstat (limited to 'Sil')
-rw-r--r--Sil/Check.icl4
1 files changed, 2 insertions, 2 deletions
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 _ = []