FuelLabs / FuelLabs/sway

Make ABI declaration a special case of trait declaration in AST

Open
#4,136 1 comment 1 reaction 0 assignees View on GitHub
code quality compiler: frontend team:compiler
Dominant language
Rust
Stars
61.4k
Forks
5.4k
Avg merge
3h 33m
Merged PRs (30d)
4

Description

Since we allow supertraits for ABIs and will soon allow superabis for ABIs, traits and ABIs are pretty much the same thing and hence could be represented more uniformly. I propose `ty::TyDeclaration::TraitDeclaration` and `ty::TyDeclaration::AbiDeclaration` should be the same enum variant with a field that lets us tell the difference. This should simplify the implementation of #4049.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the `ty::TyDeclaration` enum and the implementation of #4049, then trace how trait and ABI declarations are handled in the AST. The work is done when both declarations use one variant with a field distinguishing them and the related #4049 behavior remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.