mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Some more tests.
This commit is contained in:
parent
0326367b22
commit
19e9e8b550
@ -0,0 +1,19 @@
|
||||
contract A {
|
||||
fallback (bytes calldata _input) virtual external returns (bytes memory) {
|
||||
return _input;
|
||||
}
|
||||
}
|
||||
contract B is A {
|
||||
fallback (bytes calldata _input) override external returns (bytes memory) {
|
||||
return "xyz";
|
||||
}
|
||||
function f() public returns (bool, bytes memory) {
|
||||
(bool success, bytes memory retval) = address(this).call("abc");
|
||||
return (success, retval);
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// EVMVersion: >=byzantium
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f() -> 0x01, 0x40, 0x03, 0x78797a0000000000000000000000000000000000000000000000000000000000
|
@ -0,0 +1,18 @@
|
||||
contract A {
|
||||
fallback (bytes calldata _input) virtual external returns (bytes memory) {
|
||||
return _input;
|
||||
}
|
||||
}
|
||||
contract B is A {
|
||||
fallback () override external {
|
||||
}
|
||||
function f() public returns (bool, bytes memory) {
|
||||
(bool success, bytes memory retval) = address(this).call("abc");
|
||||
return (success, retval);
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// EVMVersion: >=byzantium
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f() -> 1, 0x40, 0x00
|
@ -0,0 +1,22 @@
|
||||
contract A {
|
||||
fallback (bytes calldata _input) virtual external returns (bytes memory) {
|
||||
return _input;
|
||||
}
|
||||
}
|
||||
contract B {
|
||||
fallback (bytes calldata _input) virtual external returns (bytes memory) {
|
||||
return "xyz";
|
||||
}
|
||||
}
|
||||
contract C is B, A {
|
||||
fallback () external override (B, A) {}
|
||||
function f() public returns (bool, bytes memory) {
|
||||
(bool success, bytes memory retval) = address(this).call("abc");
|
||||
return (success, retval);
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// EVMVersion: >=byzantium
|
||||
// compileViaYul: also
|
||||
// ----
|
||||
// f() -> 0x01, 0x40, 0x00
|
@ -0,0 +1,13 @@
|
||||
contract D {
|
||||
fallback(bytes memory) external returns (bytes memory) {}
|
||||
}
|
||||
contract E {
|
||||
fallback(bytes memory) external returns (bytes calldata) {}
|
||||
}
|
||||
contract F {
|
||||
fallback(bytes calldata) external returns (bytes calldata) {}
|
||||
}
|
||||
// ----
|
||||
// TypeError 5570: (57-71): Fallback function either has to have the signature "fallback()" or "fallback(bytes calldata) returns (bytes memory)".
|
||||
// TypeError 5570: (134-150): Fallback function either has to have the signature "fallback()" or "fallback(bytes calldata) returns (bytes memory)".
|
||||
// TypeError 5570: (215-231): Fallback function either has to have the signature "fallback()" or "fallback(bytes calldata) returns (bytes memory)".
|
@ -0,0 +1,20 @@
|
||||
contract A {
|
||||
fallback (bytes calldata _input) external returns (bytes memory) {
|
||||
return _input;
|
||||
}
|
||||
}
|
||||
contract B {
|
||||
fallback (bytes calldata _input) external returns (bytes memory) {
|
||||
return "xyz";
|
||||
}
|
||||
}
|
||||
contract C is B, A {
|
||||
function f() public returns (bool, bytes memory) {
|
||||
(bool success, bytes memory retval) = address(this).call("abc");
|
||||
return (success, retval);
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// EVMVersion: >=byzantium
|
||||
// ----
|
||||
// TypeError 6480: (229-420): Derived contract must override function "". Two or more base classes define function with same name and parameter types.
|
Loading…
Reference in New Issue
Block a user