-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
FixedA PR has been merged for this issueA PR has been merged for this issueSuggestionAn idea for TypeScriptAn idea for TypeScript
Milestone
Description
The implements
-keyword in TS is used to guide the programmer of a class to ensure that the class is compatible with a certain (structural) type.
The interface
-keyword in TS defines a type, that except being a regular type, can be used design-time as a tool to ensure that a class is compatible with a (structural) type.
Types other than those defined by interface
or class
can not be used with the implements
-keyword.
I suggest to drop this constraint to allow authors of classes to use (almost*) any type to guide the implementation of a class.
* Except types consisting of primitives (string, bool, number...), as these are nominal and cannot be implemented by a class.
(Sorry if this already have been discussed somewhere, but I can't find anything.)
HerringtonDarkholme, ismailhabib, icopp, pleerock, AbakumovAlexandr and 12 moreverschmelzen
Metadata
Metadata
Assignees
Labels
FixedA PR has been merged for this issueA PR has been merged for this issueSuggestionAn idea for TypeScriptAn idea for TypeScript