Tests for suffixes with reserved names that could otherwise cause ambiguities

This commit is contained in:
Kamil Śliwak 2023-03-23 13:02:22 +01:00
parent a65a0233a3
commit 65d1ae5d48
3 changed files with 21 additions and 0 deletions

View File

@ -0,0 +1,7 @@
function delete(uint) pure suffix returns (uint) {}
contract C {
uint x = 1 delete;
}
// ----
// ParserError 2314: (9-15): Expected identifier but got 'delete'

View File

@ -0,0 +1,7 @@
function hex(uint) pure suffix returns (bytes memory) {}
contract C {
bytes b = 1 hex"1234";
}
// ----
// ParserError 2314: (9-12): Expected identifier but got 'ILLEGAL'

View File

@ -0,0 +1,7 @@
function new(uint) pure suffix returns (uint) {}
contract C {
uint x = 1 new;
}
// ----
// ParserError 2314: (9-12): Expected identifier but got 'new'