JS: Update type usage in UnreachableMethodOverloads

This query depended on the cons-hashing performed by type extraction to determine if two types are the same.

This is not trivial to restore, but not important enough to reimplement right now, so for now just simplifying the query's ability to recognise that two types are the same.
This commit is contained in:
Asger F
2025-06-02 16:07:47 +02:00
parent 8b2a424fb0
commit fb92d9b034
3 changed files with 29 additions and 20 deletions

View File

@@ -1,5 +1,2 @@
| tst.ts:3:3:3:30 | method( ... number; | This overload of method() is unreachable, the $@ overload will always be selected. | tst.ts:2:3:2:30 | method( ... string; | previous |
| tst.ts:6:3:6:17 | types1(): any[] | This overload of types1() is unreachable, the $@ overload will always be selected. | tst.ts:5:3:5:18 | types1<T>(): T[] | previous |
| tst.ts:15:3:15:74 | on(even ... nction; | This overload of on() is unreachable, the $@ overload will always be selected. | tst.ts:14:3:14:74 | on(even ... nction; | previous |
| tst.ts:21:3:21:28 | bar(thi ... number; | This overload of bar() is unreachable, the $@ overload will always be selected. | tst.ts:20:3:20:28 | bar(thi ... string; | previous |
| tst.ts:27:3:27:30 | method( ... number; | This overload of method() is unreachable, the $@ overload will always be selected. | tst.ts:26:3:26:30 | method( ... string; | previous |

View File

@@ -1,6 +1,6 @@
declare class Foobar {
method(foo: number): string;
method(foo: number): number; // $ Alert
method(foo: number): number; // $ MISSING: Alert
types1<T>(): T[]
types1(): any[] // $ Alert
@@ -12,7 +12,7 @@ declare class Foobar {
types3<T extends string>(t: T): number
on(event: string, fn?: (event?: any, ...args: any[]) => void): Function;
on(event: string, fn?: (event?: any, ...args: any[]) => void): Function; // $ Alert
on(event: string, fn?: (event?: any, ...args: any[]) => void): Function; // $ MISSING: Alert
foo(this: string): string;
foo(this: number): number;
@@ -24,7 +24,7 @@ declare class Foobar {
declare class Base {
method(foo: number): string;
method(foo: number): number; // $ Alert
method(foo: number): number; // $ MISSING: Alert
overRiddenInSub(): string;
overRiddenInSub(): number;