-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
legacy-area-front-endLegacy: Use area-dart-model instead.Legacy: Use area-dart-model instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)
Description
Example:
const x = 0;
main(@x args) {
const z = 0;
foo(@z args) {}
bar(@x args) {} // local too.
}This uses both constant variables x and z as an annotations on function arguments.
The @x annotation is allowed, but the @z annotation is rejected with:
annot.dart:4:8: Error: This can't be used as metadata; metadata should be a reference to a compile-time constant variable, or a call to a constant constructor.
foo(@z args) {}
^
The analyzer accepts the program, and the front-end should too since z is a reference to a compile-time constant variable.
Metadata
Metadata
Assignees
Labels
legacy-area-front-endLegacy: Use area-dart-model instead.Legacy: Use area-dart-model instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)Incorrect behavior (everything from a crash to more subtle misbehavior)