Skip to content

[4.1] Revert removal of some extensions on ImplicitlyUnwrappedOptional<T> #13976

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

Merged
merged 1 commit into from
Jan 17, 2018
Merged

[4.1] Revert removal of some extensions on ImplicitlyUnwrappedOptional<T> #13976

merged 1 commit into from
Jan 17, 2018

Conversation

rudkx
Copy link
Contributor

@rudkx rudkx commented Jan 16, 2018

It breaks bridging to Objective C.

@rudkx rudkx requested a review from DougGregor January 16, 2018 23:10
@rudkx
Copy link
Contributor Author

rudkx commented Jan 16, 2018

@swift-ci Please smoke test

@rudkx
Copy link
Contributor Author

rudkx commented Jan 16, 2018

@swift-ci Please test

@rudkx
Copy link
Contributor Author

rudkx commented Jan 16, 2018

@swift-ci Please test source compatibility

@slavapestov
Copy link
Contributor

Why does it break bridging?

@rudkx
Copy link
Contributor Author

rudkx commented Jan 17, 2018

@slavapestov Because the change removed the conformance to _ObjectiveCBridgeable.

@rudkx
Copy link
Contributor Author

rudkx commented Jan 17, 2018

Linux failure is unrelated to my changes:

clang-5.0: error: unable to execute command: Bus error (core dumped)
clang-5.0: error: linker command failed due to signal (use -v to see invocation)
<unknown>:0: error: link command failed with exit code 254 (use -v to see invocation)

@rudkx
Copy link
Contributor Author

rudkx commented Jan 17, 2018

@swift-ci Please smoke test Linux platform

@rudkx
Copy link
Contributor Author

rudkx commented Jan 17, 2018

The SIL parsing failure looks like a result of #12430.

@rudkx
Copy link
Contributor Author

rudkx commented Jan 17, 2018

@swift-ci Please test source compatibility

@@ -49,3 +49,73 @@ public enum ImplicitlyUnwrappedOptional<Wrapped> : ExpressibleByNilLiteral {
self = .none
}
}

extension ImplicitlyUnwrappedOptional : CustomStringConvertible {
Copy link
Member

Choose a reason for hiding this comment

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

Should we leave this one "removed"? It's not needed to fix the regression at hand.

/// _isOptional thus cannot distinguish ImplicitlyUnwrappedOptional
/// from Optional. When conditional conformance is available, this
/// outright conformance can be removed.
extension ImplicitlyUnwrappedOptional : CustomDebugStringConvertible {
Copy link
Member

Choose a reason for hiding this comment

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

Should we leave this one "removed"? It's not needed to fix the regression at hand.

// methods, we're fine, but in https://github.com/apple/swift/pull/13976
// I am reintroducing extensions because removing them broke things
// (bridging to ObjectiveC, for one).
// REQUIRES: disabled
Copy link
Member

Choose a reason for hiding this comment

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

If we remove the two extensions I flagged above, we could leave this test enabled for Linux.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, true. I'll look at that. I was just hoping to revert and move forward, but if we're confident we won't hit other issues from these others being removed then we should do that.

…eCBridgeable.

Partial revert of 26f6a75.

Removing this breaks bridging these values to Objective C. Once IUOs
are removed from the type system and ImplicitlyUnwrappedOptional<T> is
removed from the library, we'll be strictly using Optional<T> which
has this conformance as well.
@rudkx
Copy link
Contributor Author

rudkx commented Jan 17, 2018

@swift-ci Please test

@rudkx
Copy link
Contributor Author

rudkx commented Jan 17, 2018

@swift-ci Please test source compatibility

@rudkx
Copy link
Contributor Author

rudkx commented Jan 17, 2018

The source compat failure was a result of a problem cloning from GitHub:

error: failed to clone; Cloning into bare repository '/Users/buildnode/jenkins/workspace-private/swift-PR-source-compat-suite/project_cache/R.swift/.build/repositories/Commander.git-8842944228949165507'...
fatal: unable to access 'https://github.com/kylef/Commander.git/': Could not resolve host: github.com

@swiftlang swiftlang deleted a comment from swift-ci Jan 17, 2018
@swiftlang swiftlang deleted a comment from swift-ci Jan 17, 2018
@swiftlang swiftlang deleted a comment from swift-ci Jan 17, 2018
@swiftlang swiftlang deleted a comment from swift-ci Jan 17, 2018
@swiftlang swiftlang deleted a comment from swift-ci Jan 17, 2018
@swiftlang swiftlang deleted a comment from swift-ci Jan 17, 2018
@rudkx
Copy link
Contributor Author

rudkx commented Jan 17, 2018

@swift-ci Please test source compatibility

@AnnaZaks AnnaZaks merged commit a3a8c6b into swiftlang:swift-4.1-branch Jan 17, 2018
@rudkx rudkx deleted the revert-IUO-extension-removal branch January 17, 2018 19:25
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.

4 participants