-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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".FixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do this
Milestone
Description
Bug Report
🔎 Search Terms
- Inheritance
- Function declaration
- Ambient class declaration
🕗 Version & Regression Information
- This seems to be the behaviour since Typescript 3.6 (the version that introduced merging ambient function and class declarations)
- I tried my best to find this issue, I hope this is no duplicate
⏯ Playground Link
Playground link with relevant code
💻 Code
declare class A {
a: number;
}
declare function B(): B; // (a)
declare class B extends A {
constructor();
b: number;
}
let b = new B("Hey")
console.log(b.a) // Property 'a' does not exist on type 'B'.🙁 Actual behavior
Line (a) breaks inheritance of class B.
🙂 Expected behavior
B should inherit all properties of A as it does when you remove line (a).
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".FixedA PR has been merged for this issueA PR has been merged for this issueHelp WantedYou can do thisYou can do this