We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7009207 commit 49cc219Copy full SHA for 49cc219
lib/Sema/CSBindings.cpp
@@ -1000,6 +1000,13 @@ PotentialBindings::inferFromRelational(Constraint *constraint) {
1000
if (!BGT || !isKnownKeyPathDecl(CS.getASTContext(), BGT->getDecl()))
1001
return None;
1002
}
1003
+
1004
+ // Don't allow a protocol type to get propagated from the base to the result
1005
+ // type of a chain, Result should always be a concrete type which conforms
1006
+ // to the protocol inferred for the base.
1007
+ if (locator->isLastElement<LocatorPathElt::UnresolvedMemberChainResult>() &&
1008
+ kind == AllowedBindingKind::Supertypes && type->is<ProtocolType>())
1009
+ return None;
1010
1011
1012
// If the source of the binding is 'OptionalObject' constraint
0 commit comments