diff --git a/baselines/packages/mimir/test/no-misused-generics/default/test.ts.lint b/baselines/packages/mimir/test/no-misused-generics/default/test.ts.lint index be509b549..b9a881bdc 100644 --- a/baselines/packages/mimir/test/no-misused-generics/default/test.ts.lint +++ b/baselines/packages/mimir/test/no-misused-generics/default/test.ts.lint @@ -54,3 +54,11 @@ function doStuff(map: Map, key: K) { map.set(key, v); return v; // signature has implicit return type `V`, but we cannot know that without type information } + +declare class Foo { + prop: string; + getProp(this: Record<'prop', T>): T; + compare(this: Record<'prop', T>, other: Record<'prop', T>): number; + foo(this: T): void; + ~ [error no-misused-generics: TypeParameter 'T' is not used to enforce a constraint between types and can be replaced with 'any'.] +} diff --git a/packages/mimir/test/no-misused-generics/test.ts b/packages/mimir/test/no-misused-generics/test.ts index 01d3bf2a0..e60fb7db0 100644 --- a/packages/mimir/test/no-misused-generics/test.ts +++ b/packages/mimir/test/no-misused-generics/test.ts @@ -36,3 +36,10 @@ function doStuff(map: Map, key: K) { map.set(key, v); return v; // signature has implicit return type `V`, but we cannot know that without type information } + +declare class Foo { + prop: string; + getProp(this: Record<'prop', T>): T; + compare(this: Record<'prop', T>, other: Record<'prop', T>): number; + foo(this: T): void; +}