]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
Add additional checks for main methods
authorFlorian Brosch <flo.brosch@gmail.com>
Wed, 3 Sep 2014 22:50:18 +0000 (00:50 +0200)
committerLuca Bruno <luca.bruno@immobiliare.it>
Tue, 23 Sep 2014 09:42:03 +0000 (11:42 +0200)
Fixes bug 708391.

vala/valamethod.vala

index afc7053875f6db2696e965dbc6b1a691eb201f49..2dc7c8007c189143d1798da3b2ae62cf8b31ac8b 100644 (file)
@@ -841,6 +841,14 @@ public class Vala.Method : Subroutine {
                        if (tree_can_fail) {
                                Report.error (source_reference, "\"main\" method cannot throw errors");
                        }
+
+                       if (is_inline) {
+                               Report.error (source_reference, "\"main\" method cannot be inline");
+                       }
+
+                       if (coroutine) {
+                               Report.error (source_reference, "\"main\" method cannot be async");
+                       }
                }
 
                if (get_attribute ("GtkCallback") != null) {