Closed
Description
Compiler version
3.2.1 and before
Minimized code
import scala.language.dynamics
object Foo extends Dynamic {
def applyDynamic(name: String)(): Foo.type = this
}
object Test {
def test() = {
Foo
.xxx()
.xxx()
.xxx()
.xxx()
.xxx()
.xxx()
.xxx()
.xxx()
.xxx()
.xxx()
.xxx()
.xxx()
.xxx()
.xxx()
.xxx()
.xxx()
.xxx()
.xxx()
.xxx()
.xxx()
}
}
Output
This compiles successfully but the compilation time starts to rapidly grow (nonlinearly?) starting from some number of chained invocations desugared to applyDynamic
. This happens also for applyDynamicNamed
.
Expectation
In scala 2.13 this compiles almost instantly so compilation times should not explode in scala 3 either