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-11613] Implementation only import doesn't allow having a private property with type from the imported module in a class #54021

Open
ankitspd opened this issue Oct 14, 2019 · 3 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@ankitspd
Copy link
Member

Previous ID SR-11613
Radar rdar://problem/56261311
Original Reporter @aciidb0mb3r
Type Bug

Attachment: Download

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

md5: 8d7017d5ec3d5362d14281bfd1b1850b

Issue Description:

In the attached package, I have this:

@_implementationOnly import core

public class Hello {
    private let something: Something

    public init() {
        something = Something()
    }
}

This should work in theory because `something` is not publicly exposed but I get an error: `error: cannot use struct 'Something' here; 'core' has been imported as implementation-only`

@belkadan
Copy link
Contributor

I'm not 100% sure it should work; 'something' is publicly exposed in that it's part of the layout computations for Hello. It's possible the example in apple/swift-package-manager#2379 should also be banned, but that violates local reasoning.

@belkadan
Copy link
Contributor

Regardless we have to do something. cc @xymus

@swift-ci create

@keith
Copy link
Collaborator

keith commented Jan 15, 2020

Just found this one but I filed https://bugs.swift.org/browse/SR-11910

@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
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

3 participants