Skip to content

Commit 32b7017

Browse files
committed
[CodeCompletion] Ignore Sendable conformances
Sendable conformances are lazily synthesized as they are needed by the compiler. Depending on whether we checked whether a type conforms to Sendable before constructing the USRBasedType, we get different results for its conformance, causing assertion failures. For now, always ignore the Sendable conformance. We need to come up with a better solution for this problem in the future.
1 parent 94351a2 commit 32b7017

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/IDE/CodeCompletionResultType.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,14 @@ const USRBasedType *USRBasedType::fromType(Type Ty, USRBasedTypeArena &Arena) {
184184
// exist when using the code completion cache from a different module.
185185
continue;
186186
}
187+
if (Conformance->getProtocol()->isSpecificProtocol(KnownProtocolKind::Sendable)) {
188+
// FIXME: Sendable conformances are lazily synthesized as they are
189+
// needed by the compiler. Depending on whether we checked whether a
190+
// type conforms to Sendable before constructing the USRBasedType, we
191+
// get different results for its conformance. For now, always drop the
192+
// Sendable conformance.
193+
continue;
194+
}
187195
Supertypes.push_back(USRBasedType::fromType(
188196
Conformance->getProtocol()->getDeclaredInterfaceType(), Arena));
189197
}

0 commit comments

Comments
 (0)