Skip to content

bytesN.length fails to compile in the Slang frontend #744

Description

@hedgar2017

.length on a fixed-bytes value fails MLIR legalization. Legacy and the C++ frontend fold it to N and still evaluate the base.

contract C {
    function f(bytes32 x) public pure returns (uint256) { return x.length; }
}

Witnesses: semanticTests/array/fixed_bytes_length_access.sol, semanticTests/various/code_length_contract_member.sol.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcorrectnessMakes the compiler's output right

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions