solang GitHub

Issue 755 Comparisons should support constants
good first issue When we declare a constant variable that has an initializer, e.g. `bool x constant = 0 < 2`, we evaluate the actual constant value in compiler time. Currently, there is no support to evaluate constants in comparisons, so the aforementioned example is evaluated in run time. We need to calculate comparisons with constants during compilation. The `eval_const_number` function should become `eval_const_expression` to evaluate boolean operators too. This function should be called at `fn var_decl` in `src/sema/` so that the initializer of a constant is evaluated at compile time.
Created At 2022-04-20 11:38:02 +0000 UTC
Issue 754 Overflow checking in constant arithmetic
good first issue There should be overflow checking in arithmetic operations using constants. E.g. `uint8 = 128 + 128` should raise an error. Ideally, this check can be done in function `eval_const_number` in `src/sema`.
Created At 2022-04-20 11:30:29 +0000 UTC
Issue 707 compiler message for overloaded functions is not great
good first issue Given this solidity: ``` contract C { function foo(int a) public {} function foo(int a, int b) public {} function foo(int a, int b, int c) public {} function bar() public { foo(true); } function bar2() public { foo({a:true}); } } ``` The error message you get is: ``` /home/sean/git/solang/overloaded.sol:6:3-12: error: cannot find overloaded function which matches signature Line 6: foo(true); ^^^^^^^^^ /home/sean/git/solang/overloaded.sol:9:3-16: error: cannot find overloaded function which matches signature Line 9: foo({a:true}); ^^^^^^^^^^^^^ ``` That is not useful. The error message should list the overloaded functions which were tried, and the error message for each of them. The same handling should be used for overloaded constructors when deploying a new contract.
Created At 2022-03-23 12:59:56 +0000 UTC