Skip to content

Cannot define a union type with a new signature type #4067

@tinganho

Description

@tinganho

This currently gives me parse error:

class A {

}

function test(x: string | new() => A) {
                          ~~~~~~~~~~ parse error    
}

Though this works:

function test(x: new() => A) {

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions