argotorg / argotorg/solidity

Refactor the mechanism for supplying arguments in codegen

Open
#16,529 0 comments 0 reactions 0 assignees View on GitHub
medium effort medium impact must have eventually refactor
Dominant language
C++
Stars
25.7k
Forks
6.2k
Avg merge
1d 11h
Merged PRs (30d)
21

Description

The [recent bug](https://github.com/argotorg/solidity/issues/16452) ([fixed](https://github.com/argotorg/solidity/pull/16453)) exposed a shortcoming in the manner in which we deal with supplying function parameters at their callsite (during code generation) depending on whether said parameters were provided in declaration order or as named parameters. If former, the arguments should be supplied using the `arguments()` function, whereas if named parameters are supported for that particular type of function call, then `sortedArguments()` must be used in order to make sure that the passed parameters (call site) are supplied in the correct order (declaration site).

One way to do this would be to make additional use of the `FuncCallArgument` `struct` as [suggested by](https://github.com/argotorg/solidity/pull/16453/changes#r2782321052) @cameel; other approaches can also be investigated for merit.

Ultimately, we should end up with a unique 'interface' that will always supply the parameters in correct order.

Contributor guide

Open the contributing guide

Research direction

Read the linked issue #16452 and fix #16453, then trace code-generation argument handling around FuncCallArgument, arguments(), and sortedArguments(). Compare declaration-order and named-parameter calls; done means a unique interface supplies parameters in the correct declaration order for both supported cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, solidity
Domain
compilers
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.