-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
Description
TypeScript Version: 3.0.0-dev.20180712
Error: This condition will always return 'false' since the types 'A' and 'I' have no overlap.
TypeScript Version: 2.9.2
Error: Operator '===' cannot be applied to types 'A' and 'I'
Search Terms:
Operator '===' cannot be applied to types
This condition will always return 'false' since the types have no overlap.
Code
class A {
private field: string;
}
interface I {
pub: string;
}
class B extends A implements I {
pub: string;
}
let b = new B();
let a: A = b
let i: I = b;
if (a === i) { // on TS 2.9.2: Operator '===' cannot be applied to types 'A' and 'I'
// on TS 3.0.0-dev.20180712: This condition will always return 'false' since the types 'A' and 'I' have no overlap.
console.log('qq');
}Expected behavior:
no error
Actual behavior:
error
Playground Link: link
Related Issues: no
This case found from real project. Class and interface may be implemented and extended by another class, and in this case this error is pointless.
Metadata
Metadata
Assignees
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug