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

[ICE]: struct with mappings as argument to a library function #128

Closed
samooyo opened this issue Nov 18, 2024 · 0 comments · Fixed by #149
Closed

[ICE]: struct with mappings as argument to a library function #128

samooyo opened this issue Nov 18, 2024 · 0 comments · Fixed by #149
Assignees
Labels
C-bug Category: this is a bug

Comments

@samooyo
Copy link

samooyo commented Nov 18, 2024

Code

// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

struct StructTest {
    uint256 a;
    mapping(uint256 index => uint256) data;
}

library TestLibrary {
    function testFunction(StructTest storage testParameter) external view returns (uint256) {
        return testParameter.a;
    }
}

Rust Version

solar Version: 0.1.0
Commit SHA: fff9d9f8e652bbfb2405211f544047ab8a221b84
Build Timestamp: 2024-11-08T04:36:07.494153185Z
Build Features: asm,default,jemalloc
Build Profile: dist

Current error output

error: types containing mappings cannot be parameter or return types of public functions
  --> src/Counter.sol:10:27
   |
10 |     function testFunction(StructTest storage testParameter) external view returns (uint256) {
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |

Anything else?

The following file compiles with solc v0.8.26, but fails with Solar.

@samooyo samooyo added C-bug Category: this is a bug I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Nov 18, 2024
@DaniPopes DaniPopes self-assigned this Nov 18, 2024
@DaniPopes DaniPopes removed the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Nov 18, 2024
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.

2 participants