We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 45a973b commit c402872Copy full SHA for c402872
test/stdlib/Casts.swift
@@ -167,8 +167,12 @@ CastsTests.test("Any.Protocol") {
167
class C {}
168
struct S {}
169
func isAnyProtocol<T>(_ type: T.Type) -> Bool {
170
- blackhole(T.self as! Any.Protocol)
171
- return T.self is Any.Protocol
+ let result = T.self is Any.Protocol
+ if result {
172
+ // `as!` should succeed if `is` does
173
+ blackhole(T.self as! Any.Protocol)
174
+ }
175
+ return result
176
}
177
func isAnyType<T>(_ type: T.Type) -> Bool {
178
return T.self is Any.Type
0 commit comments