diff options
Allow different entry scope for registerDeclarations.
Diffstat (limited to 'libsolidity/analysis/TypeChecker.cpp')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index be59d3d2..06a9e1ce 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -427,7 +427,12 @@ bool TypeChecker::visit(StructDefinition const& _struct) bool TypeChecker::visit(FunctionDefinition const& _function) { - bool isLibraryFunction = dynamic_cast<ContractDefinition const&>(*_function.scope()).isLibrary(); + bool isLibraryFunction = false; + if ( + dynamic_cast<ContractDefinition const*>(_function.scope()) && + dynamic_cast<ContractDefinition const*>(_function.scope())->isLibrary() + ) + isLibraryFunction = true; if (_function.isPayable()) { if (isLibraryFunction) |