Skip to content

Why does this compile!!?? #3489

Closed
Closed
@blendsdk

Description

@blendsdk

Hi,

I was wondering why the code below compiles fine!
The compiler should complain for the last two lines, not?

interface ViewConfig {
    width?:number;
    height?:number;
}

interface ToolbarConfig {
    size?:number
}

class View implements ViewConfig {
    width:number;
    height:number;
    constructor(config:ViewConfig) {

    }
}

class Toolbar extends View implements ToolbarConfig {
    size:number;
    constructor(config:ToolbarConfig) {
        super(config);
    }
}


var myToolbar = new Toolbar('should not compile');
var myToolbar = new Toolbar(9999);

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions