You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Feature Request: Compiler Option to allow function overloading in a classic sense.
Code
exportclassMyOtherClass{}exportclassFoo(){constructor(){}publicBar() : void{}//-- this syntax would be allowed with a compiler option in .tsconfig "allowNameMangling: true"publicBar(num : number) : void{}//-- this syntax would be allowed with a compiler option in .tsconfig "allowNameMangling: true"publicBar(num : number,data : string) : void{}//-- this syntax would be allowed with a compiler option in .tsconfig "allowNameMangling: true"publicBar(data : string) : void{}//-- this syntax would be allowed with a compiler option in .tsconfig "allowNameMangling: true"publicBar(obj : MyOtherClass) : void{}}
Expected behavior:
Javascript could then be transpilied like so...
The idea is that from a developer standpoint I might not care what the javascript function name becomes and the typescript compiler could mangle these names and replace all calls to this particular signature with the mangled name in javascript. This would allow me as a developer to better write typescript code and still adhere to javascript requirements with 1 function only per name.
The text was updated successfully, but these errors were encountered:
Looks like a duplicate of #12041.
This falls out of scope of our design goals since it would mean type-directed emit.
ghost
added
Duplicate
An existing issue was already created
Out of Scope
This idea sits outside of the TypeScript language design constraints
labels
Nov 1, 2017
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.
Feature Request: Compiler Option to allow function overloading in a classic sense.
Code
Expected behavior:
Javascript could then be transpilied like so...
The idea is that from a developer standpoint I might not care what the javascript function name becomes and the typescript compiler could mangle these names and replace all calls to this particular signature with the mangled name in javascript. This would allow me as a developer to better write typescript code and still adhere to javascript requirements with 1 function only per name.
The text was updated successfully, but these errors were encountered: