Add tests for mappings in function types.

This commit is contained in:
Daniel Kirchner 2018-08-13 16:29:47 +02:00
parent 341128962f
commit dfcfc4c35b
4 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,6 @@
contract C {
function f(function(mapping(uint=>uint) storage) external) public pure {
}
}
// ----
// TypeError: (37-56): Internal type cannot be used for external function type.

View File

@ -0,0 +1,4 @@
contract C {
function f(function(mapping(uint=>uint) storage) internal) internal pure {
}
}

View File

@ -0,0 +1,6 @@
contract C {
function f(function() external returns (mapping(uint=>uint) storage)) public pure {
}
}
// ----
// TypeError: (57-76): Internal type cannot be used for external function type.

View File

@ -0,0 +1,4 @@
contract C {
function f(function() internal returns (mapping(uint=>uint) storage)) internal pure {
}
}