-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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: 3.4.0-rc
Search Terms: Type parameters, generics, inference, regression
Code
const foo = <T>() => {};
const assign = <T, U>(a: T, b: U) => Object.assign(a, b);
const result: (() => void) & { foo: any } = assign(() => {}, { foo });
Expected behavior:
No error
Actual behavior:
Argument of type '{ foo: <T>() => void; }' is not assignable to parameter of type '(() => void) & { foo: any; }'.
Type '{ foo: <T>() => void; }' is not assignable to type '() => void'.
Type '{ foo: <T>() => void; }' provides no match for the signature '(): void'.
Related Issues:
Removing <T>
from foo
makes this code valid.
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