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-1798] stride(from:to:by) doesn't compile in an Int extension in Xcode 8 beta 1 #44407
Comments
@moiseev, is this because there's now a |
@belkadan Most likely it's the unavailable old `stride` method in an extension to `Strideable`. The same situation as with `min` and `max` inside a `Collection` extension. You have to fully qualify it, even though the type of the function is different. |
Hm, should we add |
No, because it is only a problem when you are inside the extension to |
Right, the point of the attribute is that you put it on a member you don't want to call unqualified, which only happens inside extensions (and types newly adopting Strideable, I guess). |
Oh nice. Thanks, Jordan. |
error: Factorial.playground:14:11: error: use of 'stride' nearly matches global function 'stride(from:to:by🙂' in module 'Swift' rather than instance method 'stride(to:by🙂' Factorial.playground:14:11: note: use 'Swift.' to reference the global function in module 'Swift' and, barring a change to the language (which would go through swift-evolution rather than Jira), this is the best we’ll get. |
Attachment: Download
Environment
Xcode 8 beta 1, Swift 3, Mac OS X El-Capitan
Additional Detail from JIRA
md5: 7ccfe25e1e224104aa04838e62edd4b7
Issue Description:
The Swift 3.0 compiler reports an error in Xcode 8 beta 1 when we try to create a StrideTo<Int> using stride(from:to:by) in an extension of Int. The function seems to work fine at other places but in an Int extension it doesn't compile. The function compiles successfully in the extension if we prefix it with Swift i.e using Swift.stride(from:to:by) works fine.
The text was updated successfully, but these errors were encountered: