mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Record protocol conformance when we start checking, rather than at the end.
As part of this, take away the poor attempt at recovering by adding an explicit protocol conformance. The recovery mode isn't all that useful in a system with only explicit conformance, and it messes with diagnostics further down the line. We can bring it back later once we're happy with explicit conformance checking. Swift SVN r11503
This commit is contained in:
@@ -830,7 +830,8 @@ ConstraintSystem::getTypeOfMemberReference(Type baseTy, ValueDecl *value,
|
||||
|
||||
auto proto = cast<ProtocolDecl>(assocType->getDeclContext());
|
||||
ProtocolConformance *conformance = nullptr;
|
||||
if (TC.conformsToProtocol(baseObjTy, proto, DC, &conformance)) {
|
||||
if (TC.conformsToProtocol(baseObjTy, proto, DC, &conformance) &&
|
||||
conformance->isComplete()) {
|
||||
auto memberTy = conformance->getTypeWitness(assocType, &TC).Replacement;
|
||||
if (!isTypeReference)
|
||||
memberTy = MetatypeType::get(memberTy, TC.Context);
|
||||
@@ -941,7 +942,8 @@ ConstraintSystem::getTypeOfMemberReference(Type baseTy, ValueDecl *value,
|
||||
!baseObjTy->is<ArchetypeType>() &&
|
||||
!baseObjTy->hasTypeVariable()) {
|
||||
ProtocolConformance *conformance = nullptr;
|
||||
if (TC.conformsToProtocol(baseObjTy, proto, DC, &conformance)) {
|
||||
if (TC.conformsToProtocol(baseObjTy, proto, DC, &conformance) &&
|
||||
conformance->isComplete()) {
|
||||
type = conformance->getTypeWitness(assocType, &TC).Replacement;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user