diff --git a/codegen/valaccodemethodcallmodule.vala b/codegen/valaccodemethodcallmodule.vala index d97b4cf1..dc768931 100644 --- a/codegen/valaccodemethodcallmodule.vala +++ b/codegen/valaccodemethodcallmodule.vala @@ -62,12 +62,6 @@ internal class Vala.CCodeMethodCallModule : CCodeAssignmentModule { m = cl.default_construction_method; generate_method_declaration (m, source_declarations); ccall = new CCodeFunctionCall (new CCodeIdentifier (m.get_real_cname ())); - } else if (itype is StructValueType) { - // constructor - var st = (Struct) ((StructValueType) itype).type_symbol; - m = st.default_construction_method; - generate_method_declaration (m, source_declarations); - ccall = new CCodeFunctionCall (new CCodeIdentifier (m.get_real_cname ())); } else if (itype is DelegateType) { deleg = ((DelegateType) itype).delegate_symbol; } @@ -120,7 +114,7 @@ internal class Vala.CCodeMethodCallModule : CCodeAssignmentModule { } } - if (m is CreationMethod && m.parent_symbol is Class) { + if (m is CreationMethod) { if (context.profile == Profile.GOBJECT) { if (!((Class) m.parent_symbol).is_compact) { ccall.add_argument (new CCodeIdentifier ("object_type")); @@ -135,8 +129,6 @@ internal class Vala.CCodeMethodCallModule : CCodeAssignmentModule { break; } } - } else if (m is CreationMethod && m.parent_symbol is Struct) { - ccall.add_argument (new CCodeIdentifier ("self")); } else if (m != null && m.get_type_parameters ().size > 0) { // generic method add_generic_type_arguments (in_arg_map, ma.get_type_arguments (), expr); @@ -252,7 +244,7 @@ internal class Vala.CCodeMethodCallModule : CCodeAssignmentModule { param.accept (codegen); } head.generate_dynamic_method_wrapper ((DynamicMethod) m); - } else if (m is CreationMethod && context.profile == Profile.GOBJECT && m.parent_symbol is Class) { + } else if (m is CreationMethod && context.profile == Profile.GOBJECT) { ccall_expr = new CCodeAssignment (new CCodeIdentifier ("self"), new CCodeCastExpression (ccall, current_class.get_cname () + "*")); if (!current_class.is_compact && current_class.get_type_parameters ().size > 0) { diff --git a/vala/valamethodcall.vala b/vala/valamethodcall.vala index 55b6bff8..8ac74a9a 100644 --- a/vala/valamethodcall.vala +++ b/vala/valamethodcall.vala @@ -186,15 +186,6 @@ public class Vala.MethodCall : Expression { ((call.symbol_reference is CreationMethod && call.symbol_reference.parent_symbol is Struct) || call.symbol_reference is Struct)) { - var cm = analyzer.find_current_method () as CreationMethod; - if (cm != null) { - if (cm.chain_up) { - error = true; - Report.error (source_reference, "Multiple constructor calls in the same constructor are not permitted"); - return false; - } - cm.chain_up = true; - } var struct_creation_expression = new ObjectCreationExpression ((MemberAccess) call, source_reference); struct_creation_expression.struct_creation = true; foreach (Expression arg in get_argument_list ()) { diff --git a/vala/valastructvaluetype.vala b/vala/valastructvaluetype.vala index 52880a8a..dce8fca1 100644 --- a/vala/valastructvaluetype.vala +++ b/vala/valastructvaluetype.vala @@ -30,33 +30,6 @@ public class Vala.StructValueType : ValueType { base (type_symbol); } - public override bool is_invokable () { - var st = type_symbol as Struct; - if (st != null && st.default_construction_method != null) { - return true; - } else { - return false; - } - } - - public override DataType? get_return_type () { - var st = type_symbol as Struct; - if (st != null && st.default_construction_method != null) { - return st.default_construction_method.return_type; - } else { - return null; - } - } - - public override List? get_parameters () { - var st = type_symbol as Struct; - if (st != null && st.default_construction_method != null) { - return st.default_construction_method.get_parameters (); - } else { - return null; - } - } - public override DataType copy () { var result = new StructValueType ((Struct) type_symbol); result.source_reference = source_reference;