Closed chriseth closed 4 years ago
For eWasm this is u64, for EVM it is u265.
@chriseth I think you meant u256
I think a good step here is to modify the AST right after parsing (or during?) by replacing all empty types by the default type. Likewise, during printing, all default types are replaced by the empty type.
@mijovic something similar to the VarDeclInitializer should be done to InlineModifier::performInline
, line 201. Maybe it could make sense to make "zeroLiteralForType" a virtual function of Dialect.
Please create a new test similar to test/libyul/yulOptimizerTests/fullInliner/multi_return.yul
, but with evmTyped as dialect and change one of the return variables of the function to bool
.
Since eWasm has different types, we have to enable the type system in Yul before eWasm can be completed. To make the code better readable, each Yul dialect will have a default type which does not have to be explicitly mentioned. For eWasm this is u64, for EVM it is u256.
The Yul parser, analyzer and printer should all honour types and the analyzer should also check them (#2324).
It is to be discussed whether
bool
should be introduced as a type in the EVM dialect.It should also be discussed how dialects deal with types for literals.
false
for bool variables.