scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
232 stars 21 forks source link

Implicits in self-types #10104

Open scabug opened 7 years ago

scabug commented 7 years ago

It would be nice:

class C { implicit this =>
  def f(implicit c: C) = ???
  def g = f // ok
}
class C(x: X, y: Y) { self(implicit x) =>
  def f(implicit z: X) = ???
  def g = f // ok
}
// C.x needn't be a field as in:
class C(implicit x: X, y: Y) { ... }  // don't want implicit param section
class C(x: X, y: Y) {
  implicit private val x1: X = x   // incurs a field
}

Implicit this suggested at #2823

scabug commented 7 years ago

Imported From: https://issues.scala-lang.org/browse/SI-10104?orig=1 Reporter: @som-snytt Affected Versions: 2.12.1

scabug commented 7 years ago

@milessabin said: See also: #4032. Thematically, if not concretely, related.