Skip to content

Fix failures in index access to a type conversion #28

@blitz-1306

Description

@blitz-1306

In sample literals.config.sol there are following lines:
https://github.com/ConsenSys/sol2maruir/blob/8d5e1015b04e28cddc355dfdea96b381b9969d03/test/samples/solidity/literals.config.sol#L11-L14
This sample fail to be compiled due to ExpressionCompiler.compileIndexAccess() is unable to index access to a number literal with an IntType, that does not have sol_type set in metadata.

I did some investigation and figured that following lines are also involved: https://github.com/ConsenSys/sol2maruir/blob/8d5e1015b04e28cddc355dfdea96b381b9969d03/src/building/expression_compiler.ts#L2412-L2429
Seems that somewhere here we are not setting metadata for resulting expression and its type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions