The following trivial example produces a compiler error:
class A {
val b = ""
def f(b: Option[String] = Some(b))
}
The error is
Error:(3, 34) type mismatch;
found : Option[String]
required: String
def f(b: Option[String] = Some(b))
^
The error seems to suggest the compiler is trying to initialize b argument with itself, not with the b field, when the b field should be the only possible valid interpretation in this context, as b argument is not visible in the parameter list itself.