diff --git a/libyul/AsmAnalysis.cpp b/libyul/AsmAnalysis.cpp index 039036f90..7e8f7ea57 100644 --- a/libyul/AsmAnalysis.cpp +++ b/libyul/AsmAnalysis.cpp @@ -31,6 +31,9 @@ #include +#include +#include + #include #include @@ -154,7 +157,12 @@ vector AsmAnalyzer::operator()(Identifier const& _identifier) ); if (!found && watcher.ok()) // 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}; @@ -199,7 +207,9 @@ void AsmAnalyzer::operator()(Assignment const& _assignment) m_errorReporter.declarationError( 8678_error, _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) + " vs. " + to_string(types.size()) + @@ -235,7 +245,9 @@ void AsmAnalyzer::operator()(VariableDeclaration const& _varDecl) m_errorReporter.declarationError( 3812_error, _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) + " variables and " + to_string(types.size()) + @@ -314,7 +326,11 @@ vector AsmAnalyzer::operator()(FunctionCall const& _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."); } @@ -322,7 +338,7 @@ vector AsmAnalyzer::operator()(FunctionCall const& _funCall) m_errorReporter.typeError( 7000_error, _funCall.functionName.location, - "Function expects " + + "Function \"" + _funCall.functionName.name.str() + "\" expects " + to_string(parameterTypes->size()) + " arguments but got " + 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 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); diff --git a/test/cmdlineTests/strict_asm_jump/err b/test/cmdlineTests/strict_asm_jump/err index 48d061fee..866361af4 100644 --- a/test/cmdlineTests/strict_asm_jump/err +++ b/test/cmdlineTests/strict_asm_jump/err @@ -1,5 +1,5 @@ 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: | 1 | { jump(1) } diff --git a/test/libsolidity/InlineAssembly.cpp b/test/libsolidity/InlineAssembly.cpp index af7bbd831..aabc17c43 100644 --- a/test/libsolidity/InlineAssembly.cpp +++ b/test/libsolidity/InlineAssembly.cpp @@ -273,8 +273,8 @@ BOOST_AUTO_TEST_CASE(oversize_string_literals) BOOST_AUTO_TEST_CASE(magic_variables) { - CHECK_ASSEMBLE_ERROR("{ pop(this) }", DeclarationError, "Identifier not found"); - CHECK_ASSEMBLE_ERROR("{ pop(ecrecover) }", DeclarationError, "Identifier not found"); + CHECK_ASSEMBLE_ERROR("{ pop(this) }", DeclarationError, "Identifier \"this\" not found"); + CHECK_ASSEMBLE_ERROR("{ pop(ecrecover) }", DeclarationError, "Identifier \"ecrecover\" not found"); BOOST_CHECK(successAssemble("{ let ecrecover := 1 pop(ecrecover) }")); } diff --git a/test/libsolidity/syntaxTests/inlineAssembly/assignment_from_super.sol b/test/libsolidity/syntaxTests/inlineAssembly/assignment_from_super.sol index f6a151ebf..c5a5750b5 100644 --- a/test/libsolidity/syntaxTests/inlineAssembly/assignment_from_super.sol +++ b/test/libsolidity/syntaxTests/inlineAssembly/assignment_from_super.sol @@ -6,4 +6,4 @@ contract C { } } // ---- -// DeclarationError 8198: (72-77): Identifier not found. +// DeclarationError 8198: (72-77): Identifier "super" not found. diff --git a/test/libsolidity/syntaxTests/inlineAssembly/assignment_location.sol b/test/libsolidity/syntaxTests/inlineAssembly/assignment_location.sol index d9408585f..46e56ffcb 100644 --- a/test/libsolidity/syntaxTests/inlineAssembly/assignment_location.sol +++ b/test/libsolidity/syntaxTests/inlineAssembly/assignment_location.sol @@ -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) diff --git a/test/libsolidity/syntaxTests/inlineAssembly/evm_byzantium_on_homestead.sol b/test/libsolidity/syntaxTests/inlineAssembly/evm_byzantium_on_homestead.sol index 4c6525116..74316c526 100644 --- a/test/libsolidity/syntaxTests/inlineAssembly/evm_byzantium_on_homestead.sol +++ b/test/libsolidity/syntaxTests/inlineAssembly/evm_byzantium_on_homestead.sol @@ -15,7 +15,7 @@ contract C { // EVMVersion: =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 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) diff --git a/test/libsolidity/syntaxTests/inlineAssembly/evm_constantinople_on_byzantium.sol b/test/libsolidity/syntaxTests/inlineAssembly/evm_constantinople_on_byzantium.sol index 781cdc3f7..80b14d4d0 100644 --- a/test/libsolidity/syntaxTests/inlineAssembly/evm_constantinople_on_byzantium.sol +++ b/test/libsolidity/syntaxTests/inlineAssembly/evm_constantinople_on_byzantium.sol @@ -21,12 +21,12 @@ contract C { // EVMVersion: =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"). -// 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"). -// 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"). -// 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"). -// 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) diff --git a/test/libsolidity/syntaxTests/inlineAssembly/evm_istanbul_on_petersburg.sol b/test/libsolidity/syntaxTests/inlineAssembly/evm_istanbul_on_petersburg.sol index 9937fc465..95af42317 100644 --- a/test/libsolidity/syntaxTests/inlineAssembly/evm_istanbul_on_petersburg.sol +++ b/test/libsolidity/syntaxTests/inlineAssembly/evm_istanbul_on_petersburg.sol @@ -14,6 +14,6 @@ contract C { // EVMVersion: =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"). -// 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) diff --git a/test/libsolidity/syntaxTests/inlineAssembly/function_call_invalid_argument_count.sol b/test/libsolidity/syntaxTests/inlineAssembly/function_call_invalid_argument_count.sol index 3c2fd7c03..f3b35f8a3 100644 --- a/test/libsolidity/syntaxTests/inlineAssembly/function_call_invalid_argument_count.sol +++ b/test/libsolidity/syntaxTests/inlineAssembly/function_call_invalid_argument_count.sol @@ -10,5 +10,5 @@ contract C { } } // ---- -// TypeError 7000: (87-88): Function expects 1 arguments but got 0. -// TypeError 7000: (108-109): Function expects 1 arguments but got 2. +// TypeError 7000: (87-88): Function "f" expects 1 arguments but got 0. +// TypeError 7000: (108-109): Function "f" expects 1 arguments but got 2. diff --git a/test/libsolidity/syntaxTests/inlineAssembly/function_call_not_found.sol b/test/libsolidity/syntaxTests/inlineAssembly/function_call_not_found.sol index e890c67b7..cc74edfce 100644 --- a/test/libsolidity/syntaxTests/inlineAssembly/function_call_not_found.sol +++ b/test/libsolidity/syntaxTests/inlineAssembly/function_call_not_found.sol @@ -6,4 +6,4 @@ contract C { } } // ---- -// DeclarationError 4619: (63-64): Function not found. +// DeclarationError 4619: (63-64): Function "k" not found. diff --git a/test/libsolidity/syntaxTests/inlineAssembly/immutables.sol b/test/libsolidity/syntaxTests/inlineAssembly/immutables.sol index 6d0135cf0..f4e20f8b9 100644 --- a/test/libsolidity/syntaxTests/inlineAssembly/immutables.sol +++ b/test/libsolidity/syntaxTests/inlineAssembly/immutables.sol @@ -7,5 +7,5 @@ contract C { } } // ---- -// DeclarationError 4619: (63-75): Function not found. -// DeclarationError 4619: (92-105): Function not found. +// DeclarationError 4619: (63-75): Function "setimmutable" not found. +// DeclarationError 4619: (92-105): Function "loadimmutable" not found. diff --git a/test/libsolidity/syntaxTests/inlineAssembly/invalid/dup_disallowed.sol b/test/libsolidity/syntaxTests/inlineAssembly/invalid/dup_disallowed.sol index 9d9b35e28..63e89a242 100644 --- a/test/libsolidity/syntaxTests/inlineAssembly/invalid/dup_disallowed.sol +++ b/test/libsolidity/syntaxTests/inlineAssembly/invalid/dup_disallowed.sol @@ -23,21 +23,21 @@ contract C { } } // ---- -// DeclarationError 4619: (75-79): Function not found. -// DeclarationError 4619: (94-98): Function not found. -// DeclarationError 4619: (113-117): Function not found. -// DeclarationError 4619: (132-136): Function not found. -// DeclarationError 4619: (151-155): Function not found. -// DeclarationError 4619: (170-174): Function not found. -// DeclarationError 4619: (189-193): Function not found. -// DeclarationError 4619: (208-212): Function not found. -// DeclarationError 4619: (227-231): Function not found. -// DeclarationError 4619: (246-250): Function not found. -// DeclarationError 4619: (265-270): Function not found. -// DeclarationError 4619: (285-290): Function not found. -// DeclarationError 4619: (305-310): Function not found. -// DeclarationError 4619: (325-330): Function not found. -// DeclarationError 4619: (345-350): Function not found. -// DeclarationError 4619: (365-370): Function not found. -// DeclarationError 4619: (385-390): Function not found. -// DeclarationError 4619: (405-410): Function not found. +// DeclarationError 4619: (75-79): Function "dup0" not found. +// DeclarationError 4619: (94-98): Function "dup1" not found. +// DeclarationError 4619: (113-117): Function "dup2" not found. +// DeclarationError 4619: (132-136): Function "dup3" not found. +// DeclarationError 4619: (151-155): Function "dup4" not found. +// DeclarationError 4619: (170-174): Function "dup5" not found. +// DeclarationError 4619: (189-193): Function "dup6" not found. +// DeclarationError 4619: (208-212): Function "dup7" not found. +// DeclarationError 4619: (227-231): Function "dup8" not found. +// DeclarationError 4619: (246-250): Function "dup9" not found. +// DeclarationError 4619: (265-270): Function "dup10" not found. +// DeclarationError 4619: (285-290): Function "dup11" not found. +// DeclarationError 4619: (305-310): Function "dup12" not found. +// DeclarationError 4619: (325-330): Function "dup13" not found. +// DeclarationError 4619: (345-350): Function "dup14" not found. +// DeclarationError 4619: (365-370): Function "dup15" not found. +// DeclarationError 4619: (385-390): Function "dup16" not found. +// DeclarationError 4619: (405-410): Function "dup32" not found. diff --git a/test/libsolidity/syntaxTests/inlineAssembly/invalid/jump_disallowed.sol b/test/libsolidity/syntaxTests/inlineAssembly/invalid/jump_disallowed.sol index 748e4d172..9d79776d8 100644 --- a/test/libsolidity/syntaxTests/inlineAssembly/invalid/jump_disallowed.sol +++ b/test/libsolidity/syntaxTests/inlineAssembly/invalid/jump_disallowed.sol @@ -6,4 +6,4 @@ contract C { } } // ---- -// DeclarationError 4619: (75-79): Function not found. +// DeclarationError 4619: (75-79): Function "jump" not found. diff --git a/test/libsolidity/syntaxTests/inlineAssembly/invalid/jumpdest_disallowed.sol b/test/libsolidity/syntaxTests/inlineAssembly/invalid/jumpdest_disallowed.sol index 7da213776..364d981bd 100644 --- a/test/libsolidity/syntaxTests/inlineAssembly/invalid/jumpdest_disallowed.sol +++ b/test/libsolidity/syntaxTests/inlineAssembly/invalid/jumpdest_disallowed.sol @@ -6,4 +6,4 @@ contract C { } } // ---- -// DeclarationError 4619: (75-83): Function not found. +// DeclarationError 4619: (75-83): Function "jumpdest" not found. diff --git a/test/libsolidity/syntaxTests/inlineAssembly/invalid/jumpi_disallowed.sol b/test/libsolidity/syntaxTests/inlineAssembly/invalid/jumpi_disallowed.sol index 1b4fc4a65..4271842e0 100644 --- a/test/libsolidity/syntaxTests/inlineAssembly/invalid/jumpi_disallowed.sol +++ b/test/libsolidity/syntaxTests/inlineAssembly/invalid/jumpi_disallowed.sol @@ -6,4 +6,4 @@ contract C { } } // ---- -// DeclarationError 4619: (75-80): Function not found. +// DeclarationError 4619: (75-80): Function "jumpi" not found. diff --git a/test/libsolidity/syntaxTests/inlineAssembly/invalid/push_disallowed.sol b/test/libsolidity/syntaxTests/inlineAssembly/invalid/push_disallowed.sol index 72e3fcd98..0e73c1184 100644 --- a/test/libsolidity/syntaxTests/inlineAssembly/invalid/push_disallowed.sol +++ b/test/libsolidity/syntaxTests/inlineAssembly/invalid/push_disallowed.sol @@ -38,36 +38,36 @@ contract C { } } // ---- -// DeclarationError 4619: (75-80): Function not found. -// DeclarationError 4619: (95-100): Function not found. -// DeclarationError 4619: (115-120): Function not found. -// DeclarationError 4619: (135-140): Function not found. -// DeclarationError 4619: (155-160): Function not found. -// DeclarationError 4619: (175-180): Function not found. -// DeclarationError 4619: (195-200): Function not found. -// DeclarationError 4619: (215-220): Function not found. -// DeclarationError 4619: (235-240): Function not found. -// DeclarationError 4619: (255-260): Function not found. -// DeclarationError 4619: (275-281): Function not found. -// DeclarationError 4619: (296-302): Function not found. -// DeclarationError 4619: (317-323): Function not found. -// DeclarationError 4619: (338-344): Function not found. -// DeclarationError 4619: (359-365): Function not found. -// DeclarationError 4619: (380-386): Function not found. -// DeclarationError 4619: (401-407): Function not found. -// DeclarationError 4619: (422-428): Function not found. -// DeclarationError 4619: (443-449): Function not found. -// DeclarationError 4619: (464-470): Function not found. -// DeclarationError 4619: (485-491): Function not found. -// DeclarationError 4619: (506-512): Function not found. -// DeclarationError 4619: (527-533): Function not found. -// DeclarationError 4619: (548-554): Function not found. -// DeclarationError 4619: (569-575): Function not found. -// DeclarationError 4619: (590-596): Function not found. -// DeclarationError 4619: (611-617): Function not found. -// DeclarationError 4619: (632-638): Function not found. -// DeclarationError 4619: (653-659): Function not found. -// DeclarationError 4619: (674-680): Function not found. -// DeclarationError 4619: (695-701): Function not found. -// DeclarationError 4619: (716-722): Function not found. -// DeclarationError 4619: (737-743): Function not found. +// DeclarationError 4619: (75-80): Function "push0" not found. +// DeclarationError 4619: (95-100): Function "push1" not found. +// DeclarationError 4619: (115-120): Function "push2" not found. +// DeclarationError 4619: (135-140): Function "push3" not found. +// DeclarationError 4619: (155-160): Function "push4" not found. +// DeclarationError 4619: (175-180): Function "push5" not found. +// DeclarationError 4619: (195-200): Function "push6" not found. +// DeclarationError 4619: (215-220): Function "push7" not found. +// DeclarationError 4619: (235-240): Function "push8" not found. +// DeclarationError 4619: (255-260): Function "push9" not found. +// DeclarationError 4619: (275-281): Function "push10" not found. +// DeclarationError 4619: (296-302): Function "push11" not found. +// DeclarationError 4619: (317-323): Function "push12" not found. +// DeclarationError 4619: (338-344): Function "push13" not found. +// DeclarationError 4619: (359-365): Function "push14" not found. +// DeclarationError 4619: (380-386): Function "push15" not found. +// DeclarationError 4619: (401-407): Function "push16" not found. +// DeclarationError 4619: (422-428): Function "push17" not found. +// DeclarationError 4619: (443-449): Function "push18" not found. +// DeclarationError 4619: (464-470): Function "push19" not found. +// DeclarationError 4619: (485-491): Function "push20" not found. +// DeclarationError 4619: (506-512): Function "push21" not found. +// DeclarationError 4619: (527-533): Function "push22" not found. +// DeclarationError 4619: (548-554): Function "push23" not found. +// DeclarationError 4619: (569-575): Function "push24" not found. +// DeclarationError 4619: (590-596): Function "push25" not found. +// DeclarationError 4619: (611-617): Function "push26" not found. +// DeclarationError 4619: (632-638): Function "push27" not found. +// DeclarationError 4619: (653-659): Function "push28" not found. +// DeclarationError 4619: (674-680): Function "push29" not found. +// DeclarationError 4619: (695-701): Function "push30" not found. +// DeclarationError 4619: (716-722): Function "push31" not found. +// DeclarationError 4619: (737-743): Function "push32" not found. diff --git a/test/libsolidity/syntaxTests/inlineAssembly/invalid/swap_disallowed.sol b/test/libsolidity/syntaxTests/inlineAssembly/invalid/swap_disallowed.sol index 278398218..de37f4120 100644 --- a/test/libsolidity/syntaxTests/inlineAssembly/invalid/swap_disallowed.sol +++ b/test/libsolidity/syntaxTests/inlineAssembly/invalid/swap_disallowed.sol @@ -23,21 +23,21 @@ contract C { } } // ---- -// DeclarationError 4619: (75-80): Function not found. -// DeclarationError 4619: (95-100): Function not found. -// DeclarationError 4619: (115-120): Function not found. -// DeclarationError 4619: (135-140): Function not found. -// DeclarationError 4619: (155-160): Function not found. -// DeclarationError 4619: (175-180): Function not found. -// DeclarationError 4619: (195-200): Function not found. -// DeclarationError 4619: (215-220): Function not found. -// DeclarationError 4619: (235-240): Function not found. -// DeclarationError 4619: (255-260): Function not found. -// DeclarationError 4619: (275-281): Function not found. -// DeclarationError 4619: (296-302): Function not found. -// DeclarationError 4619: (317-323): Function not found. -// DeclarationError 4619: (338-344): Function not found. -// DeclarationError 4619: (359-365): Function not found. -// DeclarationError 4619: (380-386): Function not found. -// DeclarationError 4619: (401-407): Function not found. -// DeclarationError 4619: (422-428): Function not found. +// DeclarationError 4619: (75-80): Function "swap0" not found. +// DeclarationError 4619: (95-100): Function "swap1" not found. +// DeclarationError 4619: (115-120): Function "swap2" not found. +// DeclarationError 4619: (135-140): Function "swap3" not found. +// DeclarationError 4619: (155-160): Function "swap4" not found. +// DeclarationError 4619: (175-180): Function "swap5" not found. +// DeclarationError 4619: (195-200): Function "swap6" not found. +// DeclarationError 4619: (215-220): Function "swap7" not found. +// DeclarationError 4619: (235-240): Function "swap8" not found. +// DeclarationError 4619: (255-260): Function "swap9" not found. +// DeclarationError 4619: (275-281): Function "swap10" not found. +// DeclarationError 4619: (296-302): Function "swap11" not found. +// DeclarationError 4619: (317-323): Function "swap12" not found. +// DeclarationError 4619: (338-344): Function "swap13" not found. +// DeclarationError 4619: (359-365): Function "swap14" not found. +// DeclarationError 4619: (380-386): Function "swap15" not found. +// DeclarationError 4619: (401-407): Function "swap16" not found. +// DeclarationError 4619: (422-428): Function "swap32" not found. diff --git a/test/libsolidity/syntaxTests/inlineAssembly/linkersymbol_builtin.sol b/test/libsolidity/syntaxTests/inlineAssembly/linkersymbol_builtin.sol index 9f761f187..8679a97a2 100644 --- a/test/libsolidity/syntaxTests/inlineAssembly/linkersymbol_builtin.sol +++ b/test/libsolidity/syntaxTests/inlineAssembly/linkersymbol_builtin.sol @@ -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. diff --git a/test/libyul/Parser.cpp b/test/libyul/Parser.cpp index 6d40acdd4..b4a848267 100644 --- a/test/libyul/Parser.cpp +++ b/test/libyul/Parser.cpp @@ -140,8 +140,8 @@ BOOST_AUTO_TEST_CASE(builtins_analysis) SimpleDialect 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 := builtin(1, 2) }", DeclarationError, "Variable count mismatch: 2 variables and 3 values.", 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 for declaration of \"a, b\": 2 variables and 3 values.", dialect); } BOOST_AUTO_TEST_CASE(default_types_set) diff --git a/test/libyul/yulSyntaxTests/builtin_function_literal.yul b/test/libyul/yulSyntaxTests/builtin_function_literal.yul index 81d2c1ed5..22f721614 100644 --- a/test/libyul/yulSyntaxTests/builtin_function_literal.yul +++ b/test/libyul/yulSyntaxTests/builtin_function_literal.yul @@ -2,6 +2,6 @@ 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. -// DeclarationError 8198: (13-14): Identifier not found. +// DeclarationError 8198: (13-14): Identifier "x" not found. diff --git a/test/libyul/yulSyntaxTests/for_visibility_2.yul b/test/libyul/yulSyntaxTests/for_visibility_2.yul index 62cc90c0c..2cf365bac 100644 --- a/test/libyul/yulSyntaxTests/for_visibility_2.yul +++ b/test/libyul/yulSyntaxTests/for_visibility_2.yul @@ -4,4 +4,4 @@ // ==== // dialect: evm // ---- -// DeclarationError 8198: (10-11): Identifier not found. +// DeclarationError 8198: (10-11): Identifier "i" not found. diff --git a/test/libyul/yulSyntaxTests/for_visibility_3.yul b/test/libyul/yulSyntaxTests/for_visibility_3.yul index 54af2f854..5886e5336 100644 --- a/test/libyul/yulSyntaxTests/for_visibility_3.yul +++ b/test/libyul/yulSyntaxTests/for_visibility_3.yul @@ -4,4 +4,4 @@ // ==== // dialect: evm // ---- -// DeclarationError 8198: (33-34): Identifier not found. +// DeclarationError 8198: (33-34): Identifier "i" not found. diff --git a/test/libyul/yulSyntaxTests/for_visibility_4.yul b/test/libyul/yulSyntaxTests/for_visibility_4.yul index 68e81f3b4..38edc270f 100644 --- a/test/libyul/yulSyntaxTests/for_visibility_4.yul +++ b/test/libyul/yulSyntaxTests/for_visibility_4.yul @@ -4,4 +4,4 @@ // ==== // dialect: evm // ---- -// DeclarationError 8198: (18-19): Identifier not found. +// DeclarationError 8198: (18-19): Identifier "i" not found. diff --git a/test/libyul/yulSyntaxTests/for_visibility_5.yul b/test/libyul/yulSyntaxTests/for_visibility_5.yul index 2785394d8..af5b35952 100644 --- a/test/libyul/yulSyntaxTests/for_visibility_5.yul +++ b/test/libyul/yulSyntaxTests/for_visibility_5.yul @@ -4,4 +4,4 @@ // ==== // dialect: evm // ---- -// DeclarationError 8198: (13-14): Identifier not found. +// DeclarationError 8198: (13-14): Identifier "i" not found. diff --git a/test/libyul/yulSyntaxTests/for_visibility_6.yul b/test/libyul/yulSyntaxTests/for_visibility_6.yul index 75cb6d531..ccec08c19 100644 --- a/test/libyul/yulSyntaxTests/for_visibility_6.yul +++ b/test/libyul/yulSyntaxTests/for_visibility_6.yul @@ -4,4 +4,4 @@ // ==== // dialect: evm // ---- -// DeclarationError 8198: (13-14): Identifier not found. +// DeclarationError 8198: (13-14): Identifier "i" not found. diff --git a/test/libyul/yulSyntaxTests/for_visibility_7.yul b/test/libyul/yulSyntaxTests/for_visibility_7.yul index 00e289714..e08e8bb74 100644 --- a/test/libyul/yulSyntaxTests/for_visibility_7.yul +++ b/test/libyul/yulSyntaxTests/for_visibility_7.yul @@ -4,4 +4,4 @@ // ==== // dialect: evm // ---- -// DeclarationError 8198: (10-11): Identifier not found. +// DeclarationError 8198: (10-11): Identifier "i" not found. diff --git a/test/libyul/yulSyntaxTests/for_visibility_8.yul b/test/libyul/yulSyntaxTests/for_visibility_8.yul index 68e81f3b4..38edc270f 100644 --- a/test/libyul/yulSyntaxTests/for_visibility_8.yul +++ b/test/libyul/yulSyntaxTests/for_visibility_8.yul @@ -4,4 +4,4 @@ // ==== // dialect: evm // ---- -// DeclarationError 8198: (18-19): Identifier not found. +// DeclarationError 8198: (18-19): Identifier "i" not found. diff --git a/test/libyul/yulSyntaxTests/function_literal.yul b/test/libyul/yulSyntaxTests/function_literal.yul index b9652e354..80037dabf 100644 --- a/test/libyul/yulSyntaxTests/function_literal.yul +++ b/test/libyul/yulSyntaxTests/function_literal.yul @@ -3,4 +3,4 @@ f(x,1) } // ---- -// DeclarationError 8198: (27-28): Identifier not found. +// DeclarationError 8198: (27-28): Identifier "x" not found. diff --git a/test/libyul/yulSyntaxTests/instructions_too_few_args_1.yul b/test/libyul/yulSyntaxTests/instructions_too_few_args_1.yul index e2b077423..db482b6f4 100644 --- a/test/libyul/yulSyntaxTests/instructions_too_few_args_1.yul +++ b/test/libyul/yulSyntaxTests/instructions_too_few_args_1.yul @@ -2,4 +2,4 @@ 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. diff --git a/test/libyul/yulSyntaxTests/instructions_too_few_args_2.yul b/test/libyul/yulSyntaxTests/instructions_too_few_args_2.yul index a43a19959..f6239a95e 100644 --- a/test/libyul/yulSyntaxTests/instructions_too_few_args_2.yul +++ b/test/libyul/yulSyntaxTests/instructions_too_few_args_2.yul @@ -2,4 +2,4 @@ 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. diff --git a/test/libyul/yulSyntaxTests/instructions_too_many_args.yul b/test/libyul/yulSyntaxTests/instructions_too_many_args.yul index eafa3d902..ae4f1ae9d 100644 --- a/test/libyul/yulSyntaxTests/instructions_too_many_args.yul +++ b/test/libyul/yulSyntaxTests/instructions_too_many_args.yul @@ -2,4 +2,4 @@ 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. diff --git a/test/libyul/yulSyntaxTests/invalid/dup_disallowed.yul b/test/libyul/yulSyntaxTests/invalid/dup_disallowed.yul index ffcd60c3e..6fe9171d6 100644 --- a/test/libyul/yulSyntaxTests/invalid/dup_disallowed.yul +++ b/test/libyul/yulSyntaxTests/invalid/dup_disallowed.yul @@ -19,21 +19,21 @@ dup32() } // ---- -// DeclarationError 4619: (6-10): Function not found. -// DeclarationError 4619: (17-21): Function not found. -// DeclarationError 4619: (28-32): Function not found. -// DeclarationError 4619: (39-43): Function not found. -// DeclarationError 4619: (50-54): Function not found. -// DeclarationError 4619: (61-65): Function not found. -// DeclarationError 4619: (72-76): Function not found. -// DeclarationError 4619: (83-87): Function not found. -// DeclarationError 4619: (94-98): Function not found. -// DeclarationError 4619: (105-109): Function not found. -// DeclarationError 4619: (116-121): Function not found. -// DeclarationError 4619: (128-133): Function not found. -// DeclarationError 4619: (140-145): Function not found. -// DeclarationError 4619: (152-157): Function not found. -// DeclarationError 4619: (164-169): Function not found. -// DeclarationError 4619: (176-181): Function not found. -// DeclarationError 4619: (188-193): Function not found. -// DeclarationError 4619: (200-205): Function not found. +// DeclarationError 4619: (6-10): Function "dup0" not found. +// DeclarationError 4619: (17-21): Function "dup1" not found. +// DeclarationError 4619: (28-32): Function "dup2" not found. +// DeclarationError 4619: (39-43): Function "dup3" not found. +// DeclarationError 4619: (50-54): Function "dup4" not found. +// DeclarationError 4619: (61-65): Function "dup5" not found. +// DeclarationError 4619: (72-76): Function "dup6" not found. +// DeclarationError 4619: (83-87): Function "dup7" not found. +// DeclarationError 4619: (94-98): Function "dup8" not found. +// DeclarationError 4619: (105-109): Function "dup9" not found. +// DeclarationError 4619: (116-121): Function "dup10" not found. +// DeclarationError 4619: (128-133): Function "dup11" not found. +// DeclarationError 4619: (140-145): Function "dup12" not found. +// DeclarationError 4619: (152-157): Function "dup13" not found. +// DeclarationError 4619: (164-169): Function "dup14" not found. +// DeclarationError 4619: (176-181): Function "dup15" not found. +// DeclarationError 4619: (188-193): Function "dup16" not found. +// DeclarationError 4619: (200-205): Function "dup32" not found. diff --git a/test/libyul/yulSyntaxTests/invalid/jump_disallowed.yul b/test/libyul/yulSyntaxTests/invalid/jump_disallowed.yul index 5ab50a4c6..f1b94af9e 100644 --- a/test/libyul/yulSyntaxTests/invalid/jump_disallowed.yul +++ b/test/libyul/yulSyntaxTests/invalid/jump_disallowed.yul @@ -2,4 +2,4 @@ jump(2) } // ---- -// DeclarationError 4619: (6-10): Function not found. +// DeclarationError 4619: (6-10): Function "jump" not found. diff --git a/test/libyul/yulSyntaxTests/invalid/jumpdest_disallowed.yul b/test/libyul/yulSyntaxTests/invalid/jumpdest_disallowed.yul index 579f34892..03c168692 100644 --- a/test/libyul/yulSyntaxTests/invalid/jumpdest_disallowed.yul +++ b/test/libyul/yulSyntaxTests/invalid/jumpdest_disallowed.yul @@ -2,4 +2,4 @@ jumpdest() } // ---- -// DeclarationError 4619: (6-14): Function not found. +// DeclarationError 4619: (6-14): Function "jumpdest" not found. diff --git a/test/libyul/yulSyntaxTests/invalid/jumpi_disallowed.yul b/test/libyul/yulSyntaxTests/invalid/jumpi_disallowed.yul index e22a86ce1..b5b7d8bdb 100644 --- a/test/libyul/yulSyntaxTests/invalid/jumpi_disallowed.yul +++ b/test/libyul/yulSyntaxTests/invalid/jumpi_disallowed.yul @@ -2,4 +2,4 @@ jumpi(2, 1) } // ---- -// DeclarationError 4619: (6-11): Function not found. +// DeclarationError 4619: (6-11): Function "jumpi" not found. diff --git a/test/libyul/yulSyntaxTests/invalid/push_disallowed.yul b/test/libyul/yulSyntaxTests/invalid/push_disallowed.yul index c863e58c8..cbb406aaf 100644 --- a/test/libyul/yulSyntaxTests/invalid/push_disallowed.yul +++ b/test/libyul/yulSyntaxTests/invalid/push_disallowed.yul @@ -34,36 +34,36 @@ push32() } // ---- -// DeclarationError 4619: (6-11): Function not found. -// DeclarationError 4619: (18-23): Function not found. -// DeclarationError 4619: (30-35): Function not found. -// DeclarationError 4619: (42-47): Function not found. -// DeclarationError 4619: (54-59): Function not found. -// DeclarationError 4619: (66-71): Function not found. -// DeclarationError 4619: (78-83): Function not found. -// DeclarationError 4619: (90-95): Function not found. -// DeclarationError 4619: (102-107): Function not found. -// DeclarationError 4619: (114-119): Function not found. -// DeclarationError 4619: (126-132): Function not found. -// DeclarationError 4619: (139-145): Function not found. -// DeclarationError 4619: (152-158): Function not found. -// DeclarationError 4619: (165-171): Function not found. -// DeclarationError 4619: (178-184): Function not found. -// DeclarationError 4619: (191-197): Function not found. -// DeclarationError 4619: (204-210): Function not found. -// DeclarationError 4619: (217-223): Function not found. -// DeclarationError 4619: (230-236): Function not found. -// DeclarationError 4619: (243-249): Function not found. -// DeclarationError 4619: (256-262): Function not found. -// DeclarationError 4619: (269-275): Function not found. -// DeclarationError 4619: (282-288): Function not found. -// DeclarationError 4619: (295-301): Function not found. -// DeclarationError 4619: (308-314): Function not found. -// DeclarationError 4619: (321-327): Function not found. -// DeclarationError 4619: (334-340): Function not found. -// DeclarationError 4619: (347-353): Function not found. -// DeclarationError 4619: (360-366): Function not found. -// DeclarationError 4619: (373-379): Function not found. -// DeclarationError 4619: (386-392): Function not found. -// DeclarationError 4619: (399-405): Function not found. -// DeclarationError 4619: (412-418): Function not found. +// DeclarationError 4619: (6-11): Function "push0" not found. +// DeclarationError 4619: (18-23): Function "push1" not found. +// DeclarationError 4619: (30-35): Function "push2" not found. +// DeclarationError 4619: (42-47): Function "push3" not found. +// DeclarationError 4619: (54-59): Function "push4" not found. +// DeclarationError 4619: (66-71): Function "push5" not found. +// DeclarationError 4619: (78-83): Function "push6" not found. +// DeclarationError 4619: (90-95): Function "push7" not found. +// DeclarationError 4619: (102-107): Function "push8" not found. +// DeclarationError 4619: (114-119): Function "push9" not found. +// DeclarationError 4619: (126-132): Function "push10" not found. +// DeclarationError 4619: (139-145): Function "push11" not found. +// DeclarationError 4619: (152-158): Function "push12" not found. +// DeclarationError 4619: (165-171): Function "push13" not found. +// DeclarationError 4619: (178-184): Function "push14" not found. +// DeclarationError 4619: (191-197): Function "push15" not found. +// DeclarationError 4619: (204-210): Function "push16" not found. +// DeclarationError 4619: (217-223): Function "push17" not found. +// DeclarationError 4619: (230-236): Function "push18" not found. +// DeclarationError 4619: (243-249): Function "push19" not found. +// DeclarationError 4619: (256-262): Function "push20" not found. +// DeclarationError 4619: (269-275): Function "push21" not found. +// DeclarationError 4619: (282-288): Function "push22" not found. +// DeclarationError 4619: (295-301): Function "push23" not found. +// DeclarationError 4619: (308-314): Function "push24" not found. +// DeclarationError 4619: (321-327): Function "push25" not found. +// DeclarationError 4619: (334-340): Function "push26" not found. +// DeclarationError 4619: (347-353): Function "push27" not found. +// DeclarationError 4619: (360-366): Function "push28" not found. +// DeclarationError 4619: (373-379): Function "push29" not found. +// DeclarationError 4619: (386-392): Function "push30" not found. +// DeclarationError 4619: (399-405): Function "push31" not found. +// DeclarationError 4619: (412-418): Function "push32" not found. diff --git a/test/libyul/yulSyntaxTests/invalid/swap_disallowed.yul b/test/libyul/yulSyntaxTests/invalid/swap_disallowed.yul index 4103cab6f..0d86cfef2 100644 --- a/test/libyul/yulSyntaxTests/invalid/swap_disallowed.yul +++ b/test/libyul/yulSyntaxTests/invalid/swap_disallowed.yul @@ -19,21 +19,21 @@ swap32() } // ---- -// DeclarationError 4619: (6-11): Function not found. -// DeclarationError 4619: (18-23): Function not found. -// DeclarationError 4619: (30-35): Function not found. -// DeclarationError 4619: (42-47): Function not found. -// DeclarationError 4619: (54-59): Function not found. -// DeclarationError 4619: (66-71): Function not found. -// DeclarationError 4619: (78-83): Function not found. -// DeclarationError 4619: (90-95): Function not found. -// DeclarationError 4619: (102-107): Function not found. -// DeclarationError 4619: (114-119): Function not found. -// DeclarationError 4619: (126-132): Function not found. -// DeclarationError 4619: (139-145): Function not found. -// DeclarationError 4619: (152-158): Function not found. -// DeclarationError 4619: (165-171): Function not found. -// DeclarationError 4619: (178-184): Function not found. -// DeclarationError 4619: (191-197): Function not found. -// DeclarationError 4619: (204-210): Function not found. -// DeclarationError 4619: (217-223): Function not found. +// DeclarationError 4619: (6-11): Function "swap0" not found. +// DeclarationError 4619: (18-23): Function "swap1" not found. +// DeclarationError 4619: (30-35): Function "swap2" not found. +// DeclarationError 4619: (42-47): Function "swap3" not found. +// DeclarationError 4619: (54-59): Function "swap4" not found. +// DeclarationError 4619: (66-71): Function "swap5" not found. +// DeclarationError 4619: (78-83): Function "swap6" not found. +// DeclarationError 4619: (90-95): Function "swap7" not found. +// DeclarationError 4619: (102-107): Function "swap8" not found. +// DeclarationError 4619: (114-119): Function "swap9" not found. +// DeclarationError 4619: (126-132): Function "swap10" not found. +// DeclarationError 4619: (139-145): Function "swap11" not found. +// DeclarationError 4619: (152-158): Function "swap12" not found. +// DeclarationError 4619: (165-171): Function "swap13" not found. +// DeclarationError 4619: (178-184): Function "swap14" not found. +// DeclarationError 4619: (191-197): Function "swap15" not found. +// DeclarationError 4619: (204-210): Function "swap16" not found. +// DeclarationError 4619: (217-223): Function "swap32" not found. diff --git a/test/libyul/yulSyntaxTests/invalid_tuple_assignment.yul b/test/libyul/yulSyntaxTests/invalid_tuple_assignment.yul index 94805f0fd..8a2768b65 100644 --- a/test/libyul/yulSyntaxTests/invalid_tuple_assignment.yul +++ b/test/libyul/yulSyntaxTests/invalid_tuple_assignment.yul @@ -2,4 +2,4 @@ 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. diff --git a/test/libyul/yulSyntaxTests/linkersymbol_ewasm.yul b/test/libyul/yulSyntaxTests/linkersymbol_ewasm.yul index 2b01045ce..051359c07 100644 --- a/test/libyul/yulSyntaxTests/linkersymbol_ewasm.yul +++ b/test/libyul/yulSyntaxTests/linkersymbol_ewasm.yul @@ -4,4 +4,4 @@ // ==== // dialect: ewasm // ---- -// DeclarationError 4619: (6-18): Function not found. +// DeclarationError 4619: (6-18): Function "linkersymbol" not found. diff --git a/test/libyul/yulSyntaxTests/switch_duplicate_case.yul b/test/libyul/yulSyntaxTests/switch_duplicate_case.yul index 47fb88701..861f721ac 100644 --- a/test/libyul/yulSyntaxTests/switch_duplicate_case.yul +++ b/test/libyul/yulSyntaxTests/switch_duplicate_case.yul @@ -6,4 +6,4 @@ // ==== // dialect: evmTyped // ---- -// DeclarationError 6792: (34-50): Duplicate case defined. +// DeclarationError 6792: (34-50): Duplicate case "0" defined. diff --git a/test/libyul/yulSyntaxTests/switch_duplicate_case_different_literal.yul b/test/libyul/yulSyntaxTests/switch_duplicate_case_different_literal.yul index b190124bc..e3367b175 100644 --- a/test/libyul/yulSyntaxTests/switch_duplicate_case_different_literal.yul +++ b/test/libyul/yulSyntaxTests/switch_duplicate_case_different_literal.yul @@ -6,4 +6,4 @@ // ==== // dialect: evmTyped // ---- -// DeclarationError 6792: (34-49): Duplicate case defined. +// DeclarationError 6792: (34-49): Duplicate case "0" defined. diff --git a/test/libyul/yulSyntaxTests/switch_statement_duplicate_case.yul b/test/libyul/yulSyntaxTests/switch_statement_duplicate_case.yul index 5c9bbe045..4ba258c2b 100644 --- a/test/libyul/yulSyntaxTests/switch_statement_duplicate_case.yul +++ b/test/libyul/yulSyntaxTests/switch_statement_duplicate_case.yul @@ -7,4 +7,4 @@ // ==== // dialect: evm // ---- -// DeclarationError 6792: (25-34): Duplicate case defined. +// DeclarationError 6792: (25-34): Duplicate case "1" defined. diff --git a/test/libyul/yulSyntaxTests/variable_access_cross_funcs.yul b/test/libyul/yulSyntaxTests/variable_access_cross_funcs.yul index 7ddbacb8d..0f0e9e827 100644 --- a/test/libyul/yulSyntaxTests/variable_access_cross_funcs.yul +++ b/test/libyul/yulSyntaxTests/variable_access_cross_funcs.yul @@ -5,4 +5,4 @@ } } // ---- -// DeclarationError 8198: (36-37): Identifier not found. +// DeclarationError 8198: (36-37): Identifier "x" not found.