Closed
Description
Compiler version
3.2.1
Minimized example
trait Converter[A, B] {
def convert: A => B
}
inline given Converter[Int, String] = new Converter {
def convert = _.toString()
}
def foo(using bar: Converter[Int, String]) =
"foo"
@main
def main =
foo
foo
foo
foo
Output
Creates 4 anon classes in the compilation output. Can lead to an explosion of amount of classes, killing the jit code cache (as seen in the lichess case)
Expectation
Should warn the User about the generation of anon classes per usage of Converter inline given
, or find a way to avoid inlining anonymous class generation.