rsc
rsc copied to clipboard
Automatically insert renamed import statements for long type ascriptions
Consider CountDownLatch in examples/core:
package com.twitter.util
import java.util.concurrent.TimeUnit
class CountDownLatch(val initialCount: Int) {
val underlying: java.util.concurrent.CountDownLatch = new java.util.concurrent.CountDownLatch(initialCount)
...
}
In this example, no shortening of underlying's type can be applied even with automatic import statements, since CountDownLatch is in scope, concurrent is in scope as scala.concurrent, and util is the package name. Thus we may want to import java.util.concurrent.CountDownLatch as a renamed import, something like java.util.concurrent.{CountDownLatch => JavaCountDownLatch}.