-
-
Notifications
You must be signed in to change notification settings - Fork 661
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
Early returns in NullCoal #10791
Early returns in NullCoal #10791
Conversation
That Also Note that this is also true for a |
8c3afdd
to
2dc1155
Compare
I took a look at that function myself. Your test cases made me realize that this is trickier than I thought in some regards. I left some comments, please see if this makes sense to you! I didn't check how this affects the case in |
Also I remembered that somebody added |
Thank you for help, it was too complicated for me. Glad my test cases were helpful. eq("Null<Int>", typeString(v ?? {
for (i in 0...1) {
return;
}
v;
})); This shows on hover |
Yes that's probably from loop unrolling. The |
Actually that for (i in [a, return]) {
break;
} So it's better to ignore the condition after all. |
I don't understand this: |
You're right, I applied some sort of loop unrolling in my head, but that's not what actually happens evaluation-wise. |
Thank you for your patience! |
Closes #10771