Closed
Description
Compiler version
3.2.2 , 3.3.0-RC3
Minimized code
class HiddenInner[+O<:Outer](val outer:O){
}
class Outer{
type Inner = HiddenInner[this.type]
}
val o : Outer = new Outer
val a : o.Inner = new o.Inner(o)
val b : Outer#Inner = a // DOES NOT COMPILE
Output
Found: (a : o.Inner)
Required: Outer#Inner
Expectation
Code should compile: o.Inner
conforms to Outer#Inner
.
Note Outer
is a class, so Outer#Inner
is legal (sound) in scala3.
Compiles in scala 2.13.
Intention
The intention is to make Inner
behave almost as inner class of Outer
.