aboutsummaryrefslogtreecommitdiffstats
path: root/Types.h
diff options
context:
space:
mode:
authorLefteris Karapetsas <lefteris@refu.co>2015-01-30 01:44:14 +0800
committerLefteris Karapetsas <lefteris@refu.co>2015-01-30 02:18:50 +0800
commit3701543ae8dd8ffbfd58e5648d45699468f10a55 (patch)
tree7b10e0bbbac6139c6cee92b9ebd040444507a311 /Types.h
parent04190798eba7a2996b28aee6d74b1c636f575a02 (diff)
downloaddexon-solidity-3701543ae8dd8ffbfd58e5648d45699468f10a55.tar.gz
dexon-solidity-3701543ae8dd8ffbfd58e5648d45699468f10a55.tar.zst
dexon-solidity-3701543ae8dd8ffbfd58e5648d45699468f10a55.zip
FunctionType now returns const ref for Declaration
Diffstat (limited to 'Types.h')
-rw-r--r--Types.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/Types.h b/Types.h
index b8ad7449..4b4d17d0 100644
--- a/Types.h
+++ b/Types.h
@@ -390,7 +390,12 @@ public:
/// If @a _name is not provided (empty string) then the @c m_declaration member of the
/// function type is used
std::string getCanonicalSignature(std::string const& _name = "") const;
- Declaration const* getDeclaration() const { return m_declaration; }
+ Declaration const& getDeclaration() const
+ {
+ solAssert(m_declaration, "Requested declaration from a FunctionType that has none");
+ return *m_declaration;
+ }
+ bool hasDeclaration() const { return !!m_declaration; }
bool isConstant() const { return m_isConstant; }
/// @return A shared pointer of an ASTString.
/// Can contain a nullptr in which case indicates absence of documentation