Skip to content

Update for fileprivate #410

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

Closed
wants to merge 1 commit into from

Conversation

CodaFi
Copy link
Contributor

@CodaFi CodaFi commented Jun 13, 2016

Implements the access control changes needed for the Swift Package Manager to compile under swiftlang/swift#3000.

@ddunbar
Copy link
Contributor

ddunbar commented Jun 13, 2016

👏

@@ -268,19 +268,19 @@ private class LocalFS: FSProxy {
//
// FIXME: This class does not yet support concurrent mutation safely.
public class PseudoFS: FSProxy {
private class Node {
fileprivate class Node {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This surprises me, it is certainly the intent that this is private not fileprivate. What required this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember thinking that too. Probably a bogus diagnostic at one point. I'll change it

Copy link
Contributor Author

@CodaFi CodaFi Jun 13, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I remember now. The rule here is the inner scope can refer to private members in the outer scope but not vice-versa. PseudoFS is using Node's members quite a bit.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, this seems unfortunate for exactly this use case. Declaring it as fileprivate looks wrong... is it possible this indicates a problem in the proposal?

Copy link
Contributor Author

@CodaFi CodaFi Jun 13, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does seem wrong to use file to mean scope especially considering the name of the proposal itself, but it was the name the community settled on 😅

@anandabits
Copy link

anandabits commented Jun 16, 2016

private should work here exactly as you expect @ddunbar. The proposal is vaguely worded and that is causing confusion. @CodaFi started a thread on the mailing list https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160613/021141.html about this. Everyone who participated in the original discussion and review has the same interpretation of the intent of the proposal as @ddunbar. @DougGregor, as review manager can you please confirm the intended semantics of private so implementation can move forward.

@anandabits
Copy link

I would also like to add that the migration path provided by @CodaFi is the correct automated migration - fileprivate preserves the existing semantics precisely. Changing this to private takes advantage of the new semantics introduced by SE-0025.

It is probably reasonable to discuss whether this moves forward first as a semantic-preserving migration and then Swift PM does a review to tighten visibility, or whether that review should be part of the initial migration.

@ddunbar
Copy link
Contributor

ddunbar commented Jun 19, 2016

Thanks for the clarification @anandabits, that is a relief -- I do strongly prefer the interpretation you are espousing.

@CodaFi
Copy link
Contributor Author

CodaFi commented Jun 19, 2016

We need to not do this kind of clarification here. Let's get this in writing on SE-0025 before any of this goes through. This patch may need to be amended soon anyhow.

@ddunbar
Copy link
Contributor

ddunbar commented Jun 20, 2016

I was just referring to the reference to the thread... I can't keep up with all the lists so I appreciate pointers when useful. I agree official discussion/decisions needs to be on the list.

@ddunbar
Copy link
Contributor

ddunbar commented Jul 11, 2016

Closing per #476

@ddunbar ddunbar closed this Jul 11, 2016
@CodaFi CodaFi deleted the fileprivate-investigator branch July 11, 2016 19:51
aciidgh pushed a commit to aciidgh/swift-package-manager that referenced this pull request Jan 11, 2019
[BuildSystem] Handle relative paths in 'shell' makefile-style dependencies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants