Uploaded image for project: 'Swift'
  1. Swift
  2. SR-10852

[Opaque Result Types] Generic parameter 'τ_0_0' could not be inferred

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: Compiler
    • Environment:

      Xcode 11 Beta 1, Swift 5.1, macOS 10.15 Developer Beta 1 (19A471t)

      Description

      I don't think "τ_{depth}_{index}" is supposed to leak into diagnostics:

      protocol EquatableBox {
        associatedtype Value: Equatable
        var value: Value { get }
      }
      
      func ==<T: EquatableBox, U: EquatableBox>(lhs: T, rhs: U) -> Bool where T.Value == Int, U.Value == Int {
        return lhs.value == rhs.value
      }
      
      struct ConcreteEquatableBox: EquatableBox {
        typealias Value = Int
        let value: Value
      }
      
      func someEquatableBox() -> some EquatableBox {
        return ConcreteEquatableBox(value: 5)
      }
      
      let a = someEquatableBox()
      let b = someEquatableBox()
      
      let _ = a == b // Generic parameter 'τ_0_0' could not be inferred
      

        Attachments

          Activity

            People

            • Assignee:
              slazarus Sam Lazarus
              Reporter:
              suyashsrijan Suyash Srijan
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: