Skip to content

Generic parameter default cant reference the same class #17167

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

Closed
ivanpopelyshev opened this issue Jul 13, 2017 · 2 comments
Closed

Generic parameter default cant reference the same class #17167

ivanpopelyshev opened this issue Jul 13, 2017 · 2 comments
Labels
Duplicate An existing issue was already created

Comments

@ivanpopelyshev
Copy link

ivanpopelyshev commented Jul 13, 2017

TypeScript Version: 2.4.1

Code

export class A<TA extends A<any> = A<any>> {
	clone(): TA {
		return null;
	}
}

class B extends A<B> {
}

let b = new B(); 
let c : B = b.clone();

Expected behavior:

Compilation succeeded.

Actual behavior:

Maximum call stack exceeded at resolveNameHelper.

@ikatyang
Copy link
Contributor

Duplicate of #16533 or #16221.

@RyanCavanaugh RyanCavanaugh added the Duplicate An existing issue was already created label Jul 13, 2017
@RyanCavanaugh
Copy link
Member

Thanks @ikatyang !

@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

3 participants