v0.5.1
This release brings:
-
Quantification over numeric ranges/arrays:
The language now has a
forall
construct that allows to compute a universally quantified expression over numeric ranges/indices in an array. For example:
forall (uint x in 5...10) x >0
Is a predicate that evalutes to true
IFF for all values in the range from 5 (inclusive) to 10 (exclusive), its true that they are positive. (which is obviously true). Since iterating over arrays is a common use-case for this construct we have the following syntactic shortcut:
forall (uint i in arr) arr[i] > 0
The above expression is equivalent to the following form:
forall (uint i in 0...arr.length) arr[i] > 0
- Fix a bug which produces invalid code when instrumenting a constructor in Solidity 0.8.x