Skip to content
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: MetadataAnnotation does not extend Element #7007

Closed
rakudrama opened this issue Nov 28, 2012 · 11 comments
Closed

dart2js: MetadataAnnotation does not extend Element #7007

rakudrama opened this issue Nov 28, 2012 · 11 comments
Assignees
Labels
type-code-health Internal changes to our tools and workflows to make them cleaner, simpler, or more maintainable web-dart2js

Comments

@rakudrama
Copy link
Member

The other elements all extend Element, which makes Element.parseNode available.

MetadataAnnotation does not extend element, which means you have to use

(foo as PartialMetadataAnnotation).parseNode(compiler)

I'm not sure why this is the case. It would be more convenient for programming against MetadataAnnotation if it was an Element.

@peter-ahe-google
Copy link
Contributor

I hear that you are saying that MetadataAnnotation should be more convenient to use, and we should do something about that.

(You don't need to use the cast operator in Dart, it is completely redundant)

I think the reason why I didn't make MetadataAnnotation an element is because it doesn't have a name. But that is the case for anonymous functions as well. I'll mull this over.

Could you show me an example of what you're trying to do? I'd like to understand the use case better.


Set owner to @peter-ahe-google.
Added Accepted label.

@rakudrama
Copy link
Member Author

Maybe Spannable is all it needs to be for my purpose:

    PartialMetadataAnnotation partial = annotation;
    compiler.internalError('Annotations needs one string', node: partial.parseNode(compiler));

@rakudrama
Copy link
Member Author

i.e.
    PartialMetadataAnnotation partial = annotation;
    compiler.internalError('Annotations needs one string', node: partial.parseNode(compiler));
-->
    compiler.internalError('Annotations needs one string', node: annotation);

@peter-ahe-google
Copy link
Contributor

OK, I have started a CL for making MetadataAnnotation spannable.


Added Started label.

@peter-ahe-google
Copy link
Contributor

This is the direction I'm going: https://codereview.chromium.org/11428086

@kasperl
Copy link

kasperl commented May 23, 2013

Added TriageForM5 label.

@kasperl
Copy link

kasperl commented May 28, 2013

Removed TriageForM5 label.

@peter-ahe-google
Copy link
Contributor

Removed Type-Defect label.
Added Type-CodeHealth label.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the Later milestone.
Added Oldschool-Milestone-Later label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-Later label.

@rakudrama rakudrama added type-code-health Internal changes to our tools and workflows to make them cleaner, simpler, or more maintainable Priority-Medium web-dart2js labels Aug 4, 2014
@karlklose
Copy link
Contributor

Fixed in r18129.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-code-health Internal changes to our tools and workflows to make them cleaner, simpler, or more maintainable web-dart2js
Projects
None yet
Development

No branches or pull requests

4 participants