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

ABIs do not inherit constants from their superABIs #4869

Open
anton-trunov opened this issue Jul 26, 2023 · 0 comments
Open

ABIs do not inherit constants from their superABIs #4869

anton-trunov opened this issue Jul 26, 2023 · 0 comments
Labels
ABI Everything to do the ABI, especially the JSON representation bug Something isn't working compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen

Comments

@anton-trunov
Copy link
Contributor

This issue is essentially the same as #4867. We have planned to resolve it after #4272 is merged.

The following piece of code should compile (but it does not at the moment):

contract;

abi MySuperAbi {
    const SUPER_ABI_CONSTANT: u64;
    fn super_abi_method() -> u64;
}

abi MyAbi : MySuperAbi {
    fn abi_method() -> u64;
}

impl MySuperAbi for Contract {
    const SUPER_ABI_CONSTANT: u64 = 42;
    fn super_abi_method() -> u64 { Self::SUPER_ABI_CONSTANT }
}

impl MyAbi for Contract {
    fn abi_method() -> u64 { Self::SUPER_ABI_CONSTANT }
}
@anton-trunov anton-trunov added bug Something isn't working ABI Everything to do the ABI, especially the JSON representation compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen labels Jul 26, 2023
@anton-trunov anton-trunov mentioned this issue Jul 25, 2023
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ABI Everything to do the ABI, especially the JSON representation bug Something isn't working compiler: frontend Everything to do with type checking, control flow analysis, and everything between parsing and IRgen
Projects
None yet
Development

No branches or pull requests

1 participant