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

Build error invalid value with Library function that returns Enum #6113

Closed
2 tasks done
neodaoist opened this issue Oct 25, 2023 · 0 comments · Fixed by alloy-rs/core#386
Closed
2 tasks done

Build error invalid value with Library function that returns Enum #6113

neodaoist opened this issue Oct 25, 2023 · 0 comments · Fixed by alloy-rs/core#386
Labels
T-bug Type: bug

Comments

@neodaoist
Copy link

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (950d863 2023-10-25T11:49:42.980532000Z)

What command(s) is the bug in?

forge build

Operating System

macOS (Apple Silicon)

Describe the bug

I'm encountering the following build error, when using an Enum as a return variable from a function inside a Library. The included code example is enough to reproduce on my machine.

Build error:

invalid value: string "LibCounter.TestEnum", expected a valid Solidity type specifier at line 1 column 169

Code example:

// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.21;

library LibCounter {
    enum TestEnum {
        NO,
        YES
    }

    function sayYes() external pure returns (TestEnum) {
        return TestEnum.YES;
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant