Files
codeql/javascript/ql/test/query-tests/Declarations/UnreachableOverloads/tst.ts
Asger F fb92d9b034 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.
2025-06-23 12:55:06 +02:00

62 lines
1.2 KiB
TypeScript

declare class Foobar {
method(foo: number): string;
method(foo: number): number; // $ MISSING: Alert
types1<T>(): T[]
types1(): any[] // $ Alert
types2(): any[]
types2<T>(): T[]
types3<T extends Array<T>>(t: T): number;
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; // $ MISSING: Alert
foo(this: string): string;
foo(this: number): number;
bar(this: number): string;
bar(this: number): number; // $ Alert
}
declare class Base {
method(foo: number): string;
method(foo: number): number; // $ MISSING: Alert
overRiddenInSub(): string;
overRiddenInSub(): number;
existsInBase(): string;
}
declare class Sub extends Base {
overRiddenInSub(): string;
overRiddenInSub(): number;
existsInBase(): string;
existsInBase(): number;
}
interface Base1 {
method(): "foo";
}
interface Base2 {
method(): "bar";
}
interface MultiInheritanceI extends Base1, Base2 {
method(): "foo";
method(): "bar";
}
declare class MultiInheritanceC implements Base1, Base2 {
method(): "foo";
method(): "bar";
}