Move several tests related to function types from nameAndTypeResolution/ to more specific directories

This commit is contained in:
Kamil Śliwak
2021-02-23 16:46:49 +01:00
parent 596e8dd9b6
commit fc7a091bfb
10 changed files with 0 additions and 0 deletions
@@ -0,0 +1,10 @@
pragma abicoder v2;
contract C {
struct T { mapping(uint => uint) a; }
struct S { T[][2] b; }
function f(S memory) public {}
}
// ----
// TypeError 4103: (132-140): Types containing (nested) mappings can only be parameters or return variables of internal or library functions.
// TypeError 4061: (132-140): Type struct C.S is only valid in storage because it contains a (nested) mapping.
@@ -0,0 +1,8 @@
pragma abicoder v2;
contract C {
struct S { function() internal a; }
function f(S memory) public {}
}
// ----
// TypeError 4103: (103-111): Internal type is not allowed for public or external functions.
@@ -0,0 +1,9 @@
pragma abicoder v2;
contract C {
struct S { mapping(uint => uint) a; }
function f(S memory) public {}
}
// ----
// TypeError 4103: (105-113): Types containing (nested) mappings can only be parameters or return variables of internal or library functions.
// TypeError 4061: (105-113): Type struct C.S is only valid in storage because it contains a (nested) mapping.
@@ -0,0 +1,9 @@
pragma abicoder v2;
contract C {
struct S1 { function() external a; }
struct S2 { bytes24 a; }
function f(S1 memory) public pure {}
function f(S2 memory) public pure {}
}
// ----
@@ -0,0 +1,10 @@
pragma abicoder v2;
contract C {
struct S1 { int i; }
struct S2 { int i; }
function f(S1 memory) public pure {}
function f(S2 memory) public pure {}
}
// ----
// TypeError 9914: (143-179): Function overload clash during conversion to external types for arguments.