Skip to content

Embedded Swift emits unimplemented protocol conformance checks #81503

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
TeamPuzel opened this issue May 14, 2025 · 0 comments
Open

Embedded Swift emits unimplemented protocol conformance checks #81503

TeamPuzel opened this issue May 14, 2025 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels

Comments

@TeamPuzel
Copy link

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

@TeamPuzel TeamPuzel added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels labels May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels
Projects
None yet
Development

No branches or pull requests

1 participant