mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Multiline output parameters and return statements
This commit is contained in:
parent
2ac49b3c2d
commit
e34d367593
@ -112,6 +112,8 @@ No::
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.. _maximum_line_length:
|
||||||
|
|
||||||
Maximum Line Length
|
Maximum Line Length
|
||||||
===================
|
===================
|
||||||
|
|
||||||
@ -650,6 +652,50 @@ No::
|
|||||||
doSomething();
|
doSomething();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Multiline output parameters and return statements should follow the same style recommended for wrapping long lines found in the :ref:`Maximum Line Length <maximum_line_length>` section.
|
||||||
|
|
||||||
|
Yes::
|
||||||
|
|
||||||
|
function thisFunctionNameIsReallyLong(
|
||||||
|
address a,
|
||||||
|
address b,
|
||||||
|
address c
|
||||||
|
)
|
||||||
|
public
|
||||||
|
returns (
|
||||||
|
address someAddressName,
|
||||||
|
uint256 LongArgument,
|
||||||
|
uint256 Argument
|
||||||
|
)
|
||||||
|
{
|
||||||
|
doSomething()
|
||||||
|
|
||||||
|
return (
|
||||||
|
veryLongReturnArg1,
|
||||||
|
veryLongReturnArg2,
|
||||||
|
veryLongReturnArg3
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
No::
|
||||||
|
|
||||||
|
function thisFunctionNameIsReallyLong(
|
||||||
|
address a,
|
||||||
|
address b,
|
||||||
|
address c
|
||||||
|
)
|
||||||
|
public
|
||||||
|
returns (address someAddressName,
|
||||||
|
uint256 LongArgument,
|
||||||
|
uint256 Argument)
|
||||||
|
{
|
||||||
|
doSomething()
|
||||||
|
|
||||||
|
return (veryLongReturnArg1,
|
||||||
|
veryLongReturnArg1,
|
||||||
|
veryLongReturnArg1);
|
||||||
|
}
|
||||||
|
|
||||||
For constructor functions on inherited contracts whose bases require arguments,
|
For constructor functions on inherited contracts whose bases require arguments,
|
||||||
it is recommended to drop the base constructors onto new lines in the same
|
it is recommended to drop the base constructors onto new lines in the same
|
||||||
manner as modifiers if the function declaration is long or hard to read.
|
manner as modifiers if the function declaration is long or hard to read.
|
||||||
|
Loading…
Reference in New Issue
Block a user