]> 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>
Mon, 4 Oct 2021 12:28:12 +0000 (14:28 +0200)
This improves error message for expected type arguments.

vala/valaobjectcreationexpression.vala

index 321058ae64f50aa20ba36d3d9148167de1d6d1c5..fc6d161a7d775c3369b35421482c7fafb29865dc 100644 (file)
@@ -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);