-
Notifications
You must be signed in to change notification settings - Fork 13k
Open
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue
Milestone
Description
TypeScript Version: 4.2.0-dev.20201211 (also tested with 4.2.0)
Search Terms: static method(s)
Code
class S {
static f(a: number|string): void {}
}
function g(a: number): void {}
// Uncomment to see a different behavior of the `output` const type.
// type G = typeof g;
const y = [S.f, g];
const output: ((ctrl: number|string) => void)[] = y;
Expected behavior:
Consistent type checking result (an error) for the output
const with and without type G = typeof g
.
Actual behavior:
If the type G = typeof g
is present, the error is thrown (as expected), otherwise there is no error thrown.
Playground Link:
Playground link to reproduce the error.
RyanCavanaugh, rkirov, highestop, itea-dev, alfaproject and 2 more
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issue