aboutsummaryrefslogtreecommitdiffstats
path: root/NameAndTypeResolver.h
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2015-04-15 23:40:50 +0800
committerchriseth <c@ethdev.com>2015-04-15 23:40:50 +0800
commit0c69d5fdcd3286f47c81dbcbcfb8802861eab8b5 (patch)
treef78c665e6084300b939cc4cfcebb97d3bd44d9f5 /NameAndTypeResolver.h
parent158795e48f4285d713b11f78cdd04de8c6d1f667 (diff)
downloaddexon-solidity-0c69d5fdcd3286f47c81dbcbcfb8802861eab8b5.tar.gz
dexon-solidity-0c69d5fdcd3286f47c81dbcbcfb8802861eab8b5.tar.zst
dexon-solidity-0c69d5fdcd3286f47c81dbcbcfb8802861eab8b5.zip
Fixed function overloads.
Added tests, disallowed non-calling usage of non-unique function references.
Diffstat (limited to 'NameAndTypeResolver.h')
-rw-r--r--NameAndTypeResolver.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/NameAndTypeResolver.h b/NameAndTypeResolver.h
index 82877617..6528bbef 100644
--- a/NameAndTypeResolver.h
+++ b/NameAndTypeResolver.h
@@ -65,9 +65,10 @@ public:
private:
void reset();
- /// Imports all members declared directly in the given contract (i.e. does not import inherited
- /// members) into the current scope if they are not present already.
- void importInheritedScope(ContractDefinition const& _base);
+ /// Either imports all non-function members or all function members declared directly in the
+ /// given contract (i.e. does not import inherited members) into the current scope if they are
+ ///not present already.
+ void importInheritedScope(ContractDefinition const& _base, bool _importFunctions);
/// Computes "C3-Linearization" of base contracts and stores it inside the contract.
void linearizeBaseContracts(ContractDefinition& _contract) const;
@@ -126,13 +127,18 @@ private:
class ReferencesResolver: private ASTVisitor
{
public:
- ReferencesResolver(ASTNode& _root, NameAndTypeResolver& _resolver,
- ContractDefinition const* _currentContract,
- ParameterList const* _returnParameters,
- bool _allowLazyTypes = true);
+ ReferencesResolver(
+ ASTNode& _root,
+ NameAndTypeResolver& _resolver,
+ ContractDefinition const* _currentContract,
+ ParameterList const* _returnParameters,
+ bool _resolveInsideCode = false,
+ bool _allowLazyTypes = true
+ );
private:
virtual void endVisit(VariableDeclaration& _variable) override;
+ virtual bool visit(Block&) override { return m_resolveInsideCode; }
virtual bool visit(Identifier& _identifier) override;
virtual bool visit(UserDefinedTypeName& _typeName) override;
virtual bool visit(Mapping&) override;
@@ -141,6 +147,7 @@ private:
NameAndTypeResolver& m_resolver;
ContractDefinition const* m_currentContract;
ParameterList const* m_returnParameters;
+ bool m_resolveInsideCode;
bool m_allowLazyTypes;
};