mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
30 lines
531 B
Solidity
30 lines
531 B
Solidity
abstract contract A {
|
|
function f() virtual public pure;
|
|
}
|
|
|
|
interface I {
|
|
function f() external pure;
|
|
}
|
|
|
|
contract C {
|
|
function f() pure public {
|
|
}
|
|
}
|
|
|
|
contract Test {
|
|
function c() public pure returns (string memory) {
|
|
return type(C).name;
|
|
}
|
|
function a() public pure returns (string memory) {
|
|
return type(A).name;
|
|
}
|
|
function i() public pure returns (string memory) {
|
|
return type(I).name;
|
|
}
|
|
}
|
|
|
|
// ----
|
|
// c() -> 0x20, 1, "C"
|
|
// a() -> 0x20, 1, "A"
|
|
// i() -> 0x20, 1, "I"
|