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-13172] Associated type inference broken when using enum case as witness #55614

Closed
theblixguy opened this issue Jul 8, 2020 · 4 comments
Closed
Assignees
Labels
associated type inference bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself type checker Area → compiler: Semantic analysis

Comments

@theblixguy
Copy link
Collaborator

Previous ID SR-13172
Radar rdar://problem/65248356
Original Reporter @theblixguy
Type Bug
Status Closed
Resolution Done
Environment

Swift 5.3 / Xcode 12 beta

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, AssociatedTypeInference, TypeChecker
Assignee @theblixguy
Priority Medium

md5: 8aef054423df4c6f72d750bca9e0940c

Issue Description:

Associated type inference does not seem to work correctly when using an enum case as a protocol witness:

protocol FooType {
  associatedtype Bar
  static func bar(_ value: Bar) -> Self
}
enum Foo: FooType { // Type 'Foo' does not conform to protocol 'FooType'
  case bar(String)
}
@theblixguy
Copy link
Collaborator Author

#32753

@devincoughlin
Copy link
Member

(Apple Sync System) create

@theblixguy
Copy link
Collaborator Author

Fixed on master and 5.3. I’ll verify with next available snapshot.

@theblixguy
Copy link
Collaborator Author

Verified on master (Swift version 5.3-dev (LLVM 9437a19bcff81e0, Swift d2f131f30e96aeb)) that this now works. Closing the ticket now.

@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
associated type inference bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

2 participants