diff options
Diffstat (limited to 'test/libsolidity/syntaxTests/types/unnamed_tuple_decl.sol')
-rw-r--r-- | test/libsolidity/syntaxTests/types/unnamed_tuple_decl.sol | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/libsolidity/syntaxTests/types/unnamed_tuple_decl.sol b/test/libsolidity/syntaxTests/types/unnamed_tuple_decl.sol new file mode 100644 index 00000000..6c1489f5 --- /dev/null +++ b/test/libsolidity/syntaxTests/types/unnamed_tuple_decl.sol @@ -0,0 +1,19 @@ +pragma solidity ^0.4.20; + +contract C { + function f() internal pure {} + function g() internal pure returns (uint) { return 1; } + function h() internal pure returns (uint, uint) { return (1, 2); } + + function test() internal pure { + var () = f(); + var () = g(); + var (,) = h(); + } +} + +// ---- +// SyntaxError: (249-261): The use of the "var" keyword is disallowed. The declaration part of the statement can be removed, since it is empty. +// SyntaxError: (271-283): The use of the "var" keyword is disallowed. The declaration part of the statement can be removed, since it is empty. +// SyntaxError: (293-306): The use of the "var" keyword is disallowed. The declaration part of the statement can be removed, since it is empty. +// TypeError: (271-283): Too many components (1) in value for variable assignment (0) needed |