Skip to content

Embedded Swift emits unimplemented protocol conformance checks #81503

Open
@TeamPuzel

Description

@TeamPuzel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.embeddedEmbedded Swift

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions