parser/assignment.vala \
parser/attribute-duplicate.test \
parser/attribute-wrong-number.test \
+ parser/constant-owned.test \
+ parser/constant-local-owned.test \
parser/constructor-class-exists.test \
parser/constructor-exists.test \
parser/constructor-no-new.test \
expect (TokenType.ASSIGN);
var initializer = parse_expression ();
+ if (type.value_owned) {
+ Report.error (src, "`owned' is not allowed on constants");
+ }
+
return new Constant (id, type, initializer, src);
}
Report.warning (c.source_reference, "the modifier `static' is not applicable to constants");
}
+ if (type.value_owned) {
+ Report.error (c.source_reference, "`owned' is not allowed on constants");
+ }
+
if (accept (TokenType.ASSIGN)) {
c.value = parse_expression ();
}