Skip to content

[SR-10852] [Opaque Result Types] Generic parameter 'τ_0_0' could not be inferred #53242

@theblixguy

Description

@theblixguy
Previous ID SR-10852
Radar rdar://problem/51526846
Original Reporter @theblixguy
Type Bug
Status Resolved
Resolution Done
Environment

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

Additional Detail from JIRA
Votes 1
Component/s Compiler
Labels Bug, DiagnosticsQoI, OpaqueResultTypes
Assignee @theblixguy
Priority Medium

md5: f781c969fc89c0f73616e7ae7b35dbfa

Issue 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

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfdiagnostics QoIBug: Diagnostics Quality of Implementationopaque typesFeature → types: opaque typesoperatorsFeature: operatorsswift 5.1type checkerArea → compiler: Semantic analysis

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions