From: Rico Tzschichholz Date: Tue, 28 Sep 2021 12:13:12 +0000 (+0200) Subject: vala: Set source references of created DataType instances in OCE X-Git-Tag: 0.55.1~149 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce15989ece02de8066b3b19297103c8dba0e0cf6;p=thirdparty%2Fvala.git vala: Set source references of created DataType instances in OCE This improves error message for expected type arguments. --- diff --git a/vala/valaobjectcreationexpression.vala b/vala/valaobjectcreationexpression.vala index b8751eca3..a6ce8a14f 100644 --- a/vala/valaobjectcreationexpression.vala +++ b/vala/valaobjectcreationexpression.vala @@ -231,11 +231,11 @@ public class Vala.ObjectCreationExpression : Expression, CallableExpression { if (((Class) type).is_error_base) { type_reference = new ErrorType (null, null, source_reference); } else { - type_reference = new ObjectType ((Class) type); + type_reference = new ObjectType ((Class) type, source_reference); } } else if (type_sym is Struct) { type = (TypeSymbol) type_sym; - type_reference = new StructValueType ((Struct) type); + type_reference = new StructValueType ((Struct) type, source_reference); } else if (type_sym is ErrorCode) { type = (TypeSymbol) type_sym; type_reference = new ErrorType ((ErrorDomain) type_sym.parent_symbol, (ErrorCode) type_sym, source_reference);