New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dart2js mirrors: metadata missing from some variables in a variable declaration #11908
Comments
I really dislike the legacy syntax ;-) Removed Area-Library label. |
Set owner to @peter-ahe-google. |
Marked this as blocking #6490. |
Added this to the M7 milestone. |
Removed Priority-Unassigned label. |
Removed this from the 1.6 milestone. |
Removed Oldschool-Milestone-1.6 label. |
Mirrors is no longer supported in Dart2JS. |
I think this is a dart2js issue but not 100% sure. Consider the following program:
import 'dart:mirrors';
main() {
for (var field in reflect(new FooBar()).type.variables.values) {
print('field ${field.simpleName} has metadata '
'${field.metadata.map((m) => m.reflectee).join()}');
}
}
const hello = 'hello';
class FooBar {
@hello var x, y, z;
}
On VM it prints:
field Symbol("y") has metadata hello
field Symbol("x") has metadata hello
field Symbol("z") has metadata hello
On dart2js+d8 it prints:
field Symbol("x") has metadata hello
field Symbol("y") has metadata
field Symbol("z") has metadata
Note that "y" and "z" are missing metadata.
Since you can only specify metadata on the declaredIdentifier in the variableDeclaration (http://www.dartlang.org/docs/spec/latest/dart-language-specification.html#h.55kzc4r0q21p) , it makes me think metadata should apply to all of the identifiers.
The text was updated successfully, but these errors were encountered: