Skip to content

Save narrowing results #193

@kaleidawave

Description

@kaleidawave

Currently narrowing calls can be done multiple times for an type.

const x = a && b && c && d;
1.		  ^ a is truthy
2.		  ^^^^^^ a & b are truthy
3.		  ^^^^^^^^^^^ a, b & c are truthy

if (x) { }
4.  ^ a, b, c & d are truthy

Don't have a great example, maybe can come up with a better one?

Probably not too much of a problem, might be possible to create large chains that do become a problem for performance though, maybe something can be done about that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    compiler-performanceMaking parsing / type checking / transformations fasternarrowingExpressions that change the types of values

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions