You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classHiddenInner[+O<:Outer](valouter:O){
}
classOuter{
typeInner=HiddenInner[this.type]
}
valo:Outer=newOutervala: o.Inner=new o.Inner(o)
valb: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.