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-13019] Bad compiler error on generic constraint of associated types #55464

Closed
stephencelis opened this issue Jun 15, 2020 · 1 comment
Closed
Labels
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

@stephencelis
Copy link
Contributor

Previous ID SR-13019
Radar None
Original Reporter @stephencelis
Type Bug
Status Resolved
Resolution Duplicate
Environment

Swift 5.2

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

md5: a78cb98ba468d48de6fb3f5ad2387bb0

duplicates:

  • SR-10752 Trouble with Generic Constraints and Associated Types

Issue Description:

This should compile, but doesn't:

struct T<A> {
  func f<C>(_ c: C) -> A
    where C: Collection, C.SubSequence == A, A.SubSequence == A
  {
    fatalError()
  }
}

Errors:

'SubSequence' is not a member type of 'A'

While this might produce a redundant warning, the error is wrong. This is related to a bug I opened over a year ago that is sadly still open today 🙁

https://bugs.swift.org/browse/SR-10752

@slavapestov
Copy link
Member

This is fixed in the RequirementMachine implementation and I already have a regression test for the older dupe.

@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 type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

2 participants