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



commit 9881cb2a9e7b3275b96f32c17fc126309fd69968
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 b8751eca3..d0cebe6e4 100644
--- a/vala/valaobjectcreationexpression.vala
+++ b/vala/valaobjectcreationexpression.vala
@@ -232,10 +232,12 @@ public class Vala.ObjectCreationExpression : Expression, CallableExpression {
                                        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]