Skip to content

Commit 5665378

Browse files
authored
Merge pull request #11627 from ethereum/allowEmptyFileName
Include locations with empty source name.
2 parents ce11ebb + 6ba298c commit 5665378

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Bugfixes:
1414
* Code Generator: Fix crash when passing an empty string literal to ``bytes.concat()``.
1515
* Code Generator: Fix internal compiler error when calling functions bound to calldata structs and arrays.
1616
* Code Generator: Fix internal compiler error when passing a 32-byte hex literal or a zero literal to ``bytes.concat()`` by disallowing such literals.
17+
* Standard JSON: Include source location for errors in files with empty name.
1718
* Type Checker: Fix internal error and prevent static calls to unimplemented modifiers.
1819
* Yul Code Generator: Fix internal compiler error when using a long literal with bitwise negation.
1920
* Yul Code Generator: Fix source location references for calls to builtin functions.

libsolidity/interface/StandardCompiler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Json::Value formatFatalError(string const& _type, string const& _message)
8383
Json::Value formatSourceLocation(SourceLocation const* location)
8484
{
8585
Json::Value sourceLocation;
86-
if (location && location->source && !location->source->name().empty())
86+
if (location && location->source)
8787
{
8888
sourceLocation["file"] = location->source->name();
8989
sourceLocation["start"] = location->start;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{"errors":[{"component":"general","errorCode":"2904","formattedMessage":"DeclarationError: Declaration \"A\" not found in \"\" (referenced as \".\").
22

3-
","message":"Declaration \"A\" not found in \"\" (referenced as \".\").","severity":"error","type":"DeclarationError"}],"sources":{"":{"id":0}}}
3+
","message":"Declaration \"A\" not found in \"\" (referenced as \".\").","severity":"error","sourceLocation":{"end":79,"file":"","start":59},"type":"DeclarationError"}],"sources":{"":{"id":0}}}

0 commit comments

Comments
 (0)