Skip to content

Compilation failure when whitespace between require and terminating semi-colon #882

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
AntonGulak opened this issue Apr 4, 2024 · 2 comments

Comments

@AntonGulak
Copy link

AntonGulak commented Apr 4, 2024

Hi again :)

Contracts compiled with Solidity 0.4.21 are failing to compile when they include require(bool) statements, resulting in a
ParserError: Expected token Semicolon got 'Identifier' error. Specifically, require(false) c_3a887c65(0x55bf89d8a3187e04); /* requirePost */ HardhatError: HH600: Compilation failed.

Compilation succeeds without coverage

Thank you for the quick response

@cgewecke
Copy link
Member

cgewecke commented Apr 5, 2024

@AntonGulak This seems to be caused by the presence of extra space between the require and the terminating ;

A work-around is to change the code as below

- require(false) ;
+ require(false);

Unfortunately it's a little tricky to fix this - ideally the parser we use would include the semi-colon in its reporting of the expression range but it doesn't...

@cgewecke cgewecke changed the title Compilation failure on Solidity 0.4.21 due to require Compilation failure when whitespace between require and terminating semi-colon Apr 5, 2024
@cgewecke
Copy link
Member

cgewecke commented Apr 5, 2024

This has been patch via #884 and published in v0.8.12.

(Thanks again for finding all these bugs!!)

@cgewecke cgewecke closed this as completed Apr 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants