From 7faaa94c6e212e186738ed94768945f7055d28bf Mon Sep 17 00:00:00 2001 From: hrkrshnn Date: Tue, 28 Sep 2021 12:21:20 +0200 Subject: [PATCH] Added additional functions for UserDefinedValueType This is a safety check, when the custom types get extended in the future. --- libsolidity/ast/Types.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/libsolidity/ast/Types.h b/libsolidity/ast/Types.h index a26644641..2220875b1 100644 --- a/libsolidity/ast/Types.h +++ b/libsolidity/ast/Types.h @@ -1121,6 +1121,25 @@ public: return true; } + bool containsNestedMapping() const override + { + solAssert(nameable(), "Called for a non nameable type."); + solAssert(!underlyingType().containsNestedMapping(), ""); + return false; + } + + bool hasSimpleZeroValueInMemory() const override + { + solAssert(underlyingType().hasSimpleZeroValueInMemory(), ""); + return true; + } + + bool dataStoredIn(DataLocation _loc) const override + { + solAssert(!underlyingType().dataStoredIn(_loc), ""); + return false; + } + std::string toString(bool _short) const override; std::string canonicalName() const override { solAssert(false, ""); } std::string signatureInExternalFunction(bool) const override { solAssert(false, ""); }