mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Moved test.
This commit is contained in:
parent
8e318181e9
commit
27ba665694
@ -215,7 +215,7 @@ assembly::VariableDeclaration Parser::parseVariableDeclaration()
|
||||
expectToken(Token::Let);
|
||||
varDecl.name = m_scanner->currentLiteral();
|
||||
if (s_instructions.count(varDecl.name))
|
||||
fatalParserError("Cannot shadow instructions with variable declaration.");
|
||||
fatalParserError("Cannot use instruction names for identifier names.");
|
||||
expectToken(Token::Identifier);
|
||||
expectToken(Token::Colon);
|
||||
expectToken(Token::Assign);
|
||||
|
@ -182,6 +182,12 @@ BOOST_AUTO_TEST_CASE(error_tag)
|
||||
BOOST_CHECK(successAssemble("{ invalidJumpLabel }"));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(inline_assembly_shadowed_instruction)
|
||||
{
|
||||
// Error message: "Cannot use instruction names for identifier names."
|
||||
BOOST_CHECK(!successAssemble("{ let gas := 1 }"));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
}
|
||||
|
@ -1479,20 +1479,6 @@ BOOST_AUTO_TEST_CASE(function_type_state_variable)
|
||||
BOOST_CHECK(successParse(text));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(inline_assembly_shadowed_instruction)
|
||||
{
|
||||
char const* text = R"(
|
||||
contract A {
|
||||
function f() {
|
||||
assembly {
|
||||
let gas := 1
|
||||
}
|
||||
}
|
||||
}
|
||||
)";
|
||||
CHECK_PARSE_ERROR(text, "Cannot shadow instructions with variable declaration.");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user