Skip to content

Fix named error parameter encoding order in IR codegen#16453

Open
nikola-matic wants to merge 3 commits intodevelopfrom
fix-named-error-paramater-encoding-in-ir
Open

Fix named error parameter encoding order in IR codegen#16453
nikola-matic wants to merge 3 commits intodevelopfrom
fix-named-error-paramater-encoding-in-ir

Conversation

@nikola-matic
Copy link
Contributor

Closes #16452

@cameel cameel changed the title Fix named error paremeter encoding order in IR codegen Fix named error parameter encoding order in IR codegen Feb 9, 2026
@github-actions github-actions bot added the stale The issue/PR was marked as stale because it has been open for too long. label Feb 24, 2026
@nikola-matic nikola-matic removed the stale The issue/PR was marked as stale because it has been open for too long. label Feb 24, 2026
@github-actions github-actions bot added the stale The issue/PR was marked as stale because it has been open for too long. label Mar 11, 2026
@argotorg argotorg deleted a comment from github-actions bot Mar 11, 2026
@argotorg argotorg deleted a comment from github-actions bot Mar 11, 2026
@nikola-matic nikola-matic removed the stale The issue/PR was marked as stale because it has been open for too long. label Mar 11, 2026
@nikola-matic nikola-matic force-pushed the fix-named-error-paramater-encoding-in-ir branch 3 times, most recently from 01fe6b9 to 0f978ea Compare March 13, 2026 15:34
Copy link
Collaborator

@cameel cameel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a lot more tests and a bug list entry.

Copy link
Collaborator

@cameel cameel Mar 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a part of due diligence for the fix we must make sure that similar functionality in other places is not affected. In this case this means checking named parameter support in language constructs. I'd especially verify events, as these share a lot of code with errors, but are more:

For these named parameters are not allowed, but they should be still covered with (failing) tests using them:

  • builtin calls
    • ABI encoding builtins
  • inherited constructor calls
  • modifier invocations
  • calls via function pointers
  • type conversions (these are not calls, but look the same to the parser)

Is there anything else I'm missing?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of questions:

  1. When you say getters - do you mean auto generated ones, and how would named parameters fit here? My assumption is that getters don't take any parameters?
  2. What do you mean by bare calls? call, staticcall, delegatecall? Can you give an example?

Copy link
Collaborator

@cameel cameel Mar 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My assumption is that getters don't take any parameters?

They do on array types. Though, now that I think of it, I'm not sure we support named arguments there. Please check in any case.

What do you mean by bare calls? call, staticcall, delegatecall?

Yes. Not sure what the name of the data argument is (and if we actually support named arguments there) but it would be something like this:

a.call({data: ""});

@cameel cameel added the codegen error Compiler generates invalid code. Critical. label Mar 16, 2026
@nikola-matic nikola-matic force-pushed the fix-named-error-paramater-encoding-in-ir branch 5 times, most recently from a6503ed to 8bd6e00 Compare March 17, 2026 13:15
@nikola-matic nikola-matic force-pushed the fix-named-error-paramater-encoding-in-ir branch from 8bd6e00 to 071ea8a Compare March 18, 2026 08:04
@nikola-matic nikola-matic requested a review from cameel March 18, 2026 08:05
@nikola-matic nikola-matic force-pushed the fix-named-error-paramater-encoding-in-ir branch from 071ea8a to 4524716 Compare March 18, 2026 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codegen error Compiler generates invalid code. Critical.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom error named parameters passed in call order instead of declaration order

2 participants