-
Notifications
You must be signed in to change notification settings - Fork 3
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
compile time constants #60
Comments
We could update that to make a widening of a constant also be a constant. In addition to changing that code, this part of the spec would need to be augmented. |
Or, without changing the spec, we could just use
|
I think that it is worth considering changing the spec, as that will be beneficial to other cases outside the Flags. It seem strange that implicit widening is optimised, but explicit is not. Presumably narrowing isn't either This will have an impact on performance I think as these constants get inlined to the caller |
discussed with @retronym on gitter - |
WIP https://github.com/scala/scala/compare/2.13.x...retronym:topic/constant-folder-unary?expand=1 There is overlap with scala#6452, which also needs to introduce some constant-related logic in |
It seems that some constants are deferred to run time.
This means that they generate more bytecode, and cant (probably) be inlined
e.g. Flags.scala has code like
generate bytecode like
but not for all fields
e.g
The text was updated successfully, but these errors were encountered: