Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add syntax to force picking a certain overload #12854

Closed
zpdDG4gta8XKpMCd opened this issue Dec 12, 2016 · 4 comments
Closed

add syntax to force picking a certain overload #12854

zpdDG4gta8XKpMCd opened this issue Dec 12, 2016 · 4 comments
Labels
Declined The issue was declined as something which matches the TypeScript vision Suggestion An idea for TypeScript

Comments

@zpdDG4gta8XKpMCd
Copy link

i need to pick a certain overload and there is no way to tell TS which one it is other than specifying all type arguments which is easily tedious and not worth the trouble, hence rendering overloads usless

consider adding a syntax that gives TS a hint:

const certainOveroad = createObject(this, that) @ 2;

or

const certainOveroad = createObject(this, that) # 2;

or you prob know better what

@RyanCavanaugh RyanCavanaugh added Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature Suggestion An idea for TypeScript labels Dec 12, 2016
@gcnew
Copy link
Contributor

gcnew commented Dec 12, 2016

Positional picking sounds very imperative and fragile. IMHO it's not a typesystem thing. Maybe looking at why there are so many / not distinct enough overloads or making the compiler smarter at inferring the intention (e.g. by hinting a key argument) seem better to me.

@zpdDG4gta8XKpMCd
Copy link
Author

You won't belive when you know how much big of a fan I am to make the compiler smarter. Unfortunately smart ideas are last to look at if not closed at all. There was a request for partial type arguments for example and a couple more: #6344

@gcnew
Copy link
Contributor

gcnew commented Dec 13, 2016

Yes, I know :). My comment is just how I feel about positional overloading, nothing personal. I believe #9949 and #11152 will help greatly. For the rest (few) instances manually providing the type parameter seems like a good compromise.

@RyanCavanaugh RyanCavanaugh added Declined The issue was declined as something which matches the TypeScript vision and removed Awaiting More Feedback This means we'd like to hear from more people who would be helped by this feature labels Aug 2, 2019
@RyanCavanaugh
Copy link
Member

This would make overload ordering even more observable which is definitely not what we want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Declined The issue was declined as something which matches the TypeScript vision Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

3 participants