Skip to content

Commit 7985ac0

Browse files
committed
Test: Added tests for accessing an associated type through a metatype
1 parent a3f9586 commit 7985ac0

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
@@ -18,3 +18,13 @@ var test1 = Test1a.self
1818
test1 = Test1b.self
1919
var x = Test1b()
2020
test1 = type(of: x)
21+
22+
// test associated type access through metatypes
23+
protocol P {
24+
typealias E = Int
25+
}
26+
27+
func foo(meta1: P.Protocol, meta2: P.Type) {
28+
print(meta1.E.self)
29+
print(meta2.E.self)
30+
}

0 commit comments

Comments
 (0)