Closed
Description
class Outer {
class Inner
}
object Test {
def test = {
// works
val a: Outer#Inner = {
val o = new Outer
new o.Inner: Outer#Inner
}
// error: type mismatch:
// found : Object
// required: Outer#Inner
// val b: Outer#Inner = {
// ^
val b: Outer#Inner = {
val o = new Outer
new o.Inner
}
}
}
The approximation is done in TypeAssigner#avoid
:
case tp: TypeRef if (forbidden contains tp.symbol) || toAvoid(tp.prefix) =>
//...
Instead of approximating the class o.Inner
by its parent class Object
, it should approximate it by its supertypeOuter#Inner
.
Metadata
Metadata
Assignees
Labels
No labels