Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save narrowing results #193

Open
kaleidawave opened this issue Aug 20, 2024 · 0 comments
Open

Save narrowing results #193

kaleidawave opened this issue Aug 20, 2024 · 0 comments
Labels
compiler-performance Making parsing / type checking / transformations faster narrowing Expressions that change the types of values

Comments

@kaleidawave
Copy link
Owner

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?

@kaleidawave kaleidawave added compiler-performance Making parsing / type checking / transformations faster narrowing Expressions that change the types of values labels Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler-performance Making parsing / type checking / transformations faster narrowing Expressions that change the types of values
Projects
None yet
Development

No branches or pull requests

1 participant