Skip to content
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

Unable to forward declare Swift types from SPM package using ImportObjcForwardDeclarations #78610

Open
andrewjmeier opened this issue Jan 13, 2025 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels

Comments

@andrewjmeier
Copy link

Description

I have a local swift package that I'm importing into my main app target. In the app target, I'm forward declaring a protocol from the package in order to create a property in an objective c header file. I can import the module in the .m file just fine and use the type as I'd expect. However, I have a swift file that extends this class that isn't able to access this property.

My understanding is ImportObjcForwardDeclarations is supposed to address this problem. I've tried passing the feature flag for Swift 5, or just using Swift 6 where I believe the feature is on by default.

I've reproduced in the sample project attached below.

Reproduction

ObjcForwardTest.zip

Expected behavior

In my sample project, I expect to be able to access all of the properties in the view controller's header file in the swift extension of that view controller.

Environment

Sample project is using Swift 6, I'm seeing the same issue with Swift 5 + feature flag.

Additional information

No response

@andrewjmeier andrewjmeier added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels labels Jan 13, 2025
@a-pride
Copy link

a-pride commented Jan 13, 2025

+1 can reproduce and confirm experiencing the same

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

2 participants