mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Move several tests related to function types from nameAndTypeResolution/ to more specific directories
This commit is contained in:
+10
@@ -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.
|
||||
+8
@@ -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.
|
||||
+9
@@ -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.
|
||||
+9
@@ -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 {}
|
||||
}
|
||||
// ----
|
||||
+10
@@ -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.
|
||||
Reference in New Issue
Block a user