mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #10615 from ethereum/develop
Merge develop into breaking.
This commit is contained in:
commit
6c7e6a3c9f
@ -332,7 +332,11 @@ vector<YulString> AsmAnalyzer::operator()(FunctionCall const& _funCall)
|
|||||||
for (size_t i = _funCall.arguments.size(); i > 0; i--)
|
for (size_t i = _funCall.arguments.size(); i > 0; i--)
|
||||||
{
|
{
|
||||||
Expression const& arg = _funCall.arguments[i - 1];
|
Expression const& arg = _funCall.arguments[i - 1];
|
||||||
if (auto literalArgumentKind = literalArguments ? literalArguments->at(i - 1) : std::nullopt)
|
if (
|
||||||
|
auto literalArgumentKind = (literalArguments && i <= literalArguments->size()) ?
|
||||||
|
literalArguments->at(i - 1) :
|
||||||
|
std::nullopt
|
||||||
|
)
|
||||||
{
|
{
|
||||||
if (!holds_alternative<Literal>(arg))
|
if (!holds_alternative<Literal>(arg))
|
||||||
m_errorReporter.typeError(
|
m_errorReporter.typeError(
|
||||||
|
7
test/libyul/yulSyntaxTests/builtin_function_literal.yul
Normal file
7
test/libyul/yulSyntaxTests/builtin_function_literal.yul
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
{
|
||||||
|
datasize(x,1)
|
||||||
|
}
|
||||||
|
// ----
|
||||||
|
// TypeError 7000: (4-12): Function expects 1 arguments but got 2.
|
||||||
|
// TypeError 9114: (4-12): Function expects direct literals as arguments.
|
||||||
|
// DeclarationError 8198: (13-14): Identifier not found.
|
6
test/libyul/yulSyntaxTests/function_literal.yul
Normal file
6
test/libyul/yulSyntaxTests/function_literal.yul
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
function f(a,b) {}
|
||||||
|
f(x,1)
|
||||||
|
}
|
||||||
|
// ----
|
||||||
|
// DeclarationError 8198: (27-28): Identifier not found.
|
6
test/libyul/yulSyntaxTests/function_literal_valid.yul
Normal file
6
test/libyul/yulSyntaxTests/function_literal_valid.yul
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
let x
|
||||||
|
function f(a,b) {}
|
||||||
|
f(x,1)
|
||||||
|
}
|
||||||
|
// ----
|
Loading…
Reference in New Issue
Block a user