Skip to content
New issue

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

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

Already on GitHub? # to your account

Aliases can make compilation fail with "missing core dependencies`" & Could not generate entry method #6569

Closed
DefiCake opened this issue Sep 19, 2024 · 0 comments · Fixed by #6628
Assignees
Labels
bug Something isn't working compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen team:compiler Compiler Team

Comments

@DefiCake
Copy link
Member

Related Component

compiler

Problem

Using an enum alias as a return type confuses the compiler and makes it fail on build.

contract;

use standards::src5::{SRC5, State as SRC5State};


configurable {
    INITIAL_OWNER: SRC5State = SRC5State::Initialized(Identity::Address(Address::zero()))
}

impl SRC5 for Contract {
    #[storage(read)]
    fn owner() -> SRC5State {
        INITIAL_OWNER
    }
}

Here, just renaming SRC5State back to State will make the build pass.

Steps

See reproduction: https://github.com/DefiCake/forc-alias-compilation-error

Possible Solution(s)

No response

Notes

No response

Installed components

forc --version
forc 0.63.5
@DefiCake DefiCake added bug Something isn't working triage This issue was opened with a template and needs to be triaged by code owners. labels Sep 19, 2024
@xunilrj xunilrj self-assigned this Oct 9, 2024
@IGI-111 IGI-111 added compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen and removed triage This issue was opened with a template and needs to be triaged by code owners. labels Oct 11, 2024
xunilrj added a commit that referenced this issue Nov 22, 2024
## Description

Fixes #6569


## Checklist

- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] If my change requires substantial documentation changes, I have
[requested support from the DevRel
team](https://github.com/FuelLabs/devrel-requests/issues/new/choose)
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [ ] I have requested a review from the relevant team or maintainers.
@IGI-111 IGI-111 added the team:compiler Compiler Team label Feb 10, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen team:compiler Compiler Team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants