Is the type checking between an interface and a class with Typescript working correctly? Follow
I created the following:
interface IABC {
var1: boolean;
}
class ABC implements IABC {
var1;
constructor() {
}
clear= (): void => {
this.var1 = 999;
};
}
But there is no type checking and it allows 999 to be assigned to this.var1
Is this the correct behaviour?
Please sign in to leave a comment.
The compiler does accept it...