Skip to content

Prevent extenions/metaextension classes from being extended or used with instanceof #351

@tomblind

Description

@tomblind

Classes decorated with @extension and @MetaExtension should not be allowed to be extended or have instanceof called on them, since they are not TSTL-compiled classes.

declare class Foo {}

/** @extension */
declare class Bar extends Foo {}

class Baz extends Bar {} // No bueno

declare const obj: any;
if (obj instanceof Bar) {} // Also not a good idea

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions