rsc icon indicating copy to clipboard operation
rsc copied to clipboard

Use the nearest in-scope ancestor

Open wiwa opened this issue 6 years ago • 1 comments

package foo

class A

object B {
  def default: B = new B
}
private[foo] class B extends A
package bar

val x = B.default

In this case, we might consider ascribing type A to x since B is private[foo]. On the other hand, we can also warn or error.

wiwa avatar Apr 04 '19 17:04 wiwa

Note: this is unlikely to have high return on investment for the kind targets we've run RscCompat on (apparently this is rare-ish).

wiwa avatar Apr 09 '19 00:04 wiwa