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-11340] Compilation error when there shouldn't be one #53741

Closed
swift-ci opened this issue Aug 21, 2019 · 0 comments
Closed

[SR-11340] Compilation error when there shouldn't be one #53741

swift-ci opened this issue Aug 21, 2019 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-11340
Radar None
Original Reporter Tomas Novella (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate
Environment

xcode 10.3

mac os mojave

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

md5: 0eb8aeabde1082c778bb07b44de885bb

duplicates:

  • SR-1581 Can not use protocol to fulfill associatedtype requirement where associatedType has protocol constraint

Issue Description:

protocol MyConstraint { }

protocol MyProtocolWithAssociatedType { 
  associatedtype CustomType: MyConstraint
}

protocol MyImplementation: MyConstraint { }

class MyConcreteImplementation: MyConstraint { }

class MyResolvedType: MyProtocolWithAssociatedType { 
  typealias CustomType = MyImplementation
}

The message we get is:

Type 'MyResolvedType' does not conform to protocol 'MyProtocolWithAssociatedType'

The error disappears if we do one of the following:

  1. typealias CustomType = MyConcreteImplementation

  2. associatedtype CustomType // remove the type constraint

@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.
Projects
None yet
Development

No branches or pull requests

1 participant