-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
VM doesn't consider dynamic == Object
.
#33768
Comments
Reflection requires these to be distinct. |
Is this expectation part of the spec - does the spec need to be updated? Does DDC have the same behavior as VM (it looks like dart2js does have the same behavior). |
There is no specification of For the equality to be useful, type objects representing the same type must be equal. The issue here is that at run-time, there is nothing distinguishing Or, put differently, the idea is that We would keep the With that design, reflection does not need to distinguish because at run-time there is nothing to distinguish, it's all |
@natebosch wrote:
No, the spec requires that two reified types @rmacnak-google wrote:
It is still possible for an implementation to make a distinction between the reification of a type written as Reflective operations would be able to use |
The "equal if mutual subtypes" rule also affects other cases than top types (all, unsurprisingly, related to union types):
|
Type objects should be equal if the types are sub-types of each other. That is, when the types are indistinguishable wrt. subtyping.
That includes
dynamic
,Object
, andvoid
all being equal when compared asType
objects at run-time.Example:
The text was updated successfully, but these errors were encountered: