Interpreter icon indicating copy to clipboard operation
Interpreter copied to clipboard

Fix generic/variant binding when using Dynamic types

Open WillBAnders opened this issue 2 years ago • 0 comments

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 avatar Jun 23 '23 03:06 WillBAnders