-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
Needs ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.This issue needs a plan that clarifies the finer details of how it could be implemented.SuggestionAn idea for TypeScriptAn idea for TypeScript
Description
class MyCallableClass {
property: string;
constructor() {
//constructor body
}
(): MyCallableClass { // could be 'string' or any other type
// call signature body
return new MyCallableClass();
}
}
would emit :
function MyClass() {
if (this instanceof MyClass) {
//constructor body
} else {
// call signature body
return new MyCallableClass();
}
}
felixfbecker, normalser, TomMarius, luisvt, steve8708 and 54 more
Metadata
Metadata
Assignees
Labels
Needs ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.This issue needs a plan that clarifies the finer details of how it could be implemented.SuggestionAn idea for TypeScriptAn idea for TypeScript