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

[SR-15154] ObjC projects using SPM fail when we expose our models into another module #57480

Open
swift-ci opened this issue Sep 4, 2021 · 2 comments
Labels

Comments

@swift-ci
Copy link
Collaborator

@swift-ci swift-ci commented Sep 4, 2021

Previous ID SR-15154
Radar rdar://problem/82827693
Original Reporter taquitos (JIRA User)
Type Bug

Attachment: Download

Additional Detail from JIRA
Votes 3
Component/s
Labels Bug
Assignee None
Priority Medium

md5: 4659038e109b6bed99ec521e272addf0

Issue Description:

Setup:
We create an ObjC App that uses our SPM package "RevenueCat".
In our app, we create an object that uses an object from the "RevenueCat" package as part of its api.

We expose this object's header (which exposes the method containing the RevenueCat object as a parameter) as a public header.

We create a Swift test target that depends on the ObjC App and has a bridging header for that object we created.

We attempt to use the API in a test. API that doesn't include RevenueCat objects is fine, but any API that uses RevenueCat objects in the parameter is not found.

Environment:
Xcode 12.5.1 (Build version 12E507) & Xcode 13 Beta 5

M1 Mac as well as Intel mac.

Swift Package Manager - Swift 5.4.0

Swift Package Manager - Swift 5.5.0

Component: Package Manager

Reproduction project: https://github.com/taquitos/SPMBug

Attempt to build the test target.

You'll get
`Value of type 'TaquitosAreTheBest' has no member 'purchaserInfo'`

@typesanitizer
Copy link

@typesanitizer typesanitizer commented Sep 7, 2021

@swift-ci create

@ryanwilson
Copy link

@ryanwilson ryanwilson commented Jan 21, 2022

We ran into a similar issue, I believe a workaround is to import the header instead of using a forward declaration. I know it's not the best practice for Obj-C but makes it usable at least.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants