diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-08-02 18:26:43 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-08-04 21:03:37 +0800 |
commit | 494dea262e7d671ccd0f98b2df1c99fd86097adc (patch) | |
tree | d577fba5edef77ad2225ba456a090241dca02760 /libsolidity/analysis | |
parent | c835bcec623d6b6166add70456f5b6bee5c90572 (diff) | |
download | dexon-solidity-494dea262e7d671ccd0f98b2df1c99fd86097adc.tar.gz dexon-solidity-494dea262e7d671ccd0f98b2df1c99fd86097adc.tar.zst dexon-solidity-494dea262e7d671ccd0f98b2df1c99fd86097adc.zip |
Show unimplemented function if trying to instantiate an abstract class
Diffstat (limited to 'libsolidity/analysis')
-rw-r--r-- | libsolidity/analysis/TypeChecker.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index fab410eb..cc2f95ef 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -1523,7 +1523,14 @@ void TypeChecker::endVisit(NewExpression const& _newExpression) if (!contract) m_errorReporter.fatalTypeError(_newExpression.location(), "Identifier is not a contract."); if (!contract->annotation().unimplementedFunctions.empty()) - m_errorReporter.typeError(_newExpression.location(), "Trying to create an instance of an abstract contract."); + m_errorReporter.typeError( + _newExpression.location(), + SecondarySourceLocation().append( + "Missing implementation:", + contract->annotation().unimplementedFunctions.front()->location() + ), + "Trying to create an instance of an abstract contract." + ); if (!contract->constructorIsPublic()) m_errorReporter.typeError(_newExpression.location(), "Contract with internal constructor cannot be created directly."); |