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

Always desugar the base type of an extension when serializing. #6336

Merged

Conversation

jrose-apple
Copy link
Contributor

This "fixes" two issues:

  • The name of a non-public typealias would leak into the public interface if the extension had any public members.

  • A common pattern of defining a platform-specific typealias for an imported class and then extending that type would lead to circularity when trying to deserialize the typealias. We shouldn't be loading the extension at that point, but fixing that would be much harder.

The "right" answer is to (a) check that the typealias is public if the extension has any public members, and (b) somehow ensure there is no circularity issue (either by not importing the extension as a result of importing the typealias, or by the extension being able to set its sugared base type later).

rdar://problem/29694978

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@jrose-apple
Copy link
Contributor Author

Filed SR-3443 for follow-up on this some day, mostly just to have a place to dup issues to (since it's a sort of regression).

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Collaborator

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - b402ec89beae21b555857e5042112dac71b9c0a6
Test requested by - @jrose-apple

@jrose-apple
Copy link
Contributor Author

Timeout?

@swift-ci Please test Linux

@jrose-apple
Copy link
Contributor Author

jrose-apple commented Dec 19, 2016

@shahmishal Linux builders can't seem to fetch from GitHub? https://ci.swift.org/job/swift-PR-Linux/4775/

@swift-ci
Copy link
Collaborator

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - b402ec89beae21b555857e5042112dac71b9c0a6
Test requested by - @jrose-apple

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test Linux

@swift-ci
Copy link
Collaborator

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - b402ec89beae21b555857e5042112dac71b9c0a6
Test requested by - @jrose-apple

This "fixes" two issues:

- The name of a non-public typealias would leak into the public
  interface if the extension had any public members.

- A common pattern of defining a platform-specific typealias for an
  imported class and then extending that type would lead to
  circularity when trying to deserialize the typealias. We /shouldn't/
  be loading the extension at that point, but fixing that would be
  much harder.

The "right" answer is to (a) check that the typealias is public if the
extension has any public members, and (b) somehow ensure there is no
circularity issue (either by not importing the extension as a result
of importing the typealias, or by the extension being able to set its
sugared base type later).

rdar://problem/29694978
@jrose-apple jrose-apple force-pushed the canonicalize-extension-base-types branch from b402ec8 to 7c633f7 Compare December 19, 2016 21:54
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test Linux

@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test macOS

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test Linux

@jrose-apple jrose-apple merged commit 97b0644 into apple:master Dec 20, 2016
@jrose-apple jrose-apple deleted the canonicalize-extension-base-types branch December 20, 2016 00:44
jrose-apple added a commit to jrose-apple/swift that referenced this pull request Dec 20, 2016
…#6336)

This "fixes" two issues:

- The name of a non-public typealias would leak into the public
  interface if the extension had any public members.

- A common pattern of defining a platform-specific typealias for an
  imported class and then extending that type would lead to
  circularity when trying to deserialize the typealias. We /shouldn't/
  be loading the extension at that point, but fixing that would be
  much harder.

The "right" answer is to (a) check that the typealias is public if the
extension has any public members, and (b) somehow ensure there is no
circularity issue (either by not importing the extension as a result
of importing the typealias, or by the extension being able to set its
sugared base type later).

rdar://problem/29694978
@shahmishal
Copy link
Member

@shahmishal Linux builders can't seem to fetch from GitHub? https://ci.swift.org/job/swift-PR-Linux/4775/

This sounds like network issue on Github servers.

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.

None yet

3 participants