aboutsummaryrefslogtreecommitdiffstats
path: root/Types.h
diff options
context:
space:
mode:
authorGav Wood <g@ethdev.com>2015-01-11 18:07:36 +0800
committerGav Wood <g@ethdev.com>2015-01-11 18:07:36 +0800
commit94cff9684f8b1d4a5e2eeba58444a99e32e8a7ae (patch)
treeb14986766ba825f33176c82c66be8f10887d6517 /Types.h
parent26f9cd7f682b9d26252ab13f2a12178dc238abee (diff)
parentc5c893319285993dd9a1c6a790537e7acc35e5d0 (diff)
downloaddexon-solidity-94cff9684f8b1d4a5e2eeba58444a99e32e8a7ae.tar.gz
dexon-solidity-94cff9684f8b1d4a5e2eeba58444a99e32e8a7ae.tar.zst
dexon-solidity-94cff9684f8b1d4a5e2eeba58444a99e32e8a7ae.zip
Merge pull request #768 from chriseth/sol_contractsAreAddresses
Contracts inherit all address members
Diffstat (limited to 'Types.h')
-rw-r--r--Types.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/Types.h b/Types.h
index 69f69ef6..335c58a3 100644
--- a/Types.h
+++ b/Types.h
@@ -180,10 +180,11 @@ public:
bool isAddress() const { return m_modifier == Modifier::ADDRESS; }
int isSigned() const { return m_modifier == Modifier::SIGNED; }
+ static const MemberList AddressMemberList;
+
private:
int m_bits;
Modifier m_modifier;
- static const MemberList AddressMemberList;
};
/**
@@ -279,7 +280,9 @@ class ContractType: public Type
public:
virtual Category getCategory() const override { return Category::CONTRACT; }
ContractType(ContractDefinition const& _contract): m_contract(_contract) {}
- /// Contracts can be converted to themselves and to addresses.
+ /// Contracts can be implicitly converted to super classes and to addresses.
+ virtual bool isImplicitlyConvertibleTo(Type const& _convertTo) const override;
+ /// Contracts can be converted to themselves and to integers.
virtual bool isExplicitlyConvertibleTo(Type const& _convertTo) const override;
virtual bool operator==(Type const& _other) const override;
virtual u256 getStorageSize() const override;
@@ -292,6 +295,8 @@ public:
/// is not used, as this type cannot be the type of a variable or expression.
std::shared_ptr<FunctionType const> const& getConstructorType() const;
+ /// @returns the identifier of the function with the given name or Invalid256 if such a name does
+ /// not exist.
u256 getFunctionIdentifier(std::string const& _functionName) const;
private: