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
{{ message }}
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
The initial implementation will not validate type bounds.
We actually have the same issue with generic classes. But there, it can only be triggered via JavaScript interop, because C<InvalidType> would be rejected at compile time. Generic methods must handle this at run time.
Since we represent these types as a function like (T, S) => dart.functionType(...), once option is to generate an assertion in the body. Same trick would work for generic classes, although we might not want it there, because it would be triggered (once) for every class, whereas if we look up a runtime type signature of a generic method, we're already in the dynamic dispatch code path.
The text was updated successfully, but these errors were encountered:
Oh also: we'll need to instantiate to bounds at runtime in dcall/dsend. This is not implemented yet. Perhaps we can do default values on the type parameters. edit: nvm, that would require everything to include dart.dynamic, there are probably better approaches
The initial implementation will not validate type bounds.
We actually have the same issue with generic classes. But there, it can only be triggered via JavaScript interop, because
C<InvalidType>
would be rejected at compile time. Generic methods must handle this at run time.Since we represent these types as a function like
(T, S) => dart.functionType(...)
, once option is to generate an assertion in the body. Same trick would work for generic classes, although we might not want it there, because it would be triggered (once) for every class, whereas if we look up a runtime type signature of a generic method, we're already in the dynamic dispatch code path.The text was updated successfully, but these errors were encountered: