Skip to content

Commit 4e49a44

Browse files
committed
[Type checker] Always record used conformances in the source file.
An early exit introduced in PR #10292 meant that we would only record a protocol conformance as "used" in the first file in which we saw a reference to the conformance. Make sure we record the conformance as used in each source file that needs it. Fixes rdar://problem/32978891 and rdar://problem/32980176. (cherry picked from commit 8246367) (cherry picked from commit c12e784)
1 parent 036f4ef commit 4e49a44

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/Sema/TypeCheckProtocol.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5523,9 +5523,9 @@ void TypeChecker::markConformanceUsed(ProtocolConformanceRef conformance,
55235523
auto normalConformance =
55245524
conformance.getConcrete()->getRootNormalConformance();
55255525

5526-
if (normalConformance->isComplete()) return;
5527-
5528-
UsedConformances.insert(normalConformance);
5526+
// Make sure that the type checker completes this conformance.
5527+
if (normalConformance->isIncomplete())
5528+
UsedConformances.insert(normalConformance);
55295529

55305530
// Record the usage of this conformance in the enclosing source
55315531
// file.

0 commit comments

Comments
 (0)