mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Merge pull request #12781 from ethereum/fixImportDirectiveVisits
Fix import directive visits in type checker and view pure checker.
This commit is contained in:
@@ -268,6 +268,11 @@ TypePointers TypeChecker::typeCheckMetaTypeFunctionAndRetrieveReturnType(Functio
|
||||
return {TypeProvider::meta(dynamic_cast<TypeType const&>(*firstArgType).actualType())};
|
||||
}
|
||||
|
||||
bool TypeChecker::visit(ImportDirective const&)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void TypeChecker::endVisit(InheritanceSpecifier const& _inheritance)
|
||||
{
|
||||
auto base = dynamic_cast<ContractDefinition const*>(&dereference(_inheritance.name()));
|
||||
|
||||
@@ -125,6 +125,8 @@ private:
|
||||
FunctionType const* _functionType
|
||||
);
|
||||
|
||||
bool visit(ImportDirective const&) override;
|
||||
|
||||
void endVisit(InheritanceSpecifier const& _inheritance) override;
|
||||
void endVisit(ModifierDefinition const& _modifier) override;
|
||||
bool visit(FunctionDefinition const& _function) override;
|
||||
|
||||
@@ -134,6 +134,11 @@ bool ViewPureChecker::check()
|
||||
return !m_errors;
|
||||
}
|
||||
|
||||
bool ViewPureChecker::visit(ImportDirective const&)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ViewPureChecker::visit(FunctionDefinition const& _funDef)
|
||||
{
|
||||
solAssert(!m_currentFunction, "");
|
||||
|
||||
@@ -50,6 +50,8 @@ private:
|
||||
langutil::SourceLocation location;
|
||||
};
|
||||
|
||||
bool visit(ImportDirective const&) override;
|
||||
|
||||
bool visit(FunctionDefinition const& _funDef) override;
|
||||
void endVisit(FunctionDefinition const& _funDef) override;
|
||||
bool visit(ModifierDefinition const& _modifierDef) override;
|
||||
|
||||
@@ -115,6 +115,12 @@ void SMTEncoder::endVisit(ContractDefinition const& _contract)
|
||||
m_context.popSolver();
|
||||
}
|
||||
|
||||
bool SMTEncoder::visit(ImportDirective const&)
|
||||
{
|
||||
// do not visit because the identifier therein will confuse us.
|
||||
return false;
|
||||
}
|
||||
|
||||
void SMTEncoder::endVisit(VariableDeclaration const& _varDecl)
|
||||
{
|
||||
// State variables are handled by the constructor.
|
||||
|
||||
@@ -136,6 +136,7 @@ protected:
|
||||
// because the order of expression evaluation is undefined
|
||||
// TODO: or just force a certain order, but people might have a different idea about that.
|
||||
|
||||
bool visit(ImportDirective const& _node) override;
|
||||
bool visit(ContractDefinition const& _node) override;
|
||||
void endVisit(ContractDefinition const& _node) override;
|
||||
void endVisit(VariableDeclaration const& _node) override;
|
||||
|
||||
Reference in New Issue
Block a user