Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

validate type bounds in dynamic generic method call #532

@jmesserly

Description

@jmesserly

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions