Skip to content

Commit 95e2802

Browse files
committed
Sema: Test inheritance clause references to nested type of class-constrained archetype
This hits the FIXME case in CompleteGenericTypeResolver's resolveDependentMemberType() method I thought was dead, but it's actually not.
1 parent 54883e8 commit 95e2802

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/Generics/superclass_constraint.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,3 +136,19 @@ func superclassConformance4<T: P3, U: P3>(_: T, _: U)
136136
where T.T: C, // expected-note{{superclass constraint 'T.T' : 'C' written here}}
137137
U.T: C, // expected-warning{{redundant superclass constraint 'U.T' : 'C'}}
138138
T.T == U.T { }
139+
140+
// Lookup of superclass associated types from inheritance clause
141+
142+
protocol Elementary {
143+
associatedtype Element
144+
145+
func get() -> Element
146+
}
147+
148+
class Classical : Elementary {
149+
func get() -> Int {
150+
return 0
151+
}
152+
}
153+
154+
func genericFunc<T : Elementary, U : Classical>(_: T, _: U) where T.Element == U.Element {}

0 commit comments

Comments
 (0)