Skip to content
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

Fix generic/variant binding when using Dynamic types #29

Open
WillBAnders opened this issue Jun 23, 2023 · 0 comments
Open

Fix generic/variant binding when using Dynamic types #29

WillBAnders opened this issue Jun 23, 2023 · 0 comments

Comments

@WillBAnders
Copy link
Contributor

From 668cb47, the order generics are bound when interacting with Dynamic during function resolution changes the result. On further inspection, this is likely caused by Dynamic subtype checks failing to bind nested generics (e.g. Dynamic <: List<T> should bind T = Dynamic, but currently leave it unbound). Two potential solutions come to mind:

  1. Special-case Dynamic to continue subtype checks throughout the entire structure of the type, ensuring that any contained generics are eventually bound.
  2. Bind any unbound generics at the end of resolution to their generic bound. This has a lot of question in relation to what the expected type should be that need to be considered, but it's probably better to assert that all generics end up bound by the end of resolution anyways.
@WillBAnders WillBAnders self-assigned this Jun 23, 2023
WillBAnders added a commit that referenced this issue Sep 21, 2023
The order should always be bound generics first (to avoid overwriting existing
constraints) followed by Dynamic (to bind Dynamic before other types like Any).
This does not address test coverage over the types bound to generics which is
the larger issue that needs to be addressed here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant