From: Rico Tzschichholz Date: Tue, 26 Feb 2019 08:51:30 +0000 (+0100) Subject: genieparser: Don't create VoidType unconditionally X-Git-Tag: 0.43.92~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=177857bd5281accb113a17b8b71d9ce21fd16bff;p=thirdparty%2Fvala.git genieparser: Don't create VoidType unconditionally --- diff --git a/vala/valagenieparser.vala b/vala/valagenieparser.vala index f979128ba..e1bd9025b 100644 --- a/vala/valagenieparser.vala +++ b/vala/valagenieparser.vala @@ -2892,7 +2892,8 @@ public class Vala.Genie.Parser : CodeVisitor { Method parse_method_declaration (List? attrs) throws ParseError { var begin = get_location (); - DataType type = new VoidType (); + DataType type; + expect (TokenType.DEF); var flags = parse_member_declaration_modifiers (); @@ -2914,6 +2915,8 @@ public class Vala.Genie.Parser : CodeVisitor { /* deal with return value */ if (accept (TokenType.COLON)) { type = parse_type (true, false); + } else { + type = new VoidType (); } var type_param_list = parse_type_parameter_list (); @@ -3737,7 +3740,6 @@ public class Vala.Genie.Parser : CodeVisitor { if (accept (TokenType.COLON)) { type = parse_type (true, false); - } else { type = new VoidType (); }