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

Add an api to check if a type is exactly another type #32

Closed
jakemac53 opened this issue Aug 5, 2021 · 2 comments
Closed

Add an api to check if a type is exactly another type #32

jakemac53 opened this issue Aug 5, 2021 · 2 comments

Comments

@jakemac53
Copy link
Owner

We have the isSubtypeOf api today but there are cases where you want something more like isExactly.

The specific use case I ran into is for autoListenable. I want to be able to find the widget class for a state class. The way I want to do that is to walk up the super hierarchy until I find the State class, and then grab the type argument from that.

class MyState extends State<MyWidget> {}

Today I just ended up doing a String name check.

@scheglov
Copy link

We have something like this in the analyzer for InterfaceType. I believe CFE has something like this as well.

@jakemac53
Copy link
Owner Author

This is exists now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants