-
Notifications
You must be signed in to change notification settings - Fork 216
Description
The task here is to check whether the overloaded signatures is consistent with the implementation signature if it's present. Specifically, from the spec:
If an overload implementation is defined, type checkers should validate that it is consistent with all of its associated overload signatures. The implementation should accept all potential sets of arguments that are accepted by the overloads and should produce all potential return types produced by the overloads. In typing terms, this means the input signature of the implementation should be assignable to the input signatures of all overloads, and the return type of all overloads should be assignable to the return type of the implementation.
If the implementation is inconsistent with its overloads, a type checker should report an error.
The following function is the one where all overload checks happen:
Specifically, it loops over each of the overloaded function that needs to be checked here:
which are used to perform various checks.
Notes:
- We can reuse the
INVALID_OVERLOADlint rule to raise a diagnostic for this check