-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1ea64d6
commit 7bea970
Showing
5 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
...externalFunction/function_argument_location_specifier_test_external_transient_storage.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,5 @@ | ||
contract test { | ||
function f(bytes transient) external; | ||
} | ||
// ---- | ||
// TypeError 6651: (28-43): Data location must be "memory" or "calldata" for parameter in external function, but none was given. |
Empty file.
8 changes: 8 additions & 0 deletions
8
test/libsolidity/syntaxTests/dataLocations/transient_state_variable.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,8 @@ | ||
contract C { | ||
uint transient x; | ||
function f() public view returns(uint) { | ||
return x; | ||
} | ||
} | ||
// ---- | ||
// TypeError 6651: (14-30): Data location can only be specified for array, struct or mapping types, but "transient" was given. |
10 changes: 10 additions & 0 deletions
10
test/libsolidity/syntaxTests/variableDeclaration/transient_as_identifier.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,10 @@ | ||
contract C { | ||
function transient() public pure { } | ||
} | ||
contract D { | ||
function f() public pure returns (uint) { | ||
uint transient = 1; | ||
return transient; | ||
} | ||
} | ||
// ---- |
14 changes: 14 additions & 0 deletions
14
...libsolidity/syntaxTests/variableDeclaration/transient_as_identifier_and_data_location.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,14 @@ | ||
contract C { | ||
function f() public pure returns (uint) { | ||
uint transient = 1; | ||
uint transient x = transient + 2; | ||
return x; | ||
} | ||
function g() public pure returns (uint) { | ||
uint transient transient = 9; | ||
return transient; | ||
} | ||
} | ||
// ---- | ||
// TypeError 6651: (80-96): Data location can only be specified for array, struct or mapping types, but "transient" was given. | ||
// TypeError 6651: (174-198): Data location can only be specified for array, struct or mapping types, but "transient" was given. |