forked from ethereum/solidity
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Turns it into warning (error for 0.5.0) and adds Changelog entry.
- Loading branch information
Showing
10 changed files
with
54 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
pragma solidity ^0.4.3; | ||
contract C { | ||
function f() {} | ||
function a() public { | ||
function f() private pure {} | ||
function a() public pure { | ||
bool x = true; | ||
bool y = true; | ||
(x) ? (f(), y = false) : (f(), y = false); | ||
} | ||
} | ||
// ---- | ||
// TypeError: (144-147): Type of tuple component cannot be null. | ||
// Warning: (162-165): Tuple component cannot be empty. | ||
// Warning: (181-184): Tuple component cannot be empty. |
11 changes: 11 additions & 0 deletions
11
test/libsolidity/syntaxTests/types/empty_tuple_function_050.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
pragma experimental "v0.5.0"; | ||
contract C { | ||
function f() private pure {} | ||
function a() public pure { | ||
bool x = true; | ||
bool y = true; | ||
(x) ? (f(), y = false) : (f(), y = false); | ||
} | ||
} | ||
// ---- | ||
// TypeError: (168-171): Tuple component cannot be empty. |
8 changes: 0 additions & 8 deletions
8
test/libsolidity/syntaxTests/types/empty_tuple_function_self.sol
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
pragma solidity ^0.4.3; | ||
contract C { | ||
function f() public pure {} | ||
function f() private pure {} | ||
function a() public { | ||
uint x; | ||
uint y; | ||
(x, y) = (f(), f()); | ||
} | ||
} | ||
// ---- | ||
// TypeError: (145-148): Type of tuple component cannot be null. | ||
// Warning: (146-149): Tuple component cannot be empty. | ||
// Warning: (151-154): Tuple component cannot be empty. | ||
// TypeError: (145-155): Type tuple(tuple(),tuple()) is not implicitly convertible to expected type tuple(uint256,uint256). |
11 changes: 11 additions & 0 deletions
11
test/libsolidity/syntaxTests/types/empty_tuple_lvalue_050.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
pragma experimental "v0.5.0"; | ||
contract C { | ||
function f() private pure {} | ||
function a() public { | ||
uint x; | ||
uint y; | ||
(x, y) = (f(), f()); | ||
} | ||
} | ||
// ---- | ||
// TypeError: (152-155): Tuple component cannot be empty. |
13 changes: 13 additions & 0 deletions
13
test/libsolidity/syntaxTests/types/empty_tuple_lvalue_array.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
pragma solidity ^0.4.3; | ||
contract C { | ||
function f() private pure {} | ||
function a() public { | ||
uint x; | ||
uint y; | ||
(x, y) = [f(), f()]; | ||
} | ||
} | ||
// ---- | ||
// Warning: (146-149): Tuple component cannot be empty. | ||
// Warning: (151-154): Tuple component cannot be empty. | ||
// TypeError: (145-155): Type tuple()[2] memory is not implicitly convertible to expected type tuple(uint256,uint256). |