summaryrefslogtreecommitdiff
path: root/vala/valaobjectcreationexpression.vala
diff options
context:
space:
mode:
Diffstat (limited to 'vala/valaobjectcreationexpression.vala')
-rw-r--r--vala/valaobjectcreationexpression.vala26
1 files changed, 12 insertions, 14 deletions
diff --git a/vala/valaobjectcreationexpression.vala b/vala/valaobjectcreationexpression.vala
index 5793b46f1..619f2770b 100644
--- a/vala/valaobjectcreationexpression.vala
+++ b/vala/valaobjectcreationexpression.vala
@@ -248,6 +248,18 @@ public class Vala.ObjectCreationExpression : Expression, CallableExpression {
type_reference.add_type_argument (type_arg);
}
+ if (!type_reference.check (context)) {
+ error = true;
+ return false;
+ }
+
+ context.analyzer.check_type (type_reference);
+ // check whether there is the expected amount of type-arguments
+ if (!type_reference.check_type_arguments (context)) {
+ error = true;
+ return false;
+ }
+
value_type = type_reference.copy ();
value_type.value_owned = true;
@@ -325,12 +337,6 @@ public class Vala.ObjectCreationExpression : Expression, CallableExpression {
}
}
- // check whether there is the expected amount of type-arguments
- if (!type_reference.check_type_arguments (context)) {
- error = true;
- return false;
- }
-
if (symbol_reference == null && argument_list.size != 0) {
value_type = null;
error = true;
@@ -432,10 +438,6 @@ public class Vala.ObjectCreationExpression : Expression, CallableExpression {
context.analyzer.check_arguments (this, new MethodType (m), m.get_parameters (), argument_list);
} else if (type_reference is ErrorType) {
- if (type_reference != null) {
- type_reference.check (context);
- }
-
if (member_name != null) {
member_name.check (context);
}
@@ -487,10 +489,6 @@ public class Vala.ObjectCreationExpression : Expression, CallableExpression {
}
}
- if (!type.external_package) {
- context.analyzer.check_type (type_reference);
- }
-
// Unwrap chained member initializers
foreach (MemberInitializer init in get_object_initializer ()) {
if (!(init.initializer is MemberInitializer)) {