You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, in the following case, it can mistakenly seen a non constant expression as constant;
fnis_not_constant(val:Field) -> Field{// val can be non constantreturn1 + 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.
The text was updated successfully, but these errors were encountered:
yeah, I think we still need to propagate whether it is a constant or not. For example, the functions support const attribute that enforce the argument to be constant.
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;
1 + val
can be a non constant field type asval
can be a non constant.Therefore, when computing the types for the binary operations, it should take cares of the both sides.
The text was updated successfully, but these errors were encountered: