Skip to content

the types 'T' and 'typeof Class' have no overlap #44645

@karikera

Description

@karikera

Bug Report

🔎 Search Terms

template class no overlap label:Bug

🕗 Version & Regression Information

4.3.4 / 4.4.0-dev.20210617 / Nightly Playground

⏯ Playground Link

Playground Link

💻 Code

class Class {
    dummy = 0;
}


function test<T>(a:T):void{
    if (a === Class) {} // This condition will always return 'false' since the types 'T' and 'typeof Class' have no overlap.ts(2367)
}

🙁 Actual behavior

ts2367 error. a can be Class

🙂 Expected behavior

no error. a can be Class

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: check: Control FlowThe issue relates to control flow analysis

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions