mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #4464 from cryptomental/bugfix/fix-typos-in-AsmParser-and-TypeChecker
AsmParser,TypeChecker: Fix typos.
This commit is contained in:
commit
12045d2e11
@ -1818,7 +1818,7 @@ bool TypeChecker::visit(FunctionCall const& _functionCall)
|
|||||||
if (functionType->takesArbitraryParameters())
|
if (functionType->takesArbitraryParameters())
|
||||||
m_errorReporter.typeError(
|
m_errorReporter.typeError(
|
||||||
_functionCall.location(),
|
_functionCall.location(),
|
||||||
"Named arguments cannnot be used for functions that take arbitrary parameters."
|
"Named arguments cannot be used for functions that take arbitrary parameters."
|
||||||
);
|
);
|
||||||
else if (parameterNames.size() > argumentNames.size())
|
else if (parameterNames.size() > argumentNames.size())
|
||||||
m_errorReporter.typeError(_functionCall.location(), "Some argument names are missing.");
|
m_errorReporter.typeError(_functionCall.location(), "Some argument names are missing.");
|
||||||
|
@ -150,7 +150,7 @@ assembly::Statement Parser::parseStatement()
|
|||||||
expectToken(Token::Comma);
|
expectToken(Token::Comma);
|
||||||
elementary = parseElementaryOperation();
|
elementary = parseElementaryOperation();
|
||||||
if (elementary.type() != typeid(assembly::Identifier))
|
if (elementary.type() != typeid(assembly::Identifier))
|
||||||
fatalParserError("Variable name expected in multiple assignemnt.");
|
fatalParserError("Variable name expected in multiple assignment.");
|
||||||
assignment.variableNames.emplace_back(boost::get<assembly::Identifier>(elementary));
|
assignment.variableNames.emplace_back(boost::get<assembly::Identifier>(elementary));
|
||||||
}
|
}
|
||||||
while (currentToken() == Token::Comma);
|
while (currentToken() == Token::Comma);
|
||||||
|
@ -267,7 +267,7 @@ BOOST_AUTO_TEST_CASE(recursion_depth)
|
|||||||
BOOST_AUTO_TEST_CASE(multiple_assignment)
|
BOOST_AUTO_TEST_CASE(multiple_assignment)
|
||||||
{
|
{
|
||||||
CHECK_ERROR("{ let x:u256 function f() -> a:u256, b:u256 {} 123:u256, x := f() }", ParserError, "Label name / variable name must precede \",\" (multiple assignment).");
|
CHECK_ERROR("{ let x:u256 function f() -> a:u256, b:u256 {} 123:u256, x := f() }", ParserError, "Label name / variable name must precede \",\" (multiple assignment).");
|
||||||
CHECK_ERROR("{ let x:u256 function f() -> a:u256, b:u256 {} x, 123:u256 := f() }", ParserError, "Variable name expected in multiple assignemnt.");
|
CHECK_ERROR("{ let x:u256 function f() -> a:u256, b:u256 {} x, 123:u256 := f() }", ParserError, "Variable name expected in multiple assignment.");
|
||||||
|
|
||||||
/// NOTE: Travis hiccups if not having a variable
|
/// NOTE: Travis hiccups if not having a variable
|
||||||
char const* text = R"(
|
char const* text = R"(
|
||||||
|
@ -461,7 +461,7 @@ BOOST_AUTO_TEST_CASE(recursion_depth)
|
|||||||
BOOST_AUTO_TEST_CASE(multiple_assignment)
|
BOOST_AUTO_TEST_CASE(multiple_assignment)
|
||||||
{
|
{
|
||||||
CHECK_PARSE_ERROR("{ let x function f() -> a, b {} 123, x := f() }", ParserError, "Label name / variable name must precede \",\" (multiple assignment).");
|
CHECK_PARSE_ERROR("{ let x function f() -> a, b {} 123, x := f() }", ParserError, "Label name / variable name must precede \",\" (multiple assignment).");
|
||||||
CHECK_PARSE_ERROR("{ let x function f() -> a, b {} x, 123 := f() }", ParserError, "Variable name expected in multiple assignemnt.");
|
CHECK_PARSE_ERROR("{ let x function f() -> a, b {} x, 123 := f() }", ParserError, "Variable name expected in multiple assignment.");
|
||||||
|
|
||||||
/// NOTE: Travis hiccups if not having a variable
|
/// NOTE: Travis hiccups if not having a variable
|
||||||
char const* text = R"(
|
char const* text = R"(
|
||||||
|
@ -0,0 +1,7 @@
|
|||||||
|
contract C {
|
||||||
|
function f() pure public {
|
||||||
|
abi.encodeWithSelector({selector:"abc"});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ----
|
||||||
|
// TypeError: (52-92): Named arguments cannot be used for functions that take arbitrary parameters.
|
Loading…
Reference in New Issue
Block a user