Improve error message for stricter types not matching generic T extends SomeInterface
#31739
Closed
5 tasks done
Search Terms
generic type is not assignable to type error
Suggestion
It's impossible for a non-generic type to be assignable to a generic that
extends
an interface. This is understandable as at the time of type checking it's impossible to determine the generic type's fields. It would be nice if the error message explained that instead of just saying that the types are incompatible.Use Cases
See the example below:
Examples
Current error:
Checklist
My suggestion meets these guidelines:
The text was updated successfully, but these errors were encountered: