Skip to content

Narrowing does not work for variables typed with type parameters #6445

Description

interfaceBase{b}interfaceDerivedextendsBase{d}declarefunctionisDerived(x: Base): x is Derived;functionf<TextendsBase>(x: T,y: T){if(isDerived(x)&&isDerived(y)){returnx.d===y.d;}returnfalse;}

Currently, this errors because both x and y still have type T, so they are missing the d property.

Metadata

Metadata

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions