-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
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)
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue