-
Notifications
You must be signed in to change notification settings - Fork 852
Closed
Labels
Domain: Type CheckingRelated to type checking, grammar checkingRelated to type checking, grammar checking
Description
As of today's nightly:
declare function compact<T>(array: T[]): T[];
declare function makeFooer(): Fooer;
interface Fooer {
foo: (v: string) => string;
}
function f() {
const _ = compact([makeFooer(), { foo: (v) => v }]);
}This passes in TS, but fails in Go with:
src/compact.ts:7:43 - error TS7006: Parameter 'v' implicitly has an 'any' type.
7 const _ = compact([makeFooer(), { foo: (v) => v }]);(Without the compact both TS and Go refuse to infer. With an explicit type on the const, they both infer successfully.)
This is simplified from a real issue with _.compact in our codebase.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Domain: Type CheckingRelated to type checking, grammar checkingRelated to type checking, grammar checking