Skip to content

mixin properties not checked #26286

Closed
Closed
@ghost

Description

TypeScript Version: master (as of #26283)

Code

/**
 * @template {new (...args: any[]) => any} T
 * @param {T} SuperClass
 */
function myMixin(SuperClass) {
    return class extends SuperClass {
        method() { return 0; }
    }
};

class Base {}
const Mixed = myMixin(Base);

const instance = new Mixed();
instance.method(); // Correctly typed in signature help
instance.meshod(); // But not checked

Run with allowJs, checkJs, and strict.

Expected behavior:

Error at meshod.

Actual behavior:

No error.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptWorking as IntendedThe behavior described is the intended behavior; this is not a bug

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions