diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2018-03-14 23:56:06 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2018-03-26 18:37:38 +0800 |
commit | 8bae2dba7c9697d129a43c1dde54690f3e37a84a (patch) | |
tree | 07ce21a7b1ff6d0171e231249f1b7df837734d31 /libsolidity/ast/AST.cpp | |
parent | ef3595b0001614c19174c61d29d221844ed83a0e (diff) | |
download | dexon-solidity-8bae2dba7c9697d129a43c1dde54690f3e37a84a.tar.gz dexon-solidity-8bae2dba7c9697d129a43c1dde54690f3e37a84a.tar.zst dexon-solidity-8bae2dba7c9697d129a43c1dde54690f3e37a84a.zip |
Introduce inContractKind helper on FunctionDefinition
Diffstat (limited to 'libsolidity/ast/AST.cpp')
-rw-r--r-- | libsolidity/ast/AST.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libsolidity/ast/AST.cpp b/libsolidity/ast/AST.cpp index 27220b1f..d8ad009d 100644 --- a/libsolidity/ast/AST.cpp +++ b/libsolidity/ast/AST.cpp @@ -290,6 +290,13 @@ TypeDeclarationAnnotation& EnumDefinition::annotation() const return dynamic_cast<TypeDeclarationAnnotation&>(*m_annotation); } +ContractDefinition::ContractKind FunctionDefinition::inContractKind() const +{ + auto contractDef = dynamic_cast<ContractDefinition const*>(scope()); + solAssert(contractDef, "Enclosing Scope of FunctionDefinition was not set."); + return contractDef->contractKind(); +} + shared_ptr<FunctionType> FunctionDefinition::functionType(bool _internal) const { if (_internal) |