Doing this in the parser is not reasonable while this is clearly a sematic
requirement.
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;
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;