]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
vala: Set source references of created DataType instances in OCE
authorRico Tzschichholz <ricotz@ubuntu.com>
Tue, 28 Sep 2021 12:13:12 +0000 (14:13 +0200)
committerRico Tzschichholz <ricotz@ubuntu.com>
Fri, 1 Oct 2021 18:52:01 +0000 (20:52 +0200)
This improves error message for expected type arguments.

vala/valaobjectcreationexpression.vala

index b8751eca3fad64bc0bf98a2d734c486564854cc1..a6ce8a14f7943d2d45ac5bccc5504806f51167d2 100644 (file)
@@ -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);