mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Disallow using modifiers not in the current contract or in base contracts.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
library L {
|
||||
modifier m() { _; }
|
||||
}
|
||||
contract C {
|
||||
function f() L.m public {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 9428: (68-71): Can only use modifiers defined in the current contract or in base contracts.
|
||||
@@ -0,0 +1,9 @@
|
||||
contract C {
|
||||
modifier m() { _; }
|
||||
}
|
||||
contract D {
|
||||
function f() C.m public {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 9428: (69-72): Can only use modifiers defined in the current contract or in base contracts.
|
||||
@@ -0,0 +1,8 @@
|
||||
contract C {
|
||||
modifier m() { _; }
|
||||
}
|
||||
contract D is C {
|
||||
function f() C.m public {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
@@ -0,0 +1,11 @@
|
||||
contract A {}
|
||||
contract C is A {
|
||||
modifier m() { _; }
|
||||
}
|
||||
contract D is A {
|
||||
function f() C.m public {
|
||||
}
|
||||
}
|
||||
contract T is D, C {}
|
||||
// ----
|
||||
// TypeError 9428: (93-96): Can only use modifiers defined in the current contract or in base contracts.
|
||||
@@ -0,0 +1,10 @@
|
||||
library L {
|
||||
modifier m() { _; }
|
||||
}
|
||||
contract C {
|
||||
using L for *;
|
||||
function f() L.m public {
|
||||
}
|
||||
}
|
||||
// ----
|
||||
// TypeError 9428: (87-90): Can only use modifiers defined in the current contract or in base contracts.
|
||||
Reference in New Issue
Block a user