[vala/staging] genieparser: Don't create VoidType unconditionally



commit 177857bd5281accb113a17b8b71d9ce21fd16bff
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Tue Feb 26 09:51:30 2019 +0100

    genieparser: Don't create VoidType unconditionally

 vala/valagenieparser.vala | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
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<Attribute>? 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 ();
                }


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