-
Notifications
You must be signed in to change notification settings - Fork 1.1k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
constant Option is not recognised as constant value in inline if #17788
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
Comments
inverse to #14245 |
In case of .isDefined is problematic:
result:
|
Not sure, this is a bug or not ? |
Doesn't look like a bug to me. There's no way the compiler can tell that |
I'm not against closing this issue, but want to leave a remark just from the loving to argue:
On another side, you are right, that this is more a feature request than a bug. |
Any kind of evaluation performed by inlining must be hardcoded in the compiler. The more we make it do, the slower it will become. On the other hand, with macros, the code is in the library (such as |
TIL FromExpr! 😄 Sounds like a plausible feature request to me, so feel free to rehash this as a request in lampepfl/dotty-feature-requests. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Compiler version
current (Tue Jan 11 08:53:51 EET 2022) master
Minimized code
Output
Expectation
Should be compiled.
The text was updated successfully, but these errors were encountered: