Skip to content

method argument not used for prefix of implicit argument #6892

Open
@scabug

Description

@scabug
class Cake {
  trait Foo[T]
  object Foo {
    // if FooString is replaced with fooString, everything works
    // implicit val fooString = new Foo[String] {}
    implicit object FooString extends Foo[String]
  }
  def foo[T: Foo](x: T) = x
}

object Test extends App {
  def foo(c: Cake) = {
    // doesn't work: c.foo("1")
    // Test.scala:11: error: could not find implicit value for evidence parameter of type c.Foo[String]
    // c.foo("1")

    // this works
    val c1 = c
    c1.foo("1")
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    dependent typesfixed in Scala 3This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)implicitinfer

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions