mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Tests for unassigned calldata returns.
This commit is contained in:
parent
fc37b18e88
commit
ab7b1625ac
@ -0,0 +1,5 @@
|
||||
contract C {
|
||||
function f() internal returns (uint256[] calldata) {}
|
||||
}
|
||||
// ----
|
||||
// TypeError 3464: (48-66): This variable is of calldata pointer type and can be returned without prior assignment, which would lead to undefined behaviour.
|
@ -0,0 +1,5 @@
|
||||
contract C {
|
||||
function f() internal returns (uint256[1] calldata) {}
|
||||
}
|
||||
// ----
|
||||
// TypeError 3464: (48-67): This variable is of calldata pointer type and can be returned without prior assignment, which would lead to undefined behaviour.
|
@ -0,0 +1,6 @@
|
||||
contract C {
|
||||
struct S { uint256 x; }
|
||||
function f() internal returns (S calldata) {}
|
||||
}
|
||||
// ----
|
||||
// TypeError 3464: (76-86): This variable is of calldata pointer type and can be returned without prior assignment, which would lead to undefined behaviour.
|
Loading…
Reference in New Issue
Block a user