From 18072586c975e75dcc39e9f6c50a0c9100ee729e Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 8 Jul 2019 14:28:22 +0200 Subject: [PATCH 1/2] Remove trailing whitespace in error message. --- libsolidity/analysis/ContractLevelChecker.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libsolidity/analysis/ContractLevelChecker.cpp b/libsolidity/analysis/ContractLevelChecker.cpp index 38c62da7e..95626bb2a 100644 --- a/libsolidity/analysis/ContractLevelChecker.cpp +++ b/libsolidity/analysis/ContractLevelChecker.cpp @@ -345,8 +345,8 @@ void ContractLevelChecker::annotateBaseConstructorArguments( else { mainLocation = &_currentContract.location(); - ssl.append("First constructor call is here: ", _argumentNode->location()); - ssl.append("Second constructor call is here: ", previousNode->location()); + ssl.append("First constructor call is here:", _argumentNode->location()); + ssl.append("Second constructor call is here:", previousNode->location()); } m_errorReporter.declarationError( From 2700cb0b43559427b548ea4cd6843d8bec587f1b Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 8 Jul 2019 14:27:32 +0200 Subject: [PATCH 2/2] Fix commandline tests. --- .../standard_secondary_source_location/output.json | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/cmdlineTests/standard_secondary_source_location/output.json b/test/cmdlineTests/standard_secondary_source_location/output.json index f765579cc..0330135e2 100644 --- a/test/cmdlineTests/standard_secondary_source_location/output.json +++ b/test/cmdlineTests/standard_secondary_source_location/output.json @@ -1 +1,10 @@ -{"errors":[{"component":"general","formattedMessage":"A:1:112: DeclarationError: Base constructor arguments given twice.\npragma solidity >=0.0; contract A { constructor(uint) public {} } contract B is A(2) { } contract C is A(3) {} contract D is B, C {}\n ^-------------------^\nA:1:81: First constructor call is here: \npragma solidity >=0.0; contract A { constructor(uint) public {} } contract B is A(2) { } contract C is A(3) {} contract D is B, C {}\n ^--^\nA:1:104: Second constructor call is here: \npragma solidity >=0.0; contract A { constructor(uint) public {} } contract B is A(2) { } contract C is A(3) {} contract D is B, C {}\n ^--^\n","message":"Base constructor arguments given twice.","secondarySourceLocations":[{"end":84,"file":"A","message":"First constructor call is here: ","start":80},{"end":107,"file":"A","message":"Second constructor call is here: ","start":103}],"severity":"error","sourceLocation":{"end":132,"file":"A","start":111},"type":"DeclarationError"}],"sources":{}} +{"errors":[{"component":"general","formattedMessage":"A:1:112: DeclarationError: Base constructor arguments given twice. +pragma solidity >=0.0; contract A { constructor(uint) public {} } contract B is A(2) { } contract C is A(3) {} contract D is B, C {} + ^-------------------^ +A:1:81: First constructor call is here: +pragma solidity >=0.0; contract A { constructor(uint) public {} } contract B is A(2) { } contract C is A(3) {} contract D is B, C {} + ^--^ +A:1:104: Second constructor call is here: +pragma solidity >=0.0; contract A { constructor(uint) public {} } contract B is A(2) { } contract C is A(3) {} contract D is B, C {} + ^--^ +","message":"Base constructor arguments given twice.","secondarySourceLocations":[{"end":84,"file":"A","message":"First constructor call is here:","start":80},{"end":107,"file":"A","message":"Second constructor call is here:","start":103}],"severity":"error","sourceLocation":{"end":132,"file":"A","start":111},"type":"DeclarationError"}],"sources":{}}