aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity
diff options
context:
space:
mode:
Diffstat (limited to 'libsolidity')
-rw-r--r--libsolidity/analysis/TypeChecker.cpp9
-rw-r--r--libsolidity/interface/ErrorReporter.cpp10
-rw-r--r--libsolidity/interface/ErrorReporter.h6
3 files changed, 24 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.");
diff --git a/libsolidity/interface/ErrorReporter.cpp b/libsolidity/interface/ErrorReporter.cpp
index f9ef4ceb..e6171756 100644
--- a/libsolidity/interface/ErrorReporter.cpp
+++ b/libsolidity/interface/ErrorReporter.cpp
@@ -151,6 +151,16 @@ void ErrorReporter::syntaxError(SourceLocation const& _location, string const& _
);
}
+void ErrorReporter::typeError(SourceLocation const& _location, SecondarySourceLocation const& _secondaryLocation, string const& _description)
+{
+ error(
+ Error::Type::TypeError,
+ _location,
+ _secondaryLocation,
+ _description
+ );
+}
+
void ErrorReporter::typeError(SourceLocation const& _location, string const& _description)
{
error(
diff --git a/libsolidity/interface/ErrorReporter.h b/libsolidity/interface/ErrorReporter.h
index 8b066a3e..42b0c8b6 100644
--- a/libsolidity/interface/ErrorReporter.h
+++ b/libsolidity/interface/ErrorReporter.h
@@ -73,6 +73,12 @@ public:
void syntaxError(SourceLocation const& _location, std::string const& _description);
+ void typeError(
+ SourceLocation const& _location,
+ SecondarySourceLocation const& _secondaryLocation,
+ std::string const& _description
+ );
+
void typeError(SourceLocation const& _location, std::string const& _description);
void fatalTypeError(SourceLocation const& _location, std::string const& _description);