Optional arguments due to multiple constructors are not considered when resolving rest parameters in generics #38211
Labels
Design Limitation
Constraints of the existing architecture prevent this from being fixed
TypeScript Version: 3.8.3 and nightly from the playground as of today.
Search Terms:
label:bug constructor rest parameter
Code
Expected behavior:
I would expect this to compile without error, because class
A
has a valid constructor with one argument of typenumber
.Actual behavior:
Error:
Expected 3 arguments, but got 2.(2554)
. It seems the compiler is not able to realise that classA
has a matching constructor.Playground Link: Playground link
Related Issues: #37142, #29707
The text was updated successfully, but these errors were encountered: