Skip to content

Constructor extension decorator clobbers constructor name #584

@thatcosmonaut

Description

@thatcosmonaut
export function Numbers(...message_type_args: number[]) {
    return <T extends new(...args: any[]) => {}>(constructor: T) => {
        return class extends constructor {
            protected numbers = message_type_args;
        };
    };
}

@Numbers(10, 20)
class MyClass {}

const my_instance = new MyClass();
console.log(my_instance.constructor.name);

Running the transpiled Lua code will give "____" as the constructor name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions