mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
InlineAssembly: Extracting tests for name clashes.
This commit is contained in:
parent
55f9eab51f
commit
3597c8343d
@ -228,30 +228,6 @@ BOOST_AUTO_TEST_CASE(opcode_for_function_args)
|
||||
CHECK_PARSE_ERROR("{ function f() -> gas { } }", ParserError, "Cannot use builtin");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(name_clashes)
|
||||
{
|
||||
CHECK_PARSE_ERROR("{ let g := 2 function g() { } }", DeclarationError, "Variable name g already taken in this scope");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(name_clashes_function_subscope)
|
||||
{
|
||||
CHECK_PARSE_ERROR("{ function g() { function g() {} } }", DeclarationError, "Function name g already taken in this scope");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(name_clashes_function_subscope_reverse)
|
||||
{
|
||||
CHECK_PARSE_ERROR("{ { function g() {} } function g() { } }", DeclarationError, "Function name g already taken in this scope");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(name_clashes_function_variable_subscope)
|
||||
{
|
||||
CHECK_PARSE_ERROR("{ function g() { let g := 0 } }", DeclarationError, "Variable name g already taken in this scope");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(name_clashes_function_variable_subscope_reverse)
|
||||
{
|
||||
CHECK_PARSE_ERROR("{ { let g := 0 } function g() { } }", DeclarationError, "Variable name g already taken in this scope");
|
||||
}
|
||||
BOOST_AUTO_TEST_CASE(variable_access_cross_functions)
|
||||
{
|
||||
CHECK_PARSE_ERROR("{ let x := 2 function g() { pop(x) } }", DeclarationError, "Identifier not found.");
|
||||
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
function g() {
|
||||
let g := 0
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// DeclarationError 1395: (20-30): Variable name g already taken in this scope.
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
{ let g := 0 }
|
||||
function g() {}
|
||||
}
|
||||
// ----
|
||||
// DeclarationError 1395: (5-15): Variable name g already taken in this scope.
|
7
test/libyul/yulSyntaxTests/name_clash_sub_scope.yul
Normal file
7
test/libyul/yulSyntaxTests/name_clash_sub_scope.yul
Normal file
@ -0,0 +1,7 @@
|
||||
{
|
||||
function g() {
|
||||
function g() {}
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// DeclarationError 6052: (20-35): Function name g already taken in this scope.
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
{
|
||||
function g() {}
|
||||
}
|
||||
function g() {}
|
||||
}
|
||||
// ----
|
||||
// DeclarationError 6052: (7-22): Function name g already taken in this scope.
|
6
test/libyul/yulSyntaxTests/name_clashes.yul
Normal file
6
test/libyul/yulSyntaxTests/name_clashes.yul
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
let g := 2
|
||||
function g() { }
|
||||
}
|
||||
// ----
|
||||
// DeclarationError 1395: (6-16): Variable name g already taken in this scope.
|
Loading…
Reference in New Issue
Block a user