Merge pull request #2110 from federicobond/fix-posttypechecker

Fix PostTypeChecker retaining state across contracts
This commit is contained in:
chriseth 2017-05-02 12:12:46 +02:00 committed by GitHub
commit 2891b98882

View File

@ -58,6 +58,9 @@ void PostTypeChecker::endVisit(ContractDefinition const&)
for (auto declaration: m_constVariables) for (auto declaration: m_constVariables)
if (auto identifier = findCycle(declaration)) if (auto identifier = findCycle(declaration))
typeError(declaration->location(), "The value of the constant " + declaration->name() + " has a cyclic dependency via " + identifier->name() + "."); typeError(declaration->location(), "The value of the constant " + declaration->name() + " has a cyclic dependency via " + identifier->name() + ".");
m_constVariables.clear();
m_constVariableDependencies.clear();
} }
bool PostTypeChecker::visit(VariableDeclaration const& _variable) bool PostTypeChecker::visit(VariableDeclaration const& _variable)