-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Fix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do thisRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone
Milestone
Description
Found from #41773 (comment)
// @target: esnext
class A {
#str = 'pr Str'
constructor() {
new A.B(this)
}
private static B = class {
constructor(private a: A) {
console.log(this.a.#str)
}
}
}
test: {
new A
}
Currently, this is emitted as
"use strict";
class A {
constructor() {
this.#str = 'pr Str';
new A.B(this);
}
#str;
}
A.B = class {
constructor(a) {
this.a = a;
console.log(this.a.#str);
}
};
test: {
new A;
}
However, #str
has been orphaned and this code will have errors.
CC @robpalme
robpalme, ExE-Boss and a-tarasyuk
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptEffort: ModerateRequires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".Fix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do thisRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone