[vala] Add additional checks for main methods



commit 4c9d2f799cf020814927823e4fdfd575e7293a38
Author: Florian Brosch <flo brosch gmail com>
Date:   Thu Sep 4 00:50:18 2014 +0200

    Add additional checks for main methods
    
    Fixes bug 708391.

 vala/valamethod.vala |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/vala/valamethod.vala b/vala/valamethod.vala
index afc7053..2dc7c80 100644
--- a/vala/valamethod.vala
+++ b/vala/valamethod.vala
@@ -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) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]