-
Notifications
You must be signed in to change notification settings - Fork 215
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
Evaluate Comparison Expressions with Constant Operands during Compilation #1650
base: main
Are you sure you want to change the base?
Conversation
As a first time contributor to this project, I'd like to ask some questions:
I am new to rust, so if you find anything that goes against conventional programming style in rust, please let me know! |
2ee062f
to
881bb2e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One way to write a test for this is to add test to tests/codegen_tests/..
which does something like the following:
contract C {
function foo() public returns (bool) {
int a = 100;
return a < 200;
}
function bar() public returns (bool r) {
int a = 100;
int b = 200;
r = a < b;
}
}
Make sure the test ensures that the code generation constant folds the expressions and generates false
for both functions.
Have you checked our contributing guide https://solang.readthedocs.io/en/latest/contributing.html? |
I've added a similar test case as you've suggested, and when I try to execute it as:
I find |
…tion This patch supports evaluation of comparison expressions with constants as operands during compile time.
This patch supports evaluation of comparison expressions with constants as operands during compile time.
Fixes #755