-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone

Description
TypeScript Version: nightly (2.4.0-dev.20170608)
Code
interface I { n: number; }
class C<T extends I> {
constructor(readonly t: T) {}
/** @template U */
static create<U extends I>(u: U): C<U> {
return new C(u);
}
}
Expected behavior:
No error.
Actual behavior:
src/a.ts(7,41): error TS2344: Type 'U' does not satisfy the constraint 'I'.
src/a.ts(8,22): error TS2345: Argument of type 'U' is not assignable to parameter of type 'I'.
(Broken by #15856)
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue