mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #11454 from ethereum/data-location-error
Error message: try-catch parameter cannot be in storage.
This commit is contained in:
commit
6dd5bcd3f0
@ -696,8 +696,7 @@ set<VariableDeclaration::Location> VariableDeclaration::allowedDataLocations() c
|
|||||||
if (
|
if (
|
||||||
isConstructorParameter() ||
|
isConstructorParameter() ||
|
||||||
isInternalCallableParameter() ||
|
isInternalCallableParameter() ||
|
||||||
isLibraryFunctionParameter() ||
|
isLibraryFunctionParameter()
|
||||||
isTryCatchParameter()
|
|
||||||
)
|
)
|
||||||
locations.insert(Location::Storage);
|
locations.insert(Location::Storage);
|
||||||
if (!isTryCatchParameter() && !isConstructorParameter())
|
if (!isTryCatchParameter() && !isConstructorParameter())
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
contract Foo {
|
||||||
|
function test() public {
|
||||||
|
try this.f() {}
|
||||||
|
catch Error(string reason) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
function f() public {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// ----
|
||||||
|
// TypeError 6651: (88-101): Data location must be "memory" for parameter in function, but none was given.
|
Loading…
Reference in New Issue
Block a user