Closed
Description
TypeScript Version: 3.3.3
Search Terms: TS2367
class Scanner {
private _index: number;
private _input: string;
public get current() {
return this._input[this._index];
}
constructor(input: string) {
this._input = input;
this._index = 0;
}
public Scan() {
if (this.current == "A") {
this._index++;
// error TS2367: This condition will always return 'false' since the types '"A"' and '"B"' have no overlap.
if (this.current == "B") {
// do something
}
}
}
}
Expected behavior:
No compilation errors
Actual behavior:
error TS2367: This condition will always return 'false' since the types '"A"' and '"B"' have no overlap.
Playground Link:
Here