From: Florian Brosch Date: Wed, 3 Sep 2014 22:50:18 +0000 (+0200) Subject: Add additional checks for main methods X-Git-Tag: 0.27.1~89 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c9d2f799cf020814927823e4fdfd575e7293a38;p=thirdparty%2Fvala.git Add additional checks for main methods Fixes bug 708391. --- diff --git a/vala/valamethod.vala b/vala/valamethod.vala index afc705387..2dc7c8007 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) {