Merge pull request #9614 from ethereum/yul-hex

Update tests/documentation to show that hex literals are not supported in Yul
This commit is contained in:
Daniel Kirchner
2020-08-13 03:11:45 +02:00
committed by GitHub
9 changed files with 61 additions and 4 deletions
@@ -0,0 +1,9 @@
contract C {
function f() public pure {
assembly {
let x := hex"0011"
}
}
}
// ----
// ParserError 1856: (72-81): Literal or identifier expected.
@@ -0,0 +1,9 @@
contract C {
function f() public pure {
assembly {
pop(hex"2233")
}
}
}
// ----
// ParserError 1856: (67-76): Literal or identifier expected.
@@ -0,0 +1,11 @@
contract C {
function f() public pure {
assembly {
switch codesize()
case hex"00" {}
case hex"1122" {}
}
}
}
// ----
// ParserError 1856: (92-99): Literal or identifier expected.
@@ -0,0 +1,9 @@
contract C {
function f() public pure {
assembly {
switch codesize()
case "1" {}
case "2" {}
}
}
}