We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
isAssignableFrom
Trying to check if a mixin element type represents a super type I found the following statement documented on isSuperTypeOf():
isSuperTypeOf()
Returns true if representing a super type of staticType. This only takes into account the extends hierarchy. If you wish to check mixins and interfaces, use isAssignableFromType.
Returns true if representing a super type of staticType.
This only takes into account the extends hierarchy. If you wish to check mixins and interfaces, use isAssignableFromType.
So with this information I thought that isAssignableFromType would work as it is.
isAssignableFromType
Implementation:
bool isAssignableFromType(DartType staticType) => isAssignableFrom(staticType.element2!); bool isAssignableFrom(Element element) => isExactly(element) || (element is ClassElement && element.allSupertypes.any(isExactlyType));
However, given that a mixin type is a MixinElement and not a ClassElement, the previous condition fails since element is ClassElement is false.
MixinElement
ClassElement
element is ClassElement
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Trying to check if a mixin element type represents a super type I found the following statement documented on
isSuperTypeOf()
:So with this information I thought that
isAssignableFromType
would work as it is.Implementation:
However, given that a mixin type is a
MixinElement
and not aClassElement
, the previous condition fails sinceelement is ClassElement
is false.The text was updated successfully, but these errors were encountered: