-
Notifications
You must be signed in to change notification settings - Fork 61
Labels
A-semaArea: semantic analysisArea: semantic analysisC-enhancementCategory: an issue proposing an enhancement or a PR with oneCategory: an issue proposing an enhancement or a PR with oneE-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.P-highHigh priorityHigh priority
Description
Describe the feature
type public x
in contracts should also generate a function x(...) public view returns(...)
function that returns the variable. This is more complicated for arrays and mappings.
This should be done during lowering from AST to HIR, by creating a new HIR function.
Additional context
- solc docs https://docs.soliditylang.org/en/latest/contracts.html#getter-functions
- alloy sol-macro implementation of a similar generation https://github.com/alloy-rs/core/blob/0441d7939bcdb5c25d638a48f474dfce625ed26f/crates/sol-macro-expander/src/expand/var_def.rs
Metadata
Metadata
Assignees
Labels
A-semaArea: semantic analysisArea: semantic analysisC-enhancementCategory: an issue proposing an enhancement or a PR with oneCategory: an issue proposing an enhancement or a PR with oneE-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.P-highHigh priorityHigh priority