mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #10923 from ethereum/improve-error-reporting
Improve error reporting
This commit is contained in:
commit
2e699e8865
@ -31,6 +31,9 @@
|
|||||||
|
|
||||||
#include <liblangutil/ErrorReporter.h>
|
#include <liblangutil/ErrorReporter.h>
|
||||||
|
|
||||||
|
#include <libsolutil/CommonData.h>
|
||||||
|
#include <libsolutil/StringUtils.h>
|
||||||
|
|
||||||
#include <boost/range/adaptor/reversed.hpp>
|
#include <boost/range/adaptor/reversed.hpp>
|
||||||
#include <boost/algorithm/string.hpp>
|
#include <boost/algorithm/string.hpp>
|
||||||
|
|
||||||
@ -154,7 +157,12 @@ vector<YulString> AsmAnalyzer::operator()(Identifier const& _identifier)
|
|||||||
);
|
);
|
||||||
if (!found && watcher.ok())
|
if (!found && watcher.ok())
|
||||||
// Only add an error message if the callback did not do it.
|
// Only add an error message if the callback did not do it.
|
||||||
m_errorReporter.declarationError(8198_error, _identifier.location, "Identifier not found.");
|
m_errorReporter.declarationError(
|
||||||
|
8198_error,
|
||||||
|
_identifier.location,
|
||||||
|
"Identifier \"" + _identifier.name.str() + "\" not found."
|
||||||
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return {type};
|
return {type};
|
||||||
@ -199,7 +207,9 @@ void AsmAnalyzer::operator()(Assignment const& _assignment)
|
|||||||
m_errorReporter.declarationError(
|
m_errorReporter.declarationError(
|
||||||
8678_error,
|
8678_error,
|
||||||
_assignment.location,
|
_assignment.location,
|
||||||
"Variable count does not match number of values (" +
|
"Variable count for assignment to \"" +
|
||||||
|
joinHumanReadable(applyMap(_assignment.variableNames, [](auto const& _identifier){ return _identifier.name.str(); })) +
|
||||||
|
"\" does not match number of values (" +
|
||||||
to_string(numVariables) +
|
to_string(numVariables) +
|
||||||
" vs. " +
|
" vs. " +
|
||||||
to_string(types.size()) +
|
to_string(types.size()) +
|
||||||
@ -235,7 +245,9 @@ void AsmAnalyzer::operator()(VariableDeclaration const& _varDecl)
|
|||||||
m_errorReporter.declarationError(
|
m_errorReporter.declarationError(
|
||||||
3812_error,
|
3812_error,
|
||||||
_varDecl.location,
|
_varDecl.location,
|
||||||
"Variable count mismatch: " +
|
"Variable count mismatch for declaration of \"" +
|
||||||
|
joinHumanReadable(applyMap(_varDecl.variables, [](auto const& _identifier){ return _identifier.name.str(); })) +
|
||||||
|
+ "\": " +
|
||||||
to_string(numVariables) +
|
to_string(numVariables) +
|
||||||
" variables and " +
|
" variables and " +
|
||||||
to_string(types.size()) +
|
to_string(types.size()) +
|
||||||
@ -314,7 +326,11 @@ vector<YulString> AsmAnalyzer::operator()(FunctionCall const& _funCall)
|
|||||||
}))
|
}))
|
||||||
{
|
{
|
||||||
if (!validateInstructions(_funCall))
|
if (!validateInstructions(_funCall))
|
||||||
m_errorReporter.declarationError(4619_error, _funCall.functionName.location, "Function not found.");
|
m_errorReporter.declarationError(
|
||||||
|
4619_error,
|
||||||
|
_funCall.functionName.location,
|
||||||
|
"Function \"" + _funCall.functionName.name.str() + "\" not found."
|
||||||
|
);
|
||||||
yulAssert(!watcher.ok(), "Expected a reported error.");
|
yulAssert(!watcher.ok(), "Expected a reported error.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -322,7 +338,7 @@ vector<YulString> AsmAnalyzer::operator()(FunctionCall const& _funCall)
|
|||||||
m_errorReporter.typeError(
|
m_errorReporter.typeError(
|
||||||
7000_error,
|
7000_error,
|
||||||
_funCall.functionName.location,
|
_funCall.functionName.location,
|
||||||
"Function expects " +
|
"Function \"" + _funCall.functionName.name.str() + "\" expects " +
|
||||||
to_string(parameterTypes->size()) +
|
to_string(parameterTypes->size()) +
|
||||||
" arguments but got " +
|
" arguments but got " +
|
||||||
to_string(_funCall.arguments.size()) + "."
|
to_string(_funCall.arguments.size()) + "."
|
||||||
@ -421,7 +437,13 @@ void AsmAnalyzer::operator()(Switch const& _switch)
|
|||||||
|
|
||||||
/// Note: the parser ensures there is only one default case
|
/// Note: the parser ensures there is only one default case
|
||||||
if (watcher.ok() && !cases.insert(valueOfLiteral(*_case.value)).second)
|
if (watcher.ok() && !cases.insert(valueOfLiteral(*_case.value)).second)
|
||||||
m_errorReporter.declarationError(6792_error, _case.location, "Duplicate case defined.");
|
m_errorReporter.declarationError(
|
||||||
|
6792_error,
|
||||||
|
_case.location,
|
||||||
|
"Duplicate case \"" +
|
||||||
|
valueOfLiteral(*_case.value).str() +
|
||||||
|
"\" defined."
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
(*this)(_case.body);
|
(*this)(_case.body);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
Warning: Yul is still experimental. Please use the output with care.
|
Warning: Yul is still experimental. Please use the output with care.
|
||||||
Error: Function not found.
|
Error: Function "jump" not found.
|
||||||
--> strict_asm_jump/input.yul:1:3:
|
--> strict_asm_jump/input.yul:1:3:
|
||||||
|
|
|
|
||||||
1 | { jump(1) }
|
1 | { jump(1) }
|
||||||
|
@ -273,8 +273,8 @@ BOOST_AUTO_TEST_CASE(oversize_string_literals)
|
|||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(magic_variables)
|
BOOST_AUTO_TEST_CASE(magic_variables)
|
||||||
{
|
{
|
||||||
CHECK_ASSEMBLE_ERROR("{ pop(this) }", DeclarationError, "Identifier not found");
|
CHECK_ASSEMBLE_ERROR("{ pop(this) }", DeclarationError, "Identifier \"this\" not found");
|
||||||
CHECK_ASSEMBLE_ERROR("{ pop(ecrecover) }", DeclarationError, "Identifier not found");
|
CHECK_ASSEMBLE_ERROR("{ pop(ecrecover) }", DeclarationError, "Identifier \"ecrecover\" not found");
|
||||||
BOOST_CHECK(successAssemble("{ let ecrecover := 1 pop(ecrecover) }"));
|
BOOST_CHECK(successAssemble("{ let ecrecover := 1 pop(ecrecover) }"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,4 +6,4 @@ contract C {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 8198: (72-77): Identifier not found.
|
// DeclarationError 8198: (72-77): Identifier "super" not found.
|
||||||
|
@ -5,4 +5,4 @@ contract C {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 8678: (87-96): Variable count does not match number of values (2 vs. 1)
|
// DeclarationError 8678: (87-96): Variable count for assignment to "x, y" does not match number of values (2 vs. 1)
|
||||||
|
@ -15,7 +15,7 @@ contract C {
|
|||||||
// EVMVersion: =homestead
|
// EVMVersion: =homestead
|
||||||
// ----
|
// ----
|
||||||
// TypeError 4778: (86-100): The "returndatasize" instruction is only available for Byzantium-compatible VMs (you are currently compiling for "homestead").
|
// TypeError 4778: (86-100): The "returndatasize" instruction is only available for Byzantium-compatible VMs (you are currently compiling for "homestead").
|
||||||
// DeclarationError 3812: (77-102): Variable count mismatch: 1 variables and 0 values.
|
// DeclarationError 3812: (77-102): Variable count mismatch for declaration of "s": 1 variables and 0 values.
|
||||||
// TypeError 7756: (115-129): The "returndatacopy" instruction is only available for Byzantium-compatible VMs (you are currently compiling for "homestead").
|
// TypeError 7756: (115-129): The "returndatacopy" instruction is only available for Byzantium-compatible VMs (you are currently compiling for "homestead").
|
||||||
// TypeError 1503: (245-255): The "staticcall" instruction is only available for Byzantium-compatible VMs (you are currently compiling for "homestead").
|
// TypeError 1503: (245-255): The "staticcall" instruction is only available for Byzantium-compatible VMs (you are currently compiling for "homestead").
|
||||||
// DeclarationError 8678: (238-277): Variable count does not match number of values (1 vs. 0)
|
// DeclarationError 8678: (238-277): Variable count for assignment to "ret" does not match number of values (1 vs. 0)
|
||||||
|
@ -21,12 +21,12 @@ contract C {
|
|||||||
// EVMVersion: =byzantium
|
// EVMVersion: =byzantium
|
||||||
// ----
|
// ----
|
||||||
// TypeError 6612: (103-106): The "shl" instruction is only available for Constantinople-compatible VMs (you are currently compiling for "byzantium").
|
// TypeError 6612: (103-106): The "shl" instruction is only available for Constantinople-compatible VMs (you are currently compiling for "byzantium").
|
||||||
// DeclarationError 8678: (96-116): Variable count does not match number of values (1 vs. 0)
|
// DeclarationError 8678: (96-116): Variable count for assignment to "ret" does not match number of values (1 vs. 0)
|
||||||
// TypeError 7458: (136-139): The "shr" instruction is only available for Constantinople-compatible VMs (you are currently compiling for "byzantium").
|
// TypeError 7458: (136-139): The "shr" instruction is only available for Constantinople-compatible VMs (you are currently compiling for "byzantium").
|
||||||
// DeclarationError 8678: (129-147): Variable count does not match number of values (1 vs. 0)
|
// DeclarationError 8678: (129-147): Variable count for assignment to "ret" does not match number of values (1 vs. 0)
|
||||||
// TypeError 2054: (167-170): The "sar" instruction is only available for Constantinople-compatible VMs (you are currently compiling for "byzantium").
|
// TypeError 2054: (167-170): The "sar" instruction is only available for Constantinople-compatible VMs (you are currently compiling for "byzantium").
|
||||||
// DeclarationError 8678: (160-178): Variable count does not match number of values (1 vs. 0)
|
// DeclarationError 8678: (160-178): Variable count for assignment to "ret" does not match number of values (1 vs. 0)
|
||||||
// TypeError 6166: (283-290): The "create2" instruction is only available for Constantinople-compatible VMs (you are currently compiling for "byzantium").
|
// TypeError 6166: (283-290): The "create2" instruction is only available for Constantinople-compatible VMs (you are currently compiling for "byzantium").
|
||||||
// DeclarationError 8678: (276-302): Variable count does not match number of values (1 vs. 0)
|
// DeclarationError 8678: (276-302): Variable count for assignment to "ret" does not match number of values (1 vs. 0)
|
||||||
// TypeError 7110: (412-423): The "extcodehash" instruction is only available for Constantinople-compatible VMs (you are currently compiling for "byzantium").
|
// TypeError 7110: (412-423): The "extcodehash" instruction is only available for Constantinople-compatible VMs (you are currently compiling for "byzantium").
|
||||||
// DeclarationError 8678: (405-434): Variable count does not match number of values (1 vs. 0)
|
// DeclarationError 8678: (405-434): Variable count for assignment to "ret" does not match number of values (1 vs. 0)
|
||||||
|
@ -14,6 +14,6 @@ contract C {
|
|||||||
// EVMVersion: =petersburg
|
// EVMVersion: =petersburg
|
||||||
// ----
|
// ----
|
||||||
// TypeError 1561: (101-108): The "chainid" instruction is only available for Istanbul-compatible VMs (you are currently compiling for "petersburg").
|
// TypeError 1561: (101-108): The "chainid" instruction is only available for Istanbul-compatible VMs (you are currently compiling for "petersburg").
|
||||||
// DeclarationError 8678: (95-110): Variable count does not match number of values (1 vs. 0)
|
// DeclarationError 8678: (95-110): Variable count for assignment to "id" does not match number of values (1 vs. 0)
|
||||||
// TypeError 7721: (215-226): The "selfbalance" instruction is only available for Istanbul-compatible VMs (you are currently compiling for "petersburg").
|
// TypeError 7721: (215-226): The "selfbalance" instruction is only available for Istanbul-compatible VMs (you are currently compiling for "petersburg").
|
||||||
// DeclarationError 8678: (209-228): Variable count does not match number of values (1 vs. 0)
|
// DeclarationError 8678: (209-228): Variable count for assignment to "sb" does not match number of values (1 vs. 0)
|
||||||
|
@ -10,5 +10,5 @@ contract C {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// TypeError 7000: (87-88): Function expects 1 arguments but got 0.
|
// TypeError 7000: (87-88): Function "f" expects 1 arguments but got 0.
|
||||||
// TypeError 7000: (108-109): Function expects 1 arguments but got 2.
|
// TypeError 7000: (108-109): Function "f" expects 1 arguments but got 2.
|
||||||
|
@ -6,4 +6,4 @@ contract C {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 4619: (63-64): Function not found.
|
// DeclarationError 4619: (63-64): Function "k" not found.
|
||||||
|
@ -7,5 +7,5 @@ contract C {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 4619: (63-75): Function not found.
|
// DeclarationError 4619: (63-75): Function "setimmutable" not found.
|
||||||
// DeclarationError 4619: (92-105): Function not found.
|
// DeclarationError 4619: (92-105): Function "loadimmutable" not found.
|
||||||
|
@ -23,21 +23,21 @@ contract C {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 4619: (75-79): Function not found.
|
// DeclarationError 4619: (75-79): Function "dup0" not found.
|
||||||
// DeclarationError 4619: (94-98): Function not found.
|
// DeclarationError 4619: (94-98): Function "dup1" not found.
|
||||||
// DeclarationError 4619: (113-117): Function not found.
|
// DeclarationError 4619: (113-117): Function "dup2" not found.
|
||||||
// DeclarationError 4619: (132-136): Function not found.
|
// DeclarationError 4619: (132-136): Function "dup3" not found.
|
||||||
// DeclarationError 4619: (151-155): Function not found.
|
// DeclarationError 4619: (151-155): Function "dup4" not found.
|
||||||
// DeclarationError 4619: (170-174): Function not found.
|
// DeclarationError 4619: (170-174): Function "dup5" not found.
|
||||||
// DeclarationError 4619: (189-193): Function not found.
|
// DeclarationError 4619: (189-193): Function "dup6" not found.
|
||||||
// DeclarationError 4619: (208-212): Function not found.
|
// DeclarationError 4619: (208-212): Function "dup7" not found.
|
||||||
// DeclarationError 4619: (227-231): Function not found.
|
// DeclarationError 4619: (227-231): Function "dup8" not found.
|
||||||
// DeclarationError 4619: (246-250): Function not found.
|
// DeclarationError 4619: (246-250): Function "dup9" not found.
|
||||||
// DeclarationError 4619: (265-270): Function not found.
|
// DeclarationError 4619: (265-270): Function "dup10" not found.
|
||||||
// DeclarationError 4619: (285-290): Function not found.
|
// DeclarationError 4619: (285-290): Function "dup11" not found.
|
||||||
// DeclarationError 4619: (305-310): Function not found.
|
// DeclarationError 4619: (305-310): Function "dup12" not found.
|
||||||
// DeclarationError 4619: (325-330): Function not found.
|
// DeclarationError 4619: (325-330): Function "dup13" not found.
|
||||||
// DeclarationError 4619: (345-350): Function not found.
|
// DeclarationError 4619: (345-350): Function "dup14" not found.
|
||||||
// DeclarationError 4619: (365-370): Function not found.
|
// DeclarationError 4619: (365-370): Function "dup15" not found.
|
||||||
// DeclarationError 4619: (385-390): Function not found.
|
// DeclarationError 4619: (385-390): Function "dup16" not found.
|
||||||
// DeclarationError 4619: (405-410): Function not found.
|
// DeclarationError 4619: (405-410): Function "dup32" not found.
|
||||||
|
@ -6,4 +6,4 @@ contract C {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 4619: (75-79): Function not found.
|
// DeclarationError 4619: (75-79): Function "jump" not found.
|
||||||
|
@ -6,4 +6,4 @@ contract C {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 4619: (75-83): Function not found.
|
// DeclarationError 4619: (75-83): Function "jumpdest" not found.
|
||||||
|
@ -6,4 +6,4 @@ contract C {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 4619: (75-80): Function not found.
|
// DeclarationError 4619: (75-80): Function "jumpi" not found.
|
||||||
|
@ -38,36 +38,36 @@ contract C {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 4619: (75-80): Function not found.
|
// DeclarationError 4619: (75-80): Function "push0" not found.
|
||||||
// DeclarationError 4619: (95-100): Function not found.
|
// DeclarationError 4619: (95-100): Function "push1" not found.
|
||||||
// DeclarationError 4619: (115-120): Function not found.
|
// DeclarationError 4619: (115-120): Function "push2" not found.
|
||||||
// DeclarationError 4619: (135-140): Function not found.
|
// DeclarationError 4619: (135-140): Function "push3" not found.
|
||||||
// DeclarationError 4619: (155-160): Function not found.
|
// DeclarationError 4619: (155-160): Function "push4" not found.
|
||||||
// DeclarationError 4619: (175-180): Function not found.
|
// DeclarationError 4619: (175-180): Function "push5" not found.
|
||||||
// DeclarationError 4619: (195-200): Function not found.
|
// DeclarationError 4619: (195-200): Function "push6" not found.
|
||||||
// DeclarationError 4619: (215-220): Function not found.
|
// DeclarationError 4619: (215-220): Function "push7" not found.
|
||||||
// DeclarationError 4619: (235-240): Function not found.
|
// DeclarationError 4619: (235-240): Function "push8" not found.
|
||||||
// DeclarationError 4619: (255-260): Function not found.
|
// DeclarationError 4619: (255-260): Function "push9" not found.
|
||||||
// DeclarationError 4619: (275-281): Function not found.
|
// DeclarationError 4619: (275-281): Function "push10" not found.
|
||||||
// DeclarationError 4619: (296-302): Function not found.
|
// DeclarationError 4619: (296-302): Function "push11" not found.
|
||||||
// DeclarationError 4619: (317-323): Function not found.
|
// DeclarationError 4619: (317-323): Function "push12" not found.
|
||||||
// DeclarationError 4619: (338-344): Function not found.
|
// DeclarationError 4619: (338-344): Function "push13" not found.
|
||||||
// DeclarationError 4619: (359-365): Function not found.
|
// DeclarationError 4619: (359-365): Function "push14" not found.
|
||||||
// DeclarationError 4619: (380-386): Function not found.
|
// DeclarationError 4619: (380-386): Function "push15" not found.
|
||||||
// DeclarationError 4619: (401-407): Function not found.
|
// DeclarationError 4619: (401-407): Function "push16" not found.
|
||||||
// DeclarationError 4619: (422-428): Function not found.
|
// DeclarationError 4619: (422-428): Function "push17" not found.
|
||||||
// DeclarationError 4619: (443-449): Function not found.
|
// DeclarationError 4619: (443-449): Function "push18" not found.
|
||||||
// DeclarationError 4619: (464-470): Function not found.
|
// DeclarationError 4619: (464-470): Function "push19" not found.
|
||||||
// DeclarationError 4619: (485-491): Function not found.
|
// DeclarationError 4619: (485-491): Function "push20" not found.
|
||||||
// DeclarationError 4619: (506-512): Function not found.
|
// DeclarationError 4619: (506-512): Function "push21" not found.
|
||||||
// DeclarationError 4619: (527-533): Function not found.
|
// DeclarationError 4619: (527-533): Function "push22" not found.
|
||||||
// DeclarationError 4619: (548-554): Function not found.
|
// DeclarationError 4619: (548-554): Function "push23" not found.
|
||||||
// DeclarationError 4619: (569-575): Function not found.
|
// DeclarationError 4619: (569-575): Function "push24" not found.
|
||||||
// DeclarationError 4619: (590-596): Function not found.
|
// DeclarationError 4619: (590-596): Function "push25" not found.
|
||||||
// DeclarationError 4619: (611-617): Function not found.
|
// DeclarationError 4619: (611-617): Function "push26" not found.
|
||||||
// DeclarationError 4619: (632-638): Function not found.
|
// DeclarationError 4619: (632-638): Function "push27" not found.
|
||||||
// DeclarationError 4619: (653-659): Function not found.
|
// DeclarationError 4619: (653-659): Function "push28" not found.
|
||||||
// DeclarationError 4619: (674-680): Function not found.
|
// DeclarationError 4619: (674-680): Function "push29" not found.
|
||||||
// DeclarationError 4619: (695-701): Function not found.
|
// DeclarationError 4619: (695-701): Function "push30" not found.
|
||||||
// DeclarationError 4619: (716-722): Function not found.
|
// DeclarationError 4619: (716-722): Function "push31" not found.
|
||||||
// DeclarationError 4619: (737-743): Function not found.
|
// DeclarationError 4619: (737-743): Function "push32" not found.
|
||||||
|
@ -23,21 +23,21 @@ contract C {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 4619: (75-80): Function not found.
|
// DeclarationError 4619: (75-80): Function "swap0" not found.
|
||||||
// DeclarationError 4619: (95-100): Function not found.
|
// DeclarationError 4619: (95-100): Function "swap1" not found.
|
||||||
// DeclarationError 4619: (115-120): Function not found.
|
// DeclarationError 4619: (115-120): Function "swap2" not found.
|
||||||
// DeclarationError 4619: (135-140): Function not found.
|
// DeclarationError 4619: (135-140): Function "swap3" not found.
|
||||||
// DeclarationError 4619: (155-160): Function not found.
|
// DeclarationError 4619: (155-160): Function "swap4" not found.
|
||||||
// DeclarationError 4619: (175-180): Function not found.
|
// DeclarationError 4619: (175-180): Function "swap5" not found.
|
||||||
// DeclarationError 4619: (195-200): Function not found.
|
// DeclarationError 4619: (195-200): Function "swap6" not found.
|
||||||
// DeclarationError 4619: (215-220): Function not found.
|
// DeclarationError 4619: (215-220): Function "swap7" not found.
|
||||||
// DeclarationError 4619: (235-240): Function not found.
|
// DeclarationError 4619: (235-240): Function "swap8" not found.
|
||||||
// DeclarationError 4619: (255-260): Function not found.
|
// DeclarationError 4619: (255-260): Function "swap9" not found.
|
||||||
// DeclarationError 4619: (275-281): Function not found.
|
// DeclarationError 4619: (275-281): Function "swap10" not found.
|
||||||
// DeclarationError 4619: (296-302): Function not found.
|
// DeclarationError 4619: (296-302): Function "swap11" not found.
|
||||||
// DeclarationError 4619: (317-323): Function not found.
|
// DeclarationError 4619: (317-323): Function "swap12" not found.
|
||||||
// DeclarationError 4619: (338-344): Function not found.
|
// DeclarationError 4619: (338-344): Function "swap13" not found.
|
||||||
// DeclarationError 4619: (359-365): Function not found.
|
// DeclarationError 4619: (359-365): Function "swap14" not found.
|
||||||
// DeclarationError 4619: (380-386): Function not found.
|
// DeclarationError 4619: (380-386): Function "swap15" not found.
|
||||||
// DeclarationError 4619: (401-407): Function not found.
|
// DeclarationError 4619: (401-407): Function "swap16" not found.
|
||||||
// DeclarationError 4619: (422-428): Function not found.
|
// DeclarationError 4619: (422-428): Function "swap32" not found.
|
||||||
|
@ -6,5 +6,5 @@ contract C {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 4619: (67-79): Function not found.
|
// DeclarationError 4619: (67-79): Function "linkersymbol" not found.
|
||||||
// TypeError 3950: (67-105): Expected expression to evaluate to one value, but got 0 values instead.
|
// TypeError 3950: (67-105): Expected expression to evaluate to one value, but got 0 values instead.
|
||||||
|
@ -140,8 +140,8 @@ BOOST_AUTO_TEST_CASE(builtins_analysis)
|
|||||||
|
|
||||||
SimpleDialect dialect;
|
SimpleDialect dialect;
|
||||||
BOOST_CHECK(successParse("{ let a, b, c := builtin(1, 2) }", dialect));
|
BOOST_CHECK(successParse("{ let a, b, c := builtin(1, 2) }", dialect));
|
||||||
CHECK_ERROR_DIALECT("{ let a, b, c := builtin(1) }", TypeError, "Function expects 2 arguments but got 1", dialect);
|
CHECK_ERROR_DIALECT("{ let a, b, c := builtin(1) }", TypeError, "Function \"builtin\" expects 2 arguments but got 1", dialect);
|
||||||
CHECK_ERROR_DIALECT("{ let a, b := builtin(1, 2) }", DeclarationError, "Variable count mismatch: 2 variables and 3 values.", dialect);
|
CHECK_ERROR_DIALECT("{ let a, b := builtin(1, 2) }", DeclarationError, "Variable count mismatch for declaration of \"a, b\": 2 variables and 3 values.", dialect);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(default_types_set)
|
BOOST_AUTO_TEST_CASE(default_types_set)
|
||||||
|
@ -2,6 +2,6 @@
|
|||||||
datasize(x,1)
|
datasize(x,1)
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// TypeError 7000: (4-12): Function expects 1 arguments but got 2.
|
// TypeError 7000: (4-12): Function "datasize" expects 1 arguments but got 2.
|
||||||
// TypeError 9114: (4-12): Function expects direct literals as arguments.
|
// TypeError 9114: (4-12): Function expects direct literals as arguments.
|
||||||
// DeclarationError 8198: (13-14): Identifier not found.
|
// DeclarationError 8198: (13-14): Identifier "x" not found.
|
||||||
|
@ -4,4 +4,4 @@
|
|||||||
// ====
|
// ====
|
||||||
// dialect: evm
|
// dialect: evm
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 8198: (10-11): Identifier not found.
|
// DeclarationError 8198: (10-11): Identifier "i" not found.
|
||||||
|
@ -4,4 +4,4 @@
|
|||||||
// ====
|
// ====
|
||||||
// dialect: evm
|
// dialect: evm
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 8198: (33-34): Identifier not found.
|
// DeclarationError 8198: (33-34): Identifier "i" not found.
|
||||||
|
@ -4,4 +4,4 @@
|
|||||||
// ====
|
// ====
|
||||||
// dialect: evm
|
// dialect: evm
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 8198: (18-19): Identifier not found.
|
// DeclarationError 8198: (18-19): Identifier "i" not found.
|
||||||
|
@ -4,4 +4,4 @@
|
|||||||
// ====
|
// ====
|
||||||
// dialect: evm
|
// dialect: evm
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 8198: (13-14): Identifier not found.
|
// DeclarationError 8198: (13-14): Identifier "i" not found.
|
||||||
|
@ -4,4 +4,4 @@
|
|||||||
// ====
|
// ====
|
||||||
// dialect: evm
|
// dialect: evm
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 8198: (13-14): Identifier not found.
|
// DeclarationError 8198: (13-14): Identifier "i" not found.
|
||||||
|
@ -4,4 +4,4 @@
|
|||||||
// ====
|
// ====
|
||||||
// dialect: evm
|
// dialect: evm
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 8198: (10-11): Identifier not found.
|
// DeclarationError 8198: (10-11): Identifier "i" not found.
|
||||||
|
@ -4,4 +4,4 @@
|
|||||||
// ====
|
// ====
|
||||||
// dialect: evm
|
// dialect: evm
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 8198: (18-19): Identifier not found.
|
// DeclarationError 8198: (18-19): Identifier "i" not found.
|
||||||
|
@ -3,4 +3,4 @@
|
|||||||
f(x,1)
|
f(x,1)
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 8198: (27-28): Identifier not found.
|
// DeclarationError 8198: (27-28): Identifier "x" not found.
|
||||||
|
@ -2,4 +2,4 @@
|
|||||||
pop(mul())
|
pop(mul())
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// TypeError 7000: (7-10): Function expects 2 arguments but got 0.
|
// TypeError 7000: (7-10): Function "mul" expects 2 arguments but got 0.
|
||||||
|
@ -2,4 +2,4 @@
|
|||||||
pop(mul(1))
|
pop(mul(1))
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// TypeError 7000: (7-10): Function expects 2 arguments but got 1.
|
// TypeError 7000: (7-10): Function "mul" expects 2 arguments but got 1.
|
||||||
|
@ -2,4 +2,4 @@
|
|||||||
pop(mul(1, 2, 3))
|
pop(mul(1, 2, 3))
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// TypeError 7000: (7-10): Function expects 2 arguments but got 3.
|
// TypeError 7000: (7-10): Function "mul" expects 2 arguments but got 3.
|
||||||
|
@ -19,21 +19,21 @@
|
|||||||
dup32()
|
dup32()
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 4619: (6-10): Function not found.
|
// DeclarationError 4619: (6-10): Function "dup0" not found.
|
||||||
// DeclarationError 4619: (17-21): Function not found.
|
// DeclarationError 4619: (17-21): Function "dup1" not found.
|
||||||
// DeclarationError 4619: (28-32): Function not found.
|
// DeclarationError 4619: (28-32): Function "dup2" not found.
|
||||||
// DeclarationError 4619: (39-43): Function not found.
|
// DeclarationError 4619: (39-43): Function "dup3" not found.
|
||||||
// DeclarationError 4619: (50-54): Function not found.
|
// DeclarationError 4619: (50-54): Function "dup4" not found.
|
||||||
// DeclarationError 4619: (61-65): Function not found.
|
// DeclarationError 4619: (61-65): Function "dup5" not found.
|
||||||
// DeclarationError 4619: (72-76): Function not found.
|
// DeclarationError 4619: (72-76): Function "dup6" not found.
|
||||||
// DeclarationError 4619: (83-87): Function not found.
|
// DeclarationError 4619: (83-87): Function "dup7" not found.
|
||||||
// DeclarationError 4619: (94-98): Function not found.
|
// DeclarationError 4619: (94-98): Function "dup8" not found.
|
||||||
// DeclarationError 4619: (105-109): Function not found.
|
// DeclarationError 4619: (105-109): Function "dup9" not found.
|
||||||
// DeclarationError 4619: (116-121): Function not found.
|
// DeclarationError 4619: (116-121): Function "dup10" not found.
|
||||||
// DeclarationError 4619: (128-133): Function not found.
|
// DeclarationError 4619: (128-133): Function "dup11" not found.
|
||||||
// DeclarationError 4619: (140-145): Function not found.
|
// DeclarationError 4619: (140-145): Function "dup12" not found.
|
||||||
// DeclarationError 4619: (152-157): Function not found.
|
// DeclarationError 4619: (152-157): Function "dup13" not found.
|
||||||
// DeclarationError 4619: (164-169): Function not found.
|
// DeclarationError 4619: (164-169): Function "dup14" not found.
|
||||||
// DeclarationError 4619: (176-181): Function not found.
|
// DeclarationError 4619: (176-181): Function "dup15" not found.
|
||||||
// DeclarationError 4619: (188-193): Function not found.
|
// DeclarationError 4619: (188-193): Function "dup16" not found.
|
||||||
// DeclarationError 4619: (200-205): Function not found.
|
// DeclarationError 4619: (200-205): Function "dup32" not found.
|
||||||
|
@ -2,4 +2,4 @@
|
|||||||
jump(2)
|
jump(2)
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 4619: (6-10): Function not found.
|
// DeclarationError 4619: (6-10): Function "jump" not found.
|
||||||
|
@ -2,4 +2,4 @@
|
|||||||
jumpdest()
|
jumpdest()
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 4619: (6-14): Function not found.
|
// DeclarationError 4619: (6-14): Function "jumpdest" not found.
|
||||||
|
@ -2,4 +2,4 @@
|
|||||||
jumpi(2, 1)
|
jumpi(2, 1)
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 4619: (6-11): Function not found.
|
// DeclarationError 4619: (6-11): Function "jumpi" not found.
|
||||||
|
@ -34,36 +34,36 @@
|
|||||||
push32()
|
push32()
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 4619: (6-11): Function not found.
|
// DeclarationError 4619: (6-11): Function "push0" not found.
|
||||||
// DeclarationError 4619: (18-23): Function not found.
|
// DeclarationError 4619: (18-23): Function "push1" not found.
|
||||||
// DeclarationError 4619: (30-35): Function not found.
|
// DeclarationError 4619: (30-35): Function "push2" not found.
|
||||||
// DeclarationError 4619: (42-47): Function not found.
|
// DeclarationError 4619: (42-47): Function "push3" not found.
|
||||||
// DeclarationError 4619: (54-59): Function not found.
|
// DeclarationError 4619: (54-59): Function "push4" not found.
|
||||||
// DeclarationError 4619: (66-71): Function not found.
|
// DeclarationError 4619: (66-71): Function "push5" not found.
|
||||||
// DeclarationError 4619: (78-83): Function not found.
|
// DeclarationError 4619: (78-83): Function "push6" not found.
|
||||||
// DeclarationError 4619: (90-95): Function not found.
|
// DeclarationError 4619: (90-95): Function "push7" not found.
|
||||||
// DeclarationError 4619: (102-107): Function not found.
|
// DeclarationError 4619: (102-107): Function "push8" not found.
|
||||||
// DeclarationError 4619: (114-119): Function not found.
|
// DeclarationError 4619: (114-119): Function "push9" not found.
|
||||||
// DeclarationError 4619: (126-132): Function not found.
|
// DeclarationError 4619: (126-132): Function "push10" not found.
|
||||||
// DeclarationError 4619: (139-145): Function not found.
|
// DeclarationError 4619: (139-145): Function "push11" not found.
|
||||||
// DeclarationError 4619: (152-158): Function not found.
|
// DeclarationError 4619: (152-158): Function "push12" not found.
|
||||||
// DeclarationError 4619: (165-171): Function not found.
|
// DeclarationError 4619: (165-171): Function "push13" not found.
|
||||||
// DeclarationError 4619: (178-184): Function not found.
|
// DeclarationError 4619: (178-184): Function "push14" not found.
|
||||||
// DeclarationError 4619: (191-197): Function not found.
|
// DeclarationError 4619: (191-197): Function "push15" not found.
|
||||||
// DeclarationError 4619: (204-210): Function not found.
|
// DeclarationError 4619: (204-210): Function "push16" not found.
|
||||||
// DeclarationError 4619: (217-223): Function not found.
|
// DeclarationError 4619: (217-223): Function "push17" not found.
|
||||||
// DeclarationError 4619: (230-236): Function not found.
|
// DeclarationError 4619: (230-236): Function "push18" not found.
|
||||||
// DeclarationError 4619: (243-249): Function not found.
|
// DeclarationError 4619: (243-249): Function "push19" not found.
|
||||||
// DeclarationError 4619: (256-262): Function not found.
|
// DeclarationError 4619: (256-262): Function "push20" not found.
|
||||||
// DeclarationError 4619: (269-275): Function not found.
|
// DeclarationError 4619: (269-275): Function "push21" not found.
|
||||||
// DeclarationError 4619: (282-288): Function not found.
|
// DeclarationError 4619: (282-288): Function "push22" not found.
|
||||||
// DeclarationError 4619: (295-301): Function not found.
|
// DeclarationError 4619: (295-301): Function "push23" not found.
|
||||||
// DeclarationError 4619: (308-314): Function not found.
|
// DeclarationError 4619: (308-314): Function "push24" not found.
|
||||||
// DeclarationError 4619: (321-327): Function not found.
|
// DeclarationError 4619: (321-327): Function "push25" not found.
|
||||||
// DeclarationError 4619: (334-340): Function not found.
|
// DeclarationError 4619: (334-340): Function "push26" not found.
|
||||||
// DeclarationError 4619: (347-353): Function not found.
|
// DeclarationError 4619: (347-353): Function "push27" not found.
|
||||||
// DeclarationError 4619: (360-366): Function not found.
|
// DeclarationError 4619: (360-366): Function "push28" not found.
|
||||||
// DeclarationError 4619: (373-379): Function not found.
|
// DeclarationError 4619: (373-379): Function "push29" not found.
|
||||||
// DeclarationError 4619: (386-392): Function not found.
|
// DeclarationError 4619: (386-392): Function "push30" not found.
|
||||||
// DeclarationError 4619: (399-405): Function not found.
|
// DeclarationError 4619: (399-405): Function "push31" not found.
|
||||||
// DeclarationError 4619: (412-418): Function not found.
|
// DeclarationError 4619: (412-418): Function "push32" not found.
|
||||||
|
@ -19,21 +19,21 @@
|
|||||||
swap32()
|
swap32()
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 4619: (6-11): Function not found.
|
// DeclarationError 4619: (6-11): Function "swap0" not found.
|
||||||
// DeclarationError 4619: (18-23): Function not found.
|
// DeclarationError 4619: (18-23): Function "swap1" not found.
|
||||||
// DeclarationError 4619: (30-35): Function not found.
|
// DeclarationError 4619: (30-35): Function "swap2" not found.
|
||||||
// DeclarationError 4619: (42-47): Function not found.
|
// DeclarationError 4619: (42-47): Function "swap3" not found.
|
||||||
// DeclarationError 4619: (54-59): Function not found.
|
// DeclarationError 4619: (54-59): Function "swap4" not found.
|
||||||
// DeclarationError 4619: (66-71): Function not found.
|
// DeclarationError 4619: (66-71): Function "swap5" not found.
|
||||||
// DeclarationError 4619: (78-83): Function not found.
|
// DeclarationError 4619: (78-83): Function "swap6" not found.
|
||||||
// DeclarationError 4619: (90-95): Function not found.
|
// DeclarationError 4619: (90-95): Function "swap7" not found.
|
||||||
// DeclarationError 4619: (102-107): Function not found.
|
// DeclarationError 4619: (102-107): Function "swap8" not found.
|
||||||
// DeclarationError 4619: (114-119): Function not found.
|
// DeclarationError 4619: (114-119): Function "swap9" not found.
|
||||||
// DeclarationError 4619: (126-132): Function not found.
|
// DeclarationError 4619: (126-132): Function "swap10" not found.
|
||||||
// DeclarationError 4619: (139-145): Function not found.
|
// DeclarationError 4619: (139-145): Function "swap11" not found.
|
||||||
// DeclarationError 4619: (152-158): Function not found.
|
// DeclarationError 4619: (152-158): Function "swap12" not found.
|
||||||
// DeclarationError 4619: (165-171): Function not found.
|
// DeclarationError 4619: (165-171): Function "swap13" not found.
|
||||||
// DeclarationError 4619: (178-184): Function not found.
|
// DeclarationError 4619: (178-184): Function "swap14" not found.
|
||||||
// DeclarationError 4619: (191-197): Function not found.
|
// DeclarationError 4619: (191-197): Function "swap15" not found.
|
||||||
// DeclarationError 4619: (204-210): Function not found.
|
// DeclarationError 4619: (204-210): Function "swap16" not found.
|
||||||
// DeclarationError 4619: (217-223): Function not found.
|
// DeclarationError 4619: (217-223): Function "swap32" not found.
|
||||||
|
@ -2,4 +2,4 @@
|
|||||||
let x, y := 1
|
let x, y := 1
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 3812: (3-16): Variable count mismatch: 2 variables and 1 values.
|
// DeclarationError 3812: (3-16): Variable count mismatch for declaration of "x, y": 2 variables and 1 values.
|
||||||
|
@ -4,4 +4,4 @@
|
|||||||
// ====
|
// ====
|
||||||
// dialect: ewasm
|
// dialect: ewasm
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 4619: (6-18): Function not found.
|
// DeclarationError 4619: (6-18): Function "linkersymbol" not found.
|
||||||
|
@ -6,4 +6,4 @@
|
|||||||
// ====
|
// ====
|
||||||
// dialect: evmTyped
|
// dialect: evmTyped
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 6792: (34-50): Duplicate case defined.
|
// DeclarationError 6792: (34-50): Duplicate case "0" defined.
|
||||||
|
@ -6,4 +6,4 @@
|
|||||||
// ====
|
// ====
|
||||||
// dialect: evmTyped
|
// dialect: evmTyped
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 6792: (34-49): Duplicate case defined.
|
// DeclarationError 6792: (34-49): Duplicate case "0" defined.
|
||||||
|
@ -7,4 +7,4 @@
|
|||||||
// ====
|
// ====
|
||||||
// dialect: evm
|
// dialect: evm
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 6792: (25-34): Duplicate case defined.
|
// DeclarationError 6792: (25-34): Duplicate case "1" defined.
|
||||||
|
@ -5,4 +5,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ----
|
// ----
|
||||||
// DeclarationError 8198: (36-37): Identifier not found.
|
// DeclarationError 8198: (36-37): Identifier "x" not found.
|
||||||
|
Loading…
Reference in New Issue
Block a user