You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This has been considered before in various forms (e.g. as an extension to Type API dart-lang/sdk#30717 or as permitting expressions on the right hand side of is).
In general the only argument against this is based on the estimated code size impact, because compiler looses a good way to estimate which type checks can occur in the program - and thus can no longer throw away some of the metadata associated with the class hierarchy. @rakudrama has done experiment for dart2js to estimate approximate impact and saw some non negligible costs in terms of the code size.
There may be some obscure reason that this is not a good idea or even possible but it would be nice to be able to do the following:
Or be able to save a type in a variable and use it later:
This produces a pretty silly error:
Error: 'aType' isn't a type.
Is there a difference between types and the type class?
The text was updated successfully, but these errors were encountered: