Merge pull request #10970 from ethereum/import-assert

Remove unreachable assertion for import resolution
This commit is contained in:
chriseth 2021-02-16 14:06:08 +01:00 committed by GitHub
commit 8de2686dd2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 11 deletions

View File

@ -76,16 +76,8 @@ bool NameAndTypeResolver::performImports(SourceUnit& _sourceUnit, map<string, So
if (auto imp = dynamic_cast<ImportDirective const*>(node.get()))
{
string const& path = *imp->annotation().absolutePath;
if (!_sourceUnits.count(path))
{
m_errorReporter.declarationError(
5073_error,
imp->location(),
"Import \"" + path + "\" (referenced as \"" + imp->path() + "\") not found."
);
error = true;
continue;
}
// The import resolution in CompilerStack enforces this.
solAssert(_sourceUnits.count(path), "");
auto scope = m_scopes.find(_sourceUnits.at(path));
solAssert(scope != end(m_scopes), "");
if (!imp->symbolAliases().empty())

View File

@ -223,7 +223,7 @@ def examine_id_coverage(top_dir, source_id_to_file_names, new_ids_only=False):
"1584", "1823",
"1988", "2066", "3356",
"3893", "3996", "4010", "4802",
"5073", "5272", "5622", "7128",
"5272", "5622", "7128",
"7589", "7593", "8065", "8084", "8140",
"8312", "8592", "9085", "9609",
}