Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modifier cannot be found #1687

Open
haoyang9804 opened this issue Jan 7, 2025 · 0 comments
Open

modifier cannot be found #1687

haoyang9804 opened this issue Jan 7, 2025 · 0 comments

Comments

@haoyang9804
Copy link

haoyang9804 commented Jan 7, 2025

Describe the bug
I invoke a modifier after the constructor such as constructor() modifier31(), the modifier is defined in the same contract but the compiler complains that the modifier cannot be found. I also tried to use Solidity compiler to compile the test program, and it passed the compilation.

This bug is detected by Erwin

To Reproduce

Use solang --compile --target solana the compile the test program below.

Expected behavior
The program should pass the compilation.

Screenshots
Image

Hyperledger Solang version
solang version v0.3.3

Include the complete solidity source code

contract contract0 {
  struct struct1 {
    bool var2;
  }

  struct struct3 {
    int16 var4;
    int16 var5;
  }

  mapping(int16 => bool) public mapping6;

  modifier modifier9() {
    int16 var10;
    var10--;
    _;
  }

  function func13() internal view modifier9() returns (string memory var14) {
    var14 = var14;
    bool var18 = true;
    bool var19 = true;
    int16 var20 = 1;
    for (mapping(int16 => bool) storage mapping15 = (mapping6); (var19 && (var18)); (var20 %= struct3(int16(-17061), int16(-23874)).var5)) {}
    string memory var21 = "111";
    var21 = var21;
    return (var21);
  }
}

contract contract22 {
  event event23();

  struct struct24 {
    string var25;
    mapping(int16 => contract0.struct1) mapping26;
  }

  string internal var30;

  modifier modifier31() {
    contract0.struct1 memory struct_instance32;
    struct_instance32 = struct_instance32;
    !struct_instance32.var2;
    _;
  }

  modifier modifier33(string calldata var34) {
    int16 var35;
    var35++;
    _;
  }

  constructor() modifier31() {
    int16 var39 = 1;
    do {} while((int16(-26842)) < (var39));
  }

  function func36(int16 var37) internal pure returns (int16 var38) {
    int16 var40 = 1;
    (++var40);
  }
}```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant