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

Compiler panics when duplicate enum declarations exists in library #5925

Open
bitzoic opened this issue Apr 26, 2024 · 0 comments
Open

Compiler panics when duplicate enum declarations exists in library #5925

bitzoic opened this issue Apr 26, 2024 · 0 comments
Labels
bug Something isn't working compiler General compiler. Should eventually become more specific as the issue is triaged

Comments

@bitzoic
Copy link
Member

bitzoic commented Apr 26, 2024

In the following example we have this project structure:

project/
├── src/
|   ├── main.sw
│   └──lib.sw
└── Forc.toml

Our library lib.sw has a definition for MyEnum:

library;

pub enum MyEnum {
    variant1: b256,
    variant2: u64,
}

Our contract redefines MyEnum and imports the library:

contract;

mod lib;

use lib::*;

pub enum MyEnum {
    variant1: b256,
    variant2: u64,
}

This results in the following error:

Screenshot 2024-04-26 at 1 59 54 PM

Tested using forc v0.56.0

@bitzoic bitzoic added bug Something isn't working compiler General compiler. Should eventually become more specific as the issue is triaged labels Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler General compiler. Should eventually become more specific as the issue is triaged
Projects
None yet
Development

No branches or pull requests

1 participant