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

[SR-12408] 5.1/5.2 source incompatibility - Self #54846

Closed
swift-ci opened this issue Mar 25, 2020 · 2 comments
Closed

[SR-12408] 5.1/5.2 source incompatibility - Self #54846

swift-ci opened this issue Mar 25, 2020 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-12408
Radar rdar://problem/62200976
Original Reporter helge (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

Swift 5.2 release Ubuntu 18.04

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: 1e97b848e3c0fbde21aa75fd5f820fda

Issue Description:

In Swift 5.1 I had this working:

public class AnyPickerStyle: PickerStyle {
  public typealias Label  = PickerStyleLabel
  public typealias Member = StaticMember<Self>

That doesn't build anymore w/ 5.2:

/src/Sources/SwiftWebUI/Views/Forms/Picker.swift:136:42: error: covariant 'Self' can only appear as the type of a property, subscript or method result; did you mean 'AnyPickerStyle'?
  public typealias Member = StaticMember<Self>
                                         ^~~~
                                         AnyPickerStyle

It now requires:

public class AnyPickerStyle: PickerStyle {
  public typealias Label  = PickerStyleLabel
  public typealias Member = StaticMember< AnyPickerStyle >

SwiftWebUI/SwiftWebUI@d1d771c

@beccadax
Copy link
Contributor

@swift-ci create

@slavapestov
Copy link
Member

This is expected behavior because the code that was written was never intended to work. The 5.1 compiler would crash if the typealias was unused in an unsupported context, basically anywhere except for inside a function body.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

3 participants