Skip to content

Commit 9eb2062

Browse files
committed
[Sema] Fix getEffectiveOverloadType to recognize when base is opaque result type
Previously only nominal type and existential where allowed but that's outdated, it's possible to reference a member of an opaque result type as well, the concrete type in this case is going to be deduced by the solver.
1 parent fefbba0 commit 9eb2062

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Sema/TypeOfReference.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1906,7 +1906,8 @@ Type ConstraintSystem::getEffectiveOverloadType(ConstraintLocator *locator,
19061906
return Type();
19071907

19081908
baseTy = baseTy->getRValueType();
1909-
if (!baseTy->getAnyNominal() && !baseTy->is<ExistentialType>())
1909+
if (!baseTy->getAnyNominal() && !baseTy->is<ExistentialType>() &&
1910+
!baseTy->is<OpaqueTypeArchetypeType>())
19101911
return Type();
19111912
}
19121913

0 commit comments

Comments
 (0)