Skip to content

[Breaking] Change error from directive to keyword. - #16998

Draft
blishko wants to merge 1 commit into
new-breakingfrom
error-as-keyword
Draft

blishko wants to merge 1 commit into
new-breakingfrom
error-as-keyword

Conversation

@blishko

@blishko blishko commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

This is an updated version of the original PR #11218.

More context:
Plans for keywords in 0.9: #14770
Discussions specifically about error as keyword: #11743, #11859, #14770 (comment).

Comment on lines 2 to 9
interface I {
struct S { S s; }
function f(E storage e) {
error E;
emit E();
++c;
uint calldata c = 123.4;
}
}

@blishko blishko Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

What's the point of this test?
I believe error E; as a statement in a function should now cause a parser error.
If this test is supposed to get past the parsing stage then we need to remove this statement.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What's the point of this test?

I think we discussed it in chat, but yes, the point is to test the behaviour of the parser without the subsequent analysis step (that would absolutely fail all of these).

If this test is supposed to get past the parsing stage then we need to remove this statement.

Yup, that's exactly right.

This is an updated version of the original commit from 2021.
@nikola-matic

Copy link
Copy Markdown
Contributor

I think it would be nice for us to have a protocol in place when opening PRs the target the breaking branch; e.g. prefix PRs with [breaking] or something like that, so that it's easier to scan for these when looking at the PR list.

@blishko

blishko commented Sep 14, 2026

Copy link
Copy Markdown
Contributor Author

I think it would be nice for us to have a protocol in place when opening PRs the target the breaking branch; e.g. prefix PRs with [breaking] or something like that, so that it's easier to scan for these when looking at the PR list.

That's a good idea. Sorry, I got distracted and did not label this PR as breaking.
We can use both label and title prefix.

@blishko blishko changed the title Change error from directive to keyword. [Breaking] Change error from directive to keyword. Sep 14, 2026
@blishko
blishko marked this pull request as draft September 14, 2026 15:15
@blishko
blishko marked this pull request as draft September 14, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants