Remove unreachable assertion for import resolution

This commit is contained in:
Alex Beregszaszi 2021-02-16 12:30:12 +00:00
parent 7ac440f35b
commit efe3199981
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())) if (auto imp = dynamic_cast<ImportDirective const*>(node.get()))
{ {
string const& path = *imp->annotation().absolutePath; string const& path = *imp->annotation().absolutePath;
if (!_sourceUnits.count(path)) // The import resolution in CompilerStack enforces this.
{ solAssert(_sourceUnits.count(path), "");
m_errorReporter.declarationError(
5073_error,
imp->location(),
"Import \"" + path + "\" (referenced as \"" + imp->path() + "\") not found."
);
error = true;
continue;
}
auto scope = m_scopes.find(_sourceUnits.at(path)); auto scope = m_scopes.find(_sourceUnits.at(path));
solAssert(scope != end(m_scopes), ""); solAssert(scope != end(m_scopes), "");
if (!imp->symbolAliases().empty()) 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", "1584", "1823",
"1988", "2066", "3356", "1988", "2066", "3356",
"3893", "3996", "4010", "4802", "3893", "3996", "4010", "4802",
"5073", "5272", "5622", "7128", "5272", "5622", "7128",
"7589", "7593", "8065", "8084", "8140", "7589", "7593", "8065", "8084", "8140",
"8312", "8592", "9085", "9609", "8312", "8592", "9085", "9609",
} }