Open
Description
Description
Dynamic protocol checks are emitted for class bound protocols in embedded mode despite the runtime not implementing them.
Reproduction
protocol P: AnyObject {}
class A {}
func foo(a: A) -> Bool { a is P } // This emits a call to swift_conformsToProtocol
func foo(a: A) { if let p = a as? P {} } // This does as well
Expected behavior
This should either work or raise a compile error instead of failing later in the compilation process
Environment
Apple Swift version 6.2-dev (LLVM 81ab6d9f7e4810f, Swift 9cc1947)
Target: arm64-apple-macosx15.0
Build config: +assertions
Additional information
No response