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

interface partial specializations #24400

Closed
xujif opened this issue May 25, 2018 · 2 comments
Closed

interface partial specializations #24400

xujif opened this issue May 25, 2018 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@xujif
Copy link

xujif commented May 25, 2018

Is there any way to specialize an generic interface.

Examples

interface Gen<T> {
   method1 (): void
}
// not use '='? it is a break change
interface Gen<T = number> {
   method2 (): void
}

let v1 = {} as Gen<string>
v1.method1() // correct ,  Gen<string> has method1
v1.method2() // error,  Gen<string> does not has method2

let v2 = {} as Gen<number>
v1.method2() // correct ,  Gen<string> has method2
@mhegazy
Copy link
Contributor

mhegazy commented May 25, 2018

looks like a duplicate of #17636

@mhegazy mhegazy added the Duplicate An existing issue was already created label May 25, 2018
@typescript-bot
Copy link
Collaborator

Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants