-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
Effort: DifficultGood luck.Good luck.FixedA PR has been merged for this issueA PR has been merged for this issueNeeds ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.This issue needs a plan that clarifies the finer details of how it could be implemented.SuggestionAn idea for TypeScriptAn idea for TypeScript
Description
Currently, TypeScript infers generic types when referring its type immediately. Its behavior is undesirable for using higher-order functions. The type inference of generics should delay until it will be called.
function flip<a, b, c>(f: (a: a, b: b) => c): (b: b, a: a) => c {
return (b: b, a: a) => f(a, b);
}
function zip<T, U>(x: T, y: U): [T, U] {
return [x, y];
}
var expected: <T, U>(y: U, x: T) => [T, U] = flip(zip);
var actual: (y: {}, x: {}) => [{}, {}] = flip(zip);
aluanhaddad, schotime, sergey-shandar, gcnew, fdecampredon and 120 moretomachristian, dylans, zpdDG4gta8XKpMCd, Dessix, Pajn and 39 more
Metadata
Metadata
Assignees
Labels
Effort: DifficultGood luck.Good luck.FixedA PR has been merged for this issueA PR has been merged for this issueNeeds ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.This issue needs a plan that clarifies the finer details of how it could be implemented.SuggestionAn idea for TypeScriptAn idea for TypeScript