mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Move assertion in PostTypeChecker's ConstStateVarCircularReferenceChecker to account for function type variables
This commit is contained in:
parent
85348e9af7
commit
45f80e9895
@ -133,9 +133,9 @@ struct ConstStateVarCircularReferenceChecker: public PostTypeChecker::Checker
|
||||
|
||||
bool visit(VariableDeclaration const& _variable) override
|
||||
{
|
||||
solAssert(!m_currentConstVariable, "");
|
||||
if (_variable.isConstant())
|
||||
{
|
||||
solAssert(!m_currentConstVariable, "");
|
||||
m_currentConstVariable = &_variable;
|
||||
m_constVariables.push_back(&_variable);
|
||||
}
|
||||
|
@ -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.
|
Loading…
Reference in New Issue
Block a user