aboutsummaryrefslogtreecommitdiffstats
path: root/Types.h
diff options
context:
space:
mode:
authorliana <liana@ethdev.com>2015-01-14 20:52:03 +0800
committerliana <liana@ethdev.com>2015-01-15 18:59:58 +0800
commit00b0b0933de8f745451652e8838f0c09a741228e (patch)
tree793020607eeba7ede1ed0356a215385dd5bf13e0 /Types.h
parent6e16107870494878635da347146b076a7d75dea0 (diff)
downloaddexon-solidity-00b0b0933de8f745451652e8838f0c09a741228e.tar.gz
dexon-solidity-00b0b0933de8f745451652e8838f0c09a741228e.tar.zst
dexon-solidity-00b0b0933de8f745451652e8838f0c09a741228e.zip
- added functionality to set values to 0 when deleting structure(not for mapping)
- added unit test Made some changes after Christian`s review on pull request - remove/edit comments - BoolType and ContractType return VoidType after delete - fixed constructor_arguments test - fixed set to 0 when deleting variable from stack - changed test case to test that
Diffstat (limited to 'Types.h')
-rw-r--r--Types.h13
1 files changed, 3 insertions, 10 deletions
diff --git a/Types.h b/Types.h
index 1ccdd706..3d9b45e2 100644
--- a/Types.h
+++ b/Types.h
@@ -259,10 +259,7 @@ public:
BoolType() {}
virtual Category getCategory() const { return Category::BOOL; }
virtual bool isExplicitlyConvertibleTo(Type const& _convertTo) const override;
- virtual TypePointer unaryOperatorResult(Token::Value _operator) const override
- {
- return (_operator == Token::NOT || _operator == Token::DELETE) ? shared_from_this() : TypePointer();
- }
+ virtual TypePointer unaryOperatorResult(Token::Value _operator) const override;
virtual TypePointer binaryOperatorResult(Token::Value _operator, TypePointer const& _other) const override;
virtual unsigned getCalldataEncodedSize() const { return 1; }
@@ -284,8 +281,8 @@ public:
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 TypePointer unaryOperatorResult(Token::Value _operator) const override;
virtual bool operator==(Type const& _other) const override;
- virtual u256 getStorageSize() const override;
virtual bool isValueType() const override { return true; }
virtual std::string toString() const override;
@@ -315,11 +312,7 @@ class StructType: public Type
public:
virtual Category getCategory() const override { return Category::STRUCT; }
StructType(StructDefinition const& _struct): m_struct(_struct) {}
- virtual TypePointer unaryOperatorResult(Token::Value _operator) const override
- {
- return _operator == Token::DELETE ? shared_from_this() : TypePointer();
- }
-
+ virtual TypePointer unaryOperatorResult(Token::Value _operator) const override;
virtual bool operator==(Type const& _other) const override;
virtual u256 getStorageSize() const override;
virtual bool canLiveOutsideStorage() const override;