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

Incorrect Handling of pure Function #221

Open
Subway2023 opened this issue Mar 2, 2025 · 0 comments
Open

Incorrect Handling of pure Function #221

Subway2023 opened this issue Mar 2, 2025 · 0 comments
Labels
C-bug Category: this is a bug

Comments

@Subway2023
Copy link

contract TestCompiler {
    uint256 someValue = 10;

    function test() public pure returns (uint256) {
        return someValue;
    }
}

solar --version: 0.1.1
solc reports an error when compiling this program, but solar does not.

solc test.sol

Error: Function declared as pure, but this expression (potentially) reads from the environment or state and thus requires "view".
 --> llmGen/solFromError/0eff.sol:6:16:
  |
6 |         return someValue;
  |                ^^^^^^^^^
@Subway2023 Subway2023 added the C-bug Category: this is a bug label Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: this is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant