Closed
Description
TypeScript Version: 2.6.2
Code
class ValueWrapper<T> {
constructor(private readonly value: T) {}
public getValue(): T {
return this.value;
}
public isZero(this: ValueWrapper<number>): boolean {
return this.value === 0;
}
}
const stringWrapper = new ValueWrapper<string>("hello");
const numberWrapper = new ValueWrapper<number>(42);
Expected behavior:
Intellisense should only suggest the isZero
method on numberWrapper
, but not for stringWrapper
.
Actual behavior:
Intellisense does not filter out suggestions based on this
param types.
(screenshot from the Typescript Playground)