scala-dev
scala-dev copied to clipboard
Scala 2 team issues. Not for user-facing bugs or directly actionable user-facing improvements. For build/test/infra and for longer-term planning and idea tracking. Our bug tracker is at https://github...
@retronym suggests we use https://community.oracle.com/blogs/forax/2011/12/17/jsr-292-goodness-almost-static-final-field to hide our instrumentation better from the JIT. A lot of compiler settings are constant `false` in most compiler runs, yet they must be checked...
scala-js supports `@inline` on classes, we could do the same. we could also consider all value classes as having the annotation. see also https://issues.scala-lang.org/browse/SI-9731
Extend #11 to support value class instances.
Allocations of classes providing extension methods should be eliminated. Note that this problem is solved in many cases by value classes, for example `1 to 10` expands to `Predef.intWrapper(10).to(20)`. After...
Example: ``` class C { def t = { val f = (b: Int, i: Object) => 0 f(1, null) } } ``` The classfile has an unused method `C$$$anonfun$1$adapted`....
If all closure instantiations in a class are eliminated, also eliminate (or don't emit) the `deserializeLambda` method and the `$deserializeLambdaCache$` field. ``` scala class C { def f = {...
Matches generate "result" variables that could be elided: ``` class C { def f(x: String) = println(x match { case "hai" => x.trim }) } ``` compiles to ``` public...
The old optimizer inlined exception handlers if a `throw` throws an exception that is caught in the same method. According to @VladUreche, this is mainly to support two use-cases: -...
Eliminate unused fields from closures. See Miguel's prototype: https://github.com/scala/scala/commit/5d4e477, also the paper "Optimizing Closures in O(0) time".
``` trait TravLike { def map = ... } sealed trait List extends TravLike { ... } // map is not overridden final case class :: final case object Nil...