diff --git a/Changelog.md b/Changelog.md index 9981ea25f..10c32d884 100644 --- a/Changelog.md +++ b/Changelog.md @@ -8,6 +8,7 @@ Compiler Features: Bugfixes: * isoltest: Added new keyword `wei` to express function value in semantic tests + * Standard-JSON-Interface: Fix a bug related to empty filenames and imports. ### 0.6.3 (2020-02-18) diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index 89ab13818..6cf044c1c 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -1005,7 +1005,6 @@ void CompilerStack::resolveImports() if (ImportDirective const* import = dynamic_cast(node.get())) { string const& path = import->annotation().absolutePath; - solAssert(!path.empty(), ""); solAssert(m_sources.count(path), ""); import->annotation().sourceUnit = m_sources[path].ast.get(); toposort(&m_sources[path]); diff --git a/test/cmdlineTests/standard_empty_file_name/exit b/test/cmdlineTests/standard_empty_file_name/exit new file mode 100644 index 000000000..573541ac9 --- /dev/null +++ b/test/cmdlineTests/standard_empty_file_name/exit @@ -0,0 +1 @@ +0 diff --git a/test/cmdlineTests/standard_empty_file_name/input.json b/test/cmdlineTests/standard_empty_file_name/input.json new file mode 100644 index 000000000..95c2cdd30 --- /dev/null +++ b/test/cmdlineTests/standard_empty_file_name/input.json @@ -0,0 +1,10 @@ +{ + "language": "Solidity", + "sources": + { + "": + { + "content": "pragma solidity >=0.0; import {A} from \".\";" + } + } +} diff --git a/test/cmdlineTests/standard_empty_file_name/output.json b/test/cmdlineTests/standard_empty_file_name/output.json new file mode 100644 index 000000000..b31ceb152 --- /dev/null +++ b/test/cmdlineTests/standard_empty_file_name/output.json @@ -0,0 +1,4 @@ +{"errors":[{"component":"general","formattedMessage":":1:24: DeclarationError: Declaration \"A\" not found in \"\" (referenced as \".\"). +pragma solidity >=0.0; import {A} from \".\"; + ^------------------^ +","message":"Declaration \"A\" not found in \"\" (referenced as \".\").","severity":"error","type":"DeclarationError"}],"sources":{}}