Skip to content

Regression in implicit params lookup of recursive calls #15820

Closed
@WojciechMazur

Description

@WojciechMazur

Based on Open CB #2105

Compiler version

Works in 3.1.1
Fails since 3.1.2
Fails in 3.2.0-RC3

Minimized code

sealed trait Domain[E]

final def splitBounds[E, D[X] <: Domain[X]](
    bounds: Seq[E],
  )( using domain: D[E]): Seq[E] =
      val newBounds: Seq[E] = ???
      splitBounds(newBounds) // does not compile
      splitBounds[E,D](newBounds) // does compile

Output

[error] ./test.scala:7:29: no given instance of type D[E] was found for parameter domain of method splitBounds
[error] 
[error] where:    D is a type variable with constraint <: Domain
[error]       splitBounds(newBounds) // does not compile
[error]         

Expectation

Should compile by resuing implicit Domain parameter

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:implicitsrelated to implicitsitype:bugregressionThis worked in a previous version but doesn't anymore

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions