Open
Description
In type checking phase, the type of a binary operation expression is only determined by the left hand side:
noname/src/type_checker/checker.rs
Line 389 in a2d31f7
However, in the following case, it can mistakenly seen a non constant expression as constant;
fn is_not_constant(val: Field) -> Field {
// val can be non constant
return 1 + val;
}
1 + val
can be a non constant field type as val
can be a non constant.
Therefore, when computing the types for the binary operations, it should take cares of the both sides.