Interfaces that define a no-arg constructor require implementing classes to implement a constructor, even when one is not necessary and the default would suffice #33859
Labels
Question
An issue which isn't directly actionable in code
TypeScript Version: 3.6.3 and 3.7-beta
Search Terms:
constructor
default
no args
Code
Expected behavior:
class WillError
should be able to successfully implement the constructor required by the interface without explicitly defining one. It errors whether the required constructor is typed asconstructor(): this
orconstructor(): JustAnEmptyConstructor
Actual behavior:
TS errors:
It appears that the implicit, default constructor is typed as
Function
instead of(): this
.Playground Link
Related Issues:
This may be related, may not be: #29707
The text was updated successfully, but these errors were encountered: