Skip to content

track values of implicit vals when types depend on it #6139

Open
@scabug

Description

@scabug

https://gist.github.com/2943283

class Indirection[T](implicit val c: CompanionProvider[T]) {
  def indirect: c.CompanionT = c.provide
}

// error: value foo is not a member of _1.c.CompanionT
new Indirection[Foo].indirect.foo

this doesn't work because new Indirection[Foo]: Indirection[Foo],
i.e., there's no information about the implicit value that was inferred for c in the type of the target of the selection of indirect

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions