Merge pull request #8301 from ethereum/fixPostTypeChecker

PostTypeChecker: ConstStateVarCircularReferenceChecker on function type state variables.
This commit is contained in:
chriseth
2020-02-12 18:40:19 +01:00
committed by GitHub
3 changed files with 14 additions and 1 deletions
@@ -0,0 +1,6 @@
// Used to cause ICE.
contract C {
function ( ) internal returns ( bytes [ ] storage , mapping ( bytes => mapping ( bytes => mapping ( uint => mapping ( bytes => mapping ( string => mapping ( uint => mapping ( uint => mapping ( uint => mapping ( uint => mapping ( string => mapping ( string => mapping ( uint => mapping ( bytes => mapping ( uint => mapping ( uint => mapping ( uint => mapping ( uint => mapping ( uint => mapping ( bytes => mapping ( uint => mapping ( uint => mapping ( uint => mapping ( uint => mapping ( string => mapping ( uint => string ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) [ ] storage ) constant c = c ;
}
// ----
// TypeError: (43-643): The value of the constant c has a cyclic dependency via c.
@@ -0,0 +1,7 @@
contract C {
// Used to cause internal compiler error.
function() returns (x) constant x = x;
}
// ----
// TypeError: (77-78): Name has to refer to a struct, enum or contract.