-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: error when return func has named param
- Loading branch information
1 parent
e321f62
commit 2ce3772
Showing
3 changed files
with
57 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
contract A { | ||
constructor() { | ||
function(uint256) view returns (uint256) a; | ||
|
||
function(uint256) view returns (uint256 j) c; //~ERROR: return parameters in function types may not be named | ||
//~^WARN: named function type parameters are deprecated | ||
|
||
function(uint256 k) view returns (uint256) d; | ||
//~^WARN: named function type parameters are deprecated | ||
} | ||
} |
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,24 @@ | ||
warning[6162]: named function type parameters are deprecated | ||
--> ROOT/tests/ui/resolve/func_ty_named_params.sol:LL:CC | ||
| | ||
LL | function(uint256) view returns (uint256 j) c; | ||
| - | ||
| | ||
|
||
warning[6162]: named function type parameters are deprecated | ||
--> ROOT/tests/ui/resolve/func_ty_named_params.sol:LL:CC | ||
| | ||
LL | function(uint256 k) view returns (uint256) d; | ||
| - | ||
| | ||
|
||
error: return parameters in function types may not be named | ||
--> ROOT/tests/ui/resolve/func_ty_named_params.sol:LL:CC | ||
| | ||
LL | function(uint256) view returns (uint256 j) c; | ||
| ^^^^^^^^^ | ||
| | ||
= help: remove `j` | ||
|
||
error: aborting due to 1 previous error; 2 warnings emitted | ||
|