Fix shadowing error for inline assembly.

This commit is contained in:
chriseth
2021-08-17 12:12:56 +02:00
parent 838514a718
commit aeb2438eab
25 changed files with 67 additions and 56 deletions
@@ -9,4 +9,5 @@ contract C {
}
}
// ----
// DeclarationError 3859: (103-104): This declaration shadows a declaration outside the inline assembly block.
// DeclarationError 6578: (123-124): Cannot access local Solidity variables from inside an inline assembly function.
@@ -1,5 +1,5 @@
contract C {
function f() public pure {
function g() public pure {
assembly {
function f(a) {}
@@ -1,7 +1,7 @@
contract C {
function f() pure public {
assembly {
function f (a, b , c ) -> y,x,z {
function g (a, b , c ) -> y,x,z {
}
}
}
@@ -1,8 +1,8 @@
contract C {
function f() public pure {
assembly {
function f() {}
f := 1
function g() {}
g := 1
}
}
}
@@ -1,5 +1,5 @@
contract C {
function f() public pure {
function g() public pure {
assembly {
function f(a., x.b) -> t.b, b.. {}
}
@@ -1,5 +1,5 @@
contract C {
function f() public pure {
function g() public pure {
assembly {
function f() -> x, y, z {}
let a., aa.b := f()
@@ -49,7 +49,5 @@ contract C {
// DeclarationError 4113: (595-600): The identifier name "super" is reserved.
// DeclarationError 4113: (645-646): The identifier name "_" is reserved.
// DeclarationError 4113: (759-763): The identifier name "this" is reserved.
// DeclarationError 3859: (759-763): This declaration shadows a declaration outside the inline assembly block.
// DeclarationError 4113: (785-790): The identifier name "super" is reserved.
// DeclarationError 3859: (785-790): This declaration shadows a declaration outside the inline assembly block.
// DeclarationError 4113: (812-813): The identifier name "_" is reserved.
@@ -1,7 +1,7 @@
contract C {
function f() public pure {
assembly {
function f() {
function g() {
leave
}
}
@@ -0,0 +1,11 @@
contract C {
uint x;
function f() public pure {
assembly {
function g(f) -> x {}
}
}
}
// ----
// DeclarationError 3859: (98-99): This declaration shadows a declaration outside the inline assembly block.
// DeclarationError 3859: (104-105): This declaration shadows a declaration outside the inline assembly block.
@@ -0,0 +1,9 @@
contract C {
function f() public pure {
assembly {
function f() {}
}
}
}
// ----
// DeclarationError 3859: (75-90): This declaration shadows a declaration outside the inline assembly block.
@@ -0,0 +1,10 @@
contract C {
function f() public pure {
uint a;
assembly {
function g(a) {}
}
}
}
// ----
// DeclarationError 3859: (102-103): This declaration shadows a declaration outside the inline assembly block.