Skip to content

[Bug-Candidate]: The ternary operator does not support structs. #2836

@lum7na

Description

@lum7na

Describe the issue:

Run slither a.sol given:

slither.slithir.exceptions.SlithIRError: Ternary operator are not convertible to SlithIR if true then a.user else b.user
ERROR:root:Error:
ERROR:root:Ternary operator are not convertible to SlithIR if true then a.user else b.user
ERROR:root:Please report an issue to https://github.com/crytic/slither/issues`

Code example to reproduce the issue:

contract A {
    struct S {
        uint32 user;
    }
}

contract B {
    A.S a;

    A.S b;

    A[] array = new A[]((true ? a.user : b.user));
}

Version:

0.11.3

Relevant log output:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug-candidateBugs reports that are not yet confirmed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions