-
Couldn't load subscription status.
- Fork 13.1k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Literal TypesUnit types including string literal types, numeric literal types, Boolean literals, null, undefinedUnit types including string literal types, numeric literal types, Boolean literals, null, undefinedFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
Repro:
Compile a.ts with --d
No errors reported
Compile a.d.ts generated, reports error
a.ts:
function foo<T extends "foo">(f: (x: T) => T) {
return f;
}
function bar<T extends "foo" | "bar">(f: (x: T) => T) {
return f;
}
let f = foo(x => x);
let fResult = f("foo");
let g = foo((x => x));
let gResult = g("foo");
let h = bar(x => x);
let hResult = h("foo");
hResult = h("bar");Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: Literal TypesUnit types including string literal types, numeric literal types, Boolean literals, null, undefinedUnit types including string literal types, numeric literal types, Boolean literals, null, undefinedFixedA PR has been merged for this issueA PR has been merged for this issue