mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #4466 from ethereum/tupleNotEmpty
Disallow empty tuple components.
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
contract C {
|
||||
function f() public {
|
||||
uint a = (1);
|
||||
(uint b,) = (1,);
|
||||
(uint b,) = 1;
|
||||
(uint c, uint d) = (1, 2 + a);
|
||||
(uint e,) = (1, 2, b);
|
||||
(a) = 3;
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// Warning: (54-70): Different number of components on the left hand side (2) than on the right hand side (1).
|
||||
// Warning: (107-128): Different number of components on the left hand side (2) than on the right hand side (3).
|
||||
// Warning: (75-81): Unused local variable.
|
||||
// Warning: (83-89): Unused local variable.
|
||||
// Warning: (108-114): Unused local variable.
|
||||
// Warning: (14-143): Function state mutability can be restricted to pure
|
||||
// Warning: (54-67): Different number of components on the left hand side (2) than on the right hand side (1).
|
||||
// Warning: (104-125): Different number of components on the left hand side (2) than on the right hand side (3).
|
||||
// Warning: (72-78): Unused local variable.
|
||||
// Warning: (80-86): Unused local variable.
|
||||
// Warning: (105-111): Unused local variable.
|
||||
// Warning: (14-140): Function state mutability can be restricted to pure
|
||||
|
||||
Reference in New Issue
Block a user