Skip to content

Using this to get access to a state variable of struct instance causes an bool-type var #15525

Closed as not planned
@haoyang9804

Description

@haoyang9804

Description

The line true ? contract0.struct1(true) : this.struct_instance13(); causes an error with the following error message: True expression's type struct contract0.struct1 memory does not match false expression's type bool. I think both sides are of type contract0.struct1.

contract contract0 {
  struct struct1 {
    bool struct_member2;
  }
}

contract contract12 {
  contract0.struct1 public struct_instance13;

  function func14() public view {
    true ? contract0.struct1(true) : this.struct_instance13();
  }
}

Environment

  • Compiler version: 0.8.28-develop.2024.10.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions