Skip to content

Commit b71cc44

Browse files
committed
Type checker: ignore LifetimeDependenceRequest in cycle diagnostic
When reporting the declarations that lead to a cycle, we end up printing an extra "through reference here" on the function declaration: class C2: C1, P { | |- note: through reference here | `- note: through reference here 15 | // expected-note@-1 2{{through reference here}} 16 | override func run(a: A) {} | | | `- note: while resolving type 'A' | | `- note: through reference here | |- error: circular reference | |- note: through reference here | `- note: through reference here
1 parent dbcba01 commit b71cc44

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/AST/Evaluator.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ void Evaluator::diagnoseCycle(const ActiveRequest &request) {
127127
for (const auto &step : llvm::reverse(activeRequests)) {
128128
if (step == request) return;
129129

130+
// Reporting the lifetime dependence location generates a redundant
131+
// diagnostic.
132+
if (step.getAs<LifetimeDependenceInfoRequest>()) {
133+
continue;
134+
}
135+
130136
step.noteCycleStep(diags);
131137
}
132138

0 commit comments

Comments
 (0)