We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently, options are treated like unknown values, or even unknown types.
However, it would be pretty simple to handle cases where the value is known and validation / optimization can be done.
option enabled: bool; fn main() { const if (enabled) { // enabled is known to be true here } }
option value: i32; fn main() -> i32 { const if (value == 42) return value + 5; //< optimized by return 47 else return value; //< kept as is }
Theses examples may seem a bit silly, but will become more interesting once we have function inlining
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Currently, options are treated like unknown values, or even unknown types.
However, it would be pretty simple to handle cases where the value is known and validation / optimization can be done.
Theses examples may seem a bit silly, but will become more interesting once we have function inlining
The text was updated successfully, but these errors were encountered: