aboutsummaryrefslogtreecommitdiffstats
path: root/AST.h
diff options
context:
space:
mode:
authorLu Guanqun <guanqun.lu@gmail.com>2015-03-01 11:34:39 +0800
committerLu Guanqun <guanqun.lu@gmail.com>2015-03-08 22:50:06 +0800
commit3b9b71e0ae86cc20c6a0201b027bd45bee4257e5 (patch)
treec3b1ffc4e5d6d2e8013733401289928cfc51d086 /AST.h
parente008f3f808b1483e7b7a5861ea4fe46fbe74bcff (diff)
downloaddexon-solidity-3b9b71e0ae86cc20c6a0201b027bd45bee4257e5.tar.gz
dexon-solidity-3b9b71e0ae86cc20c6a0201b027bd45bee4257e5.tar.zst
dexon-solidity-3b9b71e0ae86cc20c6a0201b027bd45bee4257e5.zip
implement overload resolution
Diffstat (limited to 'AST.h')
-rw-r--r--AST.h15
1 files changed, 11 insertions, 4 deletions
diff --git a/AST.h b/AST.h
index b21e505e..fa1d4a92 100644
--- a/AST.h
+++ b/AST.h
@@ -1134,8 +1134,8 @@ public:
class Identifier: public PrimaryExpression
{
public:
- Identifier(SourceLocation const& _location, ASTPointer<ASTString> const& _name, bool _isCallable):
- PrimaryExpression(_location), m_name(_name), m_isCallable(_isCallable) {}
+ Identifier(SourceLocation const& _location, ASTPointer<ASTString> const& _name):
+ PrimaryExpression(_location), m_name(_name) {}
virtual void accept(ASTVisitor& _visitor) override;
virtual void accept(ASTConstVisitor& _visitor) const override;
virtual void checkTypeRequirements() override;
@@ -1151,9 +1151,15 @@ public:
Declaration const* getReferencedDeclaration() const { return m_referencedDeclaration; }
ContractDefinition const* getCurrentContract() const { return m_currentContract; }
- bool isCallable() const { return m_isCallable; }
+ void setOverloadedDeclarations(std::set<Declaration const*> const& _declarations) { m_overloadedDeclarations = _declarations; }
+ std::set<Declaration const*> getOverloadedDeclarations() const { return m_overloadedDeclarations; }
+ void checkTypeRequirementsWithFunctionCall(FunctionCall const& _functionCall);
+ void checkTypeRequirementsFromVariableDeclaration();
+
+ void overloadResolution(FunctionCall const& _functionCall);
private:
+
ASTPointer<ASTString> m_name;
/// Declaration the name refers to.
@@ -1161,7 +1167,8 @@ private:
/// Stores a reference to the current contract. This is needed because types of base contracts
/// change depending on the context.
ContractDefinition const* m_currentContract = nullptr;
- bool m_isCallable = false;
+ /// A set of overloaded declarations, right now only FunctionDefinition has overloaded declarations.
+ std::set<Declaration const*> m_overloadedDeclarations;
};
/**