aboutsummaryrefslogtreecommitdiffstats
path: root/Types.h
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2015-01-22 08:02:38 +0800
committerChristian <c@ethdev.com>2015-01-26 17:23:39 +0800
commit941c77c8fadd6195809cd2d572feb64478c4fb20 (patch)
treea4de3710aff5f3f2d9423565fd0e9ecc8708b5bf /Types.h
parent19793dab093ae36b5f2b4d1cabfbf54bed3125b1 (diff)
downloaddexon-solidity-941c77c8fadd6195809cd2d572feb64478c4fb20.tar.gz
dexon-solidity-941c77c8fadd6195809cd2d572feb64478c4fb20.tar.zst
dexon-solidity-941c77c8fadd6195809cd2d572feb64478c4fb20.zip
Type resolution for function modifiers.
Diffstat (limited to 'Types.h')
-rw-r--r--Types.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/Types.h b/Types.h
index e6c99fe3..935c39eb 100644
--- a/Types.h
+++ b/Types.h
@@ -75,7 +75,7 @@ class Type: private boost::noncopyable, public std::enable_shared_from_this<Type
public:
enum class Category
{
- INTEGER, INTEGER_CONSTANT, BOOL, REAL, STRING, CONTRACT, STRUCT, FUNCTION, MAPPING, VOID, TYPE, MAGIC
+ INTEGER, INTEGER_CONSTANT, BOOL, REAL, STRING, CONTRACT, STRUCT, FUNCTION, MAPPING, VOID, TYPE, MODIFIER, MAGIC
};
///@{
@@ -464,6 +464,27 @@ private:
/**
+ * The type of a function modifier. Not used for anything for now.
+ */
+class ModifierType: public Type
+{
+public:
+ virtual Category getCategory() const override { return Category::MODIFIER; }
+ explicit ModifierType(ModifierDefinition const& _modifier);
+
+ virtual TypePointer binaryOperatorResult(Token::Value, TypePointer const&) const override { return TypePointer(); }
+ virtual bool canBeStored() const override { return false; }
+ virtual u256 getStorageSize() const override { BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Storage size of non-storable type type requested.")); }
+ virtual bool canLiveOutsideStorage() const override { return false; }
+ virtual bool operator==(Type const& _other) const override;
+ virtual std::string toString() const override;
+
+private:
+ TypePointers m_parameterTypes;
+};
+
+
+/**
* Special type for magic variables (block, msg, tx), similar to a struct but without any reference
* (it always references a global singleton by name).
*/