Is the type checking between an interface and a class with Typescript working correctly?

I created the following:

interface IABC {

    var1: boolean;

class ABC implements IABC {


    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?

1 comment
Comment actions Permalink

The compiler does accept it...


Please sign in to leave a comment.