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-12383] 'τ_0_0' appears in "candidate has non-matching type" diagnostic #54820

Closed
dan-zheng opened this issue Mar 19, 2020 · 2 comments
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

@dan-zheng
Copy link
Collaborator

Previous ID SR-12383
Radar rdar://problem/60832827
Original Reporter @dan-zheng
Type Bug
Status Resolved
Resolution Done
Environment

https://github.com/apple/swift/releases/tag/swift-DEVELOPMENT-SNAPSHOT-2020-03-18-a

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

md5: 73b98bcfa08f3a359d1a42ead6c77fcd

Issue Description:

protocol Protocol {
  associatedtype Index: Comparable
  subscript(bounds: Range<Index>) -> Int { get }
  subscript(position: Index) -> Int { get }
}

struct Wrapper<Base: Protocol>: Protocol {
  typealias Index = Base.Index
  subscript(bounds: Range<Index>) -> Int {
    get { 1 }
  }
}
$ swift tau.swift
tau.swift:7:8: error: type 'Wrapper<Base>' does not conform to protocol 'Protocol'
struct Wrapper<Base: Protocol>: Protocol {
       ^
tau.swift:9:3: note: candidate has non-matching type '<Base> (Range<Wrapper<Base>.Index>) -> Int' (aka '<τ_0_0> (Range<τ_0_0.Index>) -> Int')
  subscript(bounds: Range<Index>) -> Int {
  ^
tau.swift:4:3: note: protocol requires subscript with type '(Wrapper<Base>.Index) -> Int'; do you want to add a stub?
  subscript(position: Index) -> Int { get }
  ^
@beccadax
Copy link
Contributor

@swift-ci create

@LucianoPAlmeida
Copy link
Collaborator

Fixed by #35255

@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

3 participants