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

Emitting type parameters (regression) #31792

Closed
falsandtru opened this issue Jun 6, 2019 · 9 comments · Fixed by #31848
Closed

Emitting type parameters (regression) #31792

falsandtru opened this issue Jun 6, 2019 · 9 comments · Fixed by #31848
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue High Priority

Comments

@falsandtru
Copy link
Contributor

falsandtru commented Jun 6, 2019

TypeScript Version: master

Search Terms:

Code

export class MyMap<K, V> {
	constructor(
		private readonly Map_: typeof Map = Map
	) {
	}
	private readonly store = new this.Map_<K, V>();
}

Expected behavior:

export class MyMap {
    constructor(Map_ = Map) {
        this.Map_ = Map_;
        this.store = new this.Map_();
    }
}

Actual behavior:

export class MyMap {
    constructor(Map_ = Map) {
        this.Map_ = Map_;
        this.store = new this.Map_<K, V>();
    }
}

Playground Link:

Related Issues:

@jcalz
Copy link
Contributor

jcalz commented Jun 6, 2019

Wow, yeah. That's not great.

@fatcerberus
Copy link

Ouch.

@andrewbranch andrewbranch self-assigned this Jun 6, 2019
@ahejlsberg ahejlsberg added Bug A bug in TypeScript High Priority labels Jun 6, 2019
@ahejlsberg
Copy link
Member

Whatever the regression is, it causes 28 projects in the RWC test suite to break.

@andrewbranch I'd suggest bisecting this and reverting whichever PR caused the break.

@andrewbranch
Copy link
Member

My theory is it's #30467. I'm stepping through now to see if there's a quick fix, but I'll revert the offending PR if I can't figure it out in the next 30 minutes or so.

@ahejlsberg
Copy link
Member

@andrewbranch Yup, RWC looks to run clean on the last commit prior to #30467.

@rbuckton Ping.

@rbuckton
Copy link
Member

rbuckton commented Jun 6, 2019

I'll take a look. It looks like we didn't have a test for this case (in our normal tests).

@andrewbranch
Copy link
Member

@rbuckton I've got a fix incoming.

@falsandtru
Copy link
Contributor Author

Can you also take a look at another regression #31277?

@falsandtru
Copy link
Contributor Author

@ahejlsberg You don't still have a test for this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue High Priority
Projects
None yet
6 participants