Skip to content

check if dynamic Type has a given instance #10406

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

Closed
DartBot opened this issue May 3, 2013 · 4 comments
Closed

check if dynamic Type has a given instance #10406

DartBot opened this issue May 3, 2013 · 4 comments
Assignees
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-not-planned Closed as we don't intend to take action on the reported issue

Comments

@DartBot
Copy link

DartBot commented May 3, 2013

This issue was originally filed by @seaneagan


"x is int" is nice, but sometimes instead of "int" we have some dynamic Type object. Would be nice to be able to instance of checks in this case as well, something like:

reflectClass(someType).hasInstance(x);

or

reflect(x).isA(someType);

@madsager
Copy link
Contributor

madsager commented May 3, 2013

Added Area-Language, Triaged labels.

@gbracha
Copy link
Contributor

gbracha commented Aug 25, 2014

You can do this with mirrors. We don't want to support this in the base language because of performance constraints.


Set owner to @gbracha.
Added WontFix label.

@DartBot
Copy link
Author

DartBot commented Aug 26, 2014

This comment was originally written by @zoechi


but it is strongly discouraged to use mirrors for client code which is intended to be built to JS and this is a very common requirement.

@gbracha
Copy link
Contributor

gbracha commented Aug 26, 2014

How common it is debatable. I'd love to have first class types be much more powerful, but we will not undermine the performance of core language constructs (which are really widely used).

@DartBot DartBot added Type-Defect area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). labels Aug 26, 2014
@kevmoo kevmoo added closed-not-planned Closed as we don't intend to take action on the reported issue and removed resolution-wont_fix labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-not-planned Closed as we don't intend to take action on the reported issue
Projects
None yet
Development

No branches or pull requests

4 participants