Skip to content

Conversation

@jcollins-g
Copy link
Contributor

Fixes #2101.

For CallableGenericTypeAliasElementType, use the FunctionType as the instantiated type, and adjust callers so they can use any DartType and not assume InterfaceType.

Also refactors to extract potentially applicable extension detection into a mixin to support a future implementation of #2107.

@googlebot googlebot added the cla: yes Google CLA check succeeded. label Jan 2, 2020
@coveralls
Copy link

coveralls commented Jan 3, 2020

Coverage Status

Coverage increased (+0.008%) to 93.937% when pulling fea0b0d on functiontypeimpl-crash into 285b4df on master.

Copy link
Contributor

@scheglov scheglov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this code and logic well enough, but OTOH I don't see definitely wrong things.


@override
InterfaceType get interfaceType => (type as TypeParameterType).bound;
InterfaceType get _interfaceType => (type as TypeParameterType).bound;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The bound of a type parameter is not always InterfaceType.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is just all messed up. Added a todo; will fix if it causes a real world crash.

@jcollins-g jcollins-g merged commit 7807ee1 into master Jan 6, 2020
@jcollins-g jcollins-g deleted the functiontypeimpl-crash branch April 27, 2020 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Google CLA check succeeded.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unhandled exception: type 'FunctionTypeImpl' is not a subtype of type 'InterfaceType'

4 participants