-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptWon't FixThe severity and priority of this issue do not warrant the time or complexity needed to fix itThe severity and priority of this issue do not warrant the time or complexity needed to fix it
Description
Say I wanted to create two partial classes, merge them together, and instantiate the result:
abstract class Left {
left() { return this.right(); }
abstract right(): number;
}
abstract class Right {
abstract left() : number;
rright(){ return this.left(); }
}
function merge<A, B>(a: A, b: B) : A & B { return undefined; }
var ab = new(merge(Left, Right));We currently don't catch the error that we're new'ing something that is abstract. Notice the 'rright' in the Right, so that intersection can't really satisfy the abstract requirements from Left.
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptWon't FixThe severity and priority of this issue do not warrant the time or complexity needed to fix itThe severity and priority of this issue do not warrant the time or complexity needed to fix it