summaryrefslogtreecommitdiff
path: root/vala/valaobjectcreationexpression.vala
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2018-08-08 15:25:51 +0200
committerRico Tzschichholz <ricotz@ubuntu.com>2019-09-25 14:17:50 +0200
commit5182ac26ce718c93925789639f3d89f7ece48650 (patch)
tree57de40db405adffa1de0892aacfe5e33b4d79d92 /vala/valaobjectcreationexpression.vala
parentf9acb476f06ac4a685c4d2c6470a70bc195df2ba (diff)
downloadvala-5182ac26ce718c93925789639f3d89f7ece48650.tar.gz
codegen: Move type-argument checks to SemanticAnalyzer
and don't apply type-argument check on external symbols.
Diffstat (limited to 'vala/valaobjectcreationexpression.vala')
-rw-r--r--vala/valaobjectcreationexpression.vala7
1 files changed, 6 insertions, 1 deletions
diff --git a/vala/valaobjectcreationexpression.vala b/vala/valaobjectcreationexpression.vala
index 5f4fce753..1f6d335fc 100644
--- a/vala/valaobjectcreationexpression.vala
+++ b/vala/valaobjectcreationexpression.vala
@@ -188,7 +188,7 @@ public class Vala.ObjectCreationExpression : Expression {
}
}
- TypeSymbol type = null;
+ TypeSymbol type;
if (type_reference == null) {
if (member_name == null) {
@@ -237,6 +237,7 @@ public class Vala.ObjectCreationExpression : Expression {
type = (TypeSymbol) type_sym;
type_reference = new StructValueType ((Struct) type);
} else if (type_sym is ErrorCode) {
+ type = (TypeSymbol) type_sym;
type_reference = new ErrorType ((ErrorDomain) type_sym.parent_symbol, (ErrorCode) type_sym, source_reference);
symbol_reference = type_sym;
} else {
@@ -486,6 +487,10 @@ public class Vala.ObjectCreationExpression : Expression {
}
}
+ if (!type.external_package) {
+ context.analyzer.check_type (type_reference);
+ }
+
foreach (MemberInitializer init in get_object_initializer ()) {
context.analyzer.visit_member_initializer (init, type_reference);
}