Skip to content

Commit aaf7f23

Browse files
committed
Test: Added an example with access to a concrete associated type through Self.
1 parent dc27e46 commit aaf7f23

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/type/metatype/metatypes.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,14 @@ protocol P {
2727
func foo(meta1: P.Protocol, meta2: P.Type) {
2828
print(meta1.E.self)
2929
print(meta2.E.self)
30+
}
31+
32+
protocol P2 {
33+
typealias E = Self
34+
typealias F = Int
35+
}
36+
37+
func foo(meta1: P.Protocol, meta2: P.Type) {
38+
print(meta1.E.F.self)
39+
print(meta2.E.F.self)
3040
}

0 commit comments

Comments
 (0)