mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Catch panic.
This commit is contained in:
@@ -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 ...) { ... }`.
|
||||
Reference in New Issue
Block a user