From 592dba8ff89fe878efac66cfa52b2f7ec7a6720f Mon Sep 17 00:00:00 2001 From: Rico Tzschichholz Date: Tue, 28 Sep 2021 14:13:12 +0200 Subject: [PATCH] vala: Set source references of created DataType instances in OCE This improves error message for expected type arguments. --- vala/valaobjectcreationexpression.vala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vala/valaobjectcreationexpression.vala b/vala/valaobjectcreationexpression.vala index 321058ae6..fc6d161a7 100644 --- a/vala/valaobjectcreationexpression.vala +++ b/vala/valaobjectcreationexpression.vala @@ -232,10 +232,12 @@ public class Vala.ObjectCreationExpression : Expression { type_reference = new ErrorType (null, null, source_reference); } else { type_reference = new ObjectType ((Class) type); + type_reference.source_reference = source_reference; } } else if (type_sym is Struct) { type = (TypeSymbol) type_sym; type_reference = new StructValueType ((Struct) type); + type_reference.source_reference = 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); -- 2.47.2