Fix a couple of invalid location diagnostics

This commit is contained in:
Hamish Knight
2020-03-10 21:55:36 -07:00
parent f3708b29ec
commit e5952ab7fe
2 changed files with 4 additions and 8 deletions

View File

@@ -1031,9 +1031,8 @@ checkOperatorConflicts(const SourceFile &SF, SourceLoc loc,
if (loc.isValid()) { if (loc.isValid()) {
ASTContext &C = SF.getASTContext(); ASTContext &C = SF.getASTContext();
C.Diags.diagnose(loc, diag::ambiguous_operator_decls); C.Diags.diagnose(loc, diag::ambiguous_operator_decls);
C.Diags.diagnose(start->first->getLoc(), start->first->diagnose(diag::found_this_operator_decl);
diag::found_this_operator_decl); i->first->diagnose(diag::found_this_operator_decl);
C.Diags.diagnose(i->first->getLoc(), diag::found_this_operator_decl);
} }
return end; return end;
} }
@@ -1053,8 +1052,7 @@ checkOperatorConflicts(const SourceFile &SF, SourceLoc loc,
ASTContext &C = SF.getASTContext(); ASTContext &C = SF.getASTContext();
C.Diags.diagnose(loc, diag::ambiguous_precedence_groups); C.Diags.diagnose(loc, diag::ambiguous_precedence_groups);
for (auto &entry : importedGroups) { for (auto &entry : importedGroups) {
C.Diags.diagnose(entry.first->getLoc(), entry.first->diagnose(diag::found_this_precedence_group);
diag::found_this_precedence_group);
} }
} }
return importedGroups.end(); return importedGroups.end();

View File

@@ -5,9 +5,7 @@
// RUN: %target-swift-frontend -emit-module %S/Inputs/lookup_moduleB.swift -module-name B -o %t -I %t // RUN: %target-swift-frontend -emit-module %S/Inputs/lookup_moduleB.swift -module-name B -o %t -I %t
// RUN: %target-swift-frontend -emit-module %S/Inputs/lookup_moduleA.swift -module-name A -o %t -I %t // RUN: %target-swift-frontend -emit-module %S/Inputs/lookup_moduleA.swift -module-name A -o %t -I %t
// RUN: %target-swift-frontend -emit-module %S/Inputs/lookup_module_exportsAC.swift -module-name ExportsAC -o %t -I %t // RUN: %target-swift-frontend -emit-module %S/Inputs/lookup_module_exportsAC.swift -module-name ExportsAC -o %t -I %t
// RUN: %target-swift-frontend -typecheck -verify -primary-file %s %S/Inputs/lookup_other.swift %S/Inputs/lookup_other2.swift %S/Inputs/lookup_other_compat.swift -I %t
// FIXME: Remove -verify-ignore-unknown.
// RUN: %target-swift-frontend -typecheck -verify -verify-ignore-unknown -primary-file %s %S/Inputs/lookup_other.swift %S/Inputs/lookup_other2.swift %S/Inputs/lookup_other_compat.swift -I %t
import ExportsAC import ExportsAC
import B import B