Skip to content

Commit eb0b2bb

Browse files
[tests] Adding regression tests for SR-12946
1 parent 99e72b6 commit eb0b2bb

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

test/expr/cast/metatype_casts.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,10 @@ use(C.self as P.Type) // expected-error{{cannot convert value of type 'C.Type' t
4949

5050
use(E.self as P.Protocol) // expected-error{{cannot convert value of type 'E.Type' to type 'P.Protocol' in coercion}}
5151
use(E.self as P.Type)
52+
53+
// SR-12946
54+
func SR12946<T>(_ e: T) {
55+
_ = AnyObject.self is T.Type // OK
56+
}
57+
58+
SR12946(1 as AnyObject)

0 commit comments

Comments
 (0)