diff options
Diffstat (limited to 'vala/valacreationmethod.vala')
-rw-r--r-- | vala/valacreationmethod.vala | 27 |
1 files changed, 1 insertions, 26 deletions
diff --git a/vala/valacreationmethod.vala b/vala/valacreationmethod.vala index ae8daab38..e201624a9 100644 --- a/vala/valacreationmethod.vala +++ b/vala/valacreationmethod.vala @@ -88,19 +88,11 @@ public class Vala.CreationMethod : Method { if (class_name != null && class_name != parent_symbol.name) { // class_name is null for constructors generated by GIdlParser - Report.error (source_reference, "missing return type in method `%s.%s´".printf (context.analyzer.current_symbol.get_full_name (), class_name)); + Report.error (source_reference, "missing return type in method `%s.%s´".printf (context.analyzer.get_current_symbol (parent_node).get_full_name (), class_name)); error = true; return false; } - var old_source_file = context.analyzer.current_source_file; - var old_symbol = context.analyzer.current_symbol; - - if (source_reference != null) { - context.analyzer.current_source_file = source_reference.file; - } - context.analyzer.current_symbol = this; - int i = 0; foreach (Parameter param in get_parameters()) { param.check (context); @@ -135,40 +127,23 @@ public class Vala.CreationMethod : Method { if (context.profile == Profile.GOBJECT && cl.base_class.default_construction_method != null && !cl.base_class.default_construction_method.has_construct_function) { - // directly chain up to Object - var old_insert_block = context.analyzer.insert_block; - context.analyzer.current_symbol = body; - context.analyzer.insert_block = body; var stmt = new ExpressionStatement (new MethodCall (new MemberAccess (new MemberAccess.simple ("GLib", source_reference), "Object", source_reference), source_reference), source_reference); body.insert_statement (0, stmt); stmt.check (context); - - context.analyzer.current_symbol = this; - context.analyzer.insert_block = old_insert_block; } else if (cl.base_class.default_construction_method == null || cl.base_class.default_construction_method.access == SymbolAccessibility.PRIVATE) { Report.error (source_reference, "unable to chain up to private base constructor"); } else if (cl.base_class.default_construction_method.get_required_arguments () > 0) { Report.error (source_reference, "unable to chain up to base constructor requiring arguments"); } else { - var old_insert_block = context.analyzer.insert_block; - context.analyzer.current_symbol = body; - context.analyzer.insert_block = body; - var stmt = new ExpressionStatement (new MethodCall (new BaseAccess (source_reference), source_reference), source_reference); body.insert_statement (0, stmt); stmt.check (context); - - context.analyzer.current_symbol = this; - context.analyzer.insert_block = old_insert_block; } } } - context.analyzer.current_source_file = old_source_file; - context.analyzer.current_symbol = old_symbol; - if (is_abstract || is_virtual || overrides) { Report.error (source_reference, "The creation method `%s' cannot be marked as override, virtual, or abstract".printf (get_full_name ())); return false; |