Skip to content

Commit 8624e9a

Browse files
authored
Merge pull request #68508 from tshortli/conformance-lookup-circularity
AST: Revert inherited type request in ConformanceLookupTable
2 parents 60774fb + eb4a93d commit 8624e9a

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

lib/AST/ConformanceLookupTable.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,7 @@ void ConformanceLookupTable::inheritConformances(ClassDecl *classDecl,
228228

229229
auto inheritedTypes = classDecl->getInherited();
230230
for (unsigned i : inheritedTypes.getIndices()) {
231-
if (auto inheritedType = inheritedTypes.getResolvedType(i)) {
232-
231+
if (auto inheritedType = inheritedTypes.getEntry(i).getType()) {
233232
if (inheritedType->getClassOrBoundGenericClass()) {
234233
superclassLoc = inheritedTypes.getEntry(i).getSourceRange().Start;
235234
return superclassLoc;

test/Generics/rdar115314044.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// RUN: %target-typecheck-verify-swift
2+
3+
public protocol P {}
4+
5+
public protocol Q {
6+
associatedtype A: P
7+
func f(_: A)
8+
}
9+
10+
open class Parent<C: P>: Q {
11+
public func f(_: C) {}
12+
}
13+
14+
final class Child: Parent<Child.Nested> {
15+
struct Nested: P {}
16+
}

0 commit comments

Comments
 (0)