Skip to content

validation of protected properties is broken when class is merged with interface from another file #6762

Description

@vladima

falling test cases

// @filename: a.ts
class A {
    protected foo() {}
}
// @filename: b.ts
interface A { }

class B extends A {
    protected foo() {}
}
// @module: amd

// @filename: a.ts
export class A {
    protected protected: any;

    protected setProtected(val: any) {
        this.protected = val;
    }
}

// @filename: b.ts
import {A} from './a';

declare module "./a" {
    interface A { }
}

export class B extends A {
    protected setProtected() {

    }
}

Both tests should pass without errors however now the same error is reported in both cases:
Class 'B' incorrectly extends base class 'A'.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions