From: Rico Tzschichholz Date: Thu, 23 Apr 2020 05:44:21 +0000 (+0200) Subject: Revert "vala: Set default_construction_method in semantic-analyzer check if required" X-Git-Tag: 0.49.1~151 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da4cba7aa1945c427f2a1ee39f91fb85a6fff0a9;p=thirdparty%2Fvala.git Revert "vala: Set default_construction_method in semantic-analyzer check if required" This reverts commit d176f179581fac880f5598bb53b3475392af2c4b. Fixes https://gitlab.gnome.org/GNOME/vala/issues/982 --- diff --git a/vala/valaclass.vala b/vala/valaclass.vala index d7f148986..586fe287f 100644 --- a/vala/valaclass.vala +++ b/vala/valaclass.vala @@ -524,15 +524,6 @@ public class Vala.Class : ObjectTypeSymbol { checked = true; - // ensure there is always a default construction method - if (default_construction_method == null - && source_reference.file.file_type == SourceFileType.SOURCE) { - var m = new CreationMethod (name, null, source_reference); - m.access = (is_abstract ? SymbolAccessibility.PROTECTED : SymbolAccessibility.PUBLIC); - m.body = new Block (source_reference); - add_method (m); - } - var old_source_file = context.analyzer.current_source_file; var old_symbol = context.analyzer.current_symbol; diff --git a/vala/valaparser.vala b/vala/valaparser.vala index e61372975..26595b3ac 100644 --- a/vala/valaparser.vala +++ b/vala/valaparser.vala @@ -2670,6 +2670,15 @@ public class Vala.Parser : CodeVisitor { parse_declarations (cl); + // ensure there is always a default construction method + if (scanner.source_file.file_type == SourceFileType.SOURCE + && cl.default_construction_method == null) { + var m = new CreationMethod (cl.name, null, cl.source_reference); + m.access = (cl.is_abstract ? SymbolAccessibility.PROTECTED : SymbolAccessibility.PUBLIC); + m.body = new Block (cl.source_reference); + cl.add_method (m); + } + Symbol result = cl; while (sym != null) { sym = sym.inner;