-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Closed
Labels
DuplicateAn existing issue was already createdAn existing issue was already created
Description
Bug Report
π Search Terms
Type inferance
π Version & Regression Information
This bug occurs in version 4.5.2;
β― Playground Link
Playground link with relevant code
π» Code
function tIsOfTypeP(t: T): t is P {
// Logic
}
const array: T[] = [...];
// newArray is still of type T[]
const newArray = array
.filter(t => tIsOfTypeP(t));π Actual behavior
The variable newArray is of type Array<T>.
π Expected behavior
The variable newArray is of type Array<P>. You know that only elements will remain of type P.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
DuplicateAn existing issue was already createdAn existing issue was already created