Error message: try-catch parameter cannot be in storage.

This commit is contained in:
hrkrshnn 2021-05-31 11:21:04 +02:00
parent 2f0df8f054
commit f582d48f7b
2 changed files with 12 additions and 2 deletions

View File

@ -696,8 +696,7 @@ set<VariableDeclaration::Location> VariableDeclaration::allowedDataLocations() c
if (
isConstructorParameter() ||
isInternalCallableParameter() ||
isLibraryFunctionParameter() ||
isTryCatchParameter()
isLibraryFunctionParameter()
)
locations.insert(Location::Storage);
if (!isTryCatchParameter() && !isConstructorParameter())

View File

@ -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.