[vala/0.48] vala: Set source references of created DataType instances in OCE



commit 592dba8ff89fe878efac66cfa52b2f7ec7a6720f
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Tue Sep 28 14:13:12 2021 +0200

    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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]