Skip to content

Commit 6add8f2

Browse files
committed
[CSSimplify] Fix transitive conformance check to use Optional<T> on if resolved type is not optional
1 parent 439cbaf commit 6add8f2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6268,9 +6268,9 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyTransitivelyConformsTo(
62686268

62696269
SmallVector<Type, 4> typesToCheck;
62706270

6271-
// Optional<T>
6272-
typesToCheck.push_back(
6273-
OptionalType::get(resolvedTy->getWithoutSpecifierType()));
6271+
// T -> Optional<T>
6272+
if (!resolvedTy->getOptionalObjectType())
6273+
typesToCheck.push_back(OptionalType::get(resolvedTy));
62746274

62756275
// AnyHashable
62766276
if (auto *anyHashable = ctx.getAnyHashableDecl())

0 commit comments

Comments
 (0)