Skip to content

[stdlib] Replace various uses of BlahSlice with Slice to reduce warnings #13263

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 3 commits into from
Dec 6, 2017

Conversation

airspeedswift
Copy link
Member

Now that Slice is conditionally conforming to protocols based on its base, various uses of specific slices can be replaced, suppressing deprecation warnings.

Note, the validation tests generated by validation-test/stdlib/Slice/Inputs/Template.swift.gyb are still using the old slice types. That needs a bit more work to fix.

@airspeedswift
Copy link
Member Author

@swift-ci please test

@airspeedswift airspeedswift requested a review from moiseev December 5, 2017 00:46
@@ -701,10 +701,10 @@ public struct ${Self}<T> : ${SelfProtocols} {
% end
}

public subscript(bounds: Range<${Index}>) -> ${SelfSlice}<${Self}<T>> {
public subscript(bounds: Range<${Index}>) -> Slice<${Self}<T>> {
Copy link
Contributor

Choose a reason for hiding this comment

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

You can remove the definition of SelfSlice too right?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's still used within the gyb. These tests create Minimal${SelfSlice} opaque types for some tests.

I did miss some more ${SelfSlice} uses tho.

Copy link
Member Author

Choose a reason for hiding this comment

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

No wait that is a different test. These ones just reuse SelfSlice to create MinimalCollection names. But still, they need something like it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I felt guilty after this so have fixed it properly now...

@airspeedswift
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Dec 5, 2017

Build failed
Swift Test Linux Platform
Git Sha - bbdfc9b5fde26aa9c55fc04aee8cdc171def413d

@airspeedswift
Copy link
Member Author

gah there are tests inside validation-test/StlibUnittest/ too what are they doing in there

@airspeedswift
Copy link
Member Author

@swift-ci please test

@swift-ci
Copy link
Contributor

swift-ci commented Dec 5, 2017

Build failed
Swift Test Linux Platform
Git Sha - 4e08298983acca5b400bab938ec88e922074784a

@airspeedswift
Copy link
Member Author

@phausler @parkera note there are a couple of Foundation changes in here. There are type aliases for the old names so should only have impact of warning users if they were explicitly typing them (which is unlikely?)

@airspeedswift
Copy link
Member Author

I'll make the matching changes in corelibs once this one lands safely.

@phausler
Copy link
Contributor

phausler commented Dec 5, 2017

the Foundation changes look good to me.

@airspeedswift
Copy link
Member Author

@swift-ci please test macOS platform

Copy link
Contributor

@moiseev moiseev left a comment

Choose a reason for hiding this comment

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

LGTM

@swift-ci
Copy link
Contributor

swift-ci commented Dec 6, 2017

Build failed
Swift Test OS X Platform
Git Sha - bbdfc9b5fde26aa9c55fc04aee8cdc171def413d

Copy link
Contributor

@parkera parkera left a comment

Choose a reason for hiding this comment

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

Thanks for the heads up on the Foundation changes. LGTM.

@airspeedswift
Copy link
Member Author

@swift-ci please test macOS platform

@airspeedswift airspeedswift merged commit 85d190c into swiftlang:master Dec 6, 2017
@airspeedswift airspeedswift deleted the slice-warnings branch December 6, 2017 03:10
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.

6 participants