Catch panic.

This commit is contained in:
chriseth
2020-12-22 11:08:44 +01:00
parent b78443ac75
commit b965446182
21 changed files with 619 additions and 80 deletions
@@ -0,0 +1,13 @@
contract C {
function f() public {
try this.f() {
} catch Panic(bytes memory) {
} catch Panic(uint) {
}
}
}
// ====
// EVMVersion: >=byzantium
// ----
// TypeError 1271: (72-109): Expected `catch Panic(uint ...) { ... }`.
// TypeError 6732: (110-139): This try statement already has a "Panic" catch clause.
@@ -0,0 +1,12 @@
contract C {
function f() public {
try this.f() {
} catch Panic(uint) {
} catch Panic(uint) {
}
}
}
// ====
// EVMVersion: >=byzantium
// ----
// TypeError 6732: (102-131): This try statement already has a "Panic" catch clause.
@@ -0,0 +1,11 @@
contract C {
function f() public {
try this.f() {
} catch Error(string memory) {
} catch Panic(uint) {
}
}
}
// ====
// EVMVersion: >=byzantium
// ----
@@ -7,5 +7,5 @@ contract C {
}
}
// ----
// TypeError 3542: (93-119): Invalid catch clause name. Expected either `catch (...)` or `catch Error(...)`.
// TypeError 3542: (120-143): Invalid catch clause name. Expected either `catch (...)` or `catch Error(...)`.
// TypeError 3542: (93-119): Invalid catch clause name. Expected either `catch (...)`, `catch Error(...)`, or `catch Panic(...)`.
// TypeError 3542: (120-143): Invalid catch clause name. Expected either `catch (...)`, `catch Error(...)`, or `catch Panic(...)`.
@@ -0,0 +1,11 @@
contract C {
function f() public {
try this.f() {
} catch Panic() {
}
}
}
// ====
// EVMVersion: >=byzantium
// ----
// TypeError 1271: (72-97): Expected `catch Panic(uint ...) { ... }`.
@@ -0,0 +1,11 @@
contract C {
function f() public {
try this.f() {
} catch Panic(bytes memory) {
}
}
}
// ====
// EVMVersion: >=byzantium
// ----
// TypeError 1271: (72-109): Expected `catch Panic(uint ...) { ... }`.