miniboxing-plugin
miniboxing-plugin copied to clipboard
`-P:minibox:Yrewire-functionX-applications` improvements
The flag was introduced in https://github.com/miniboxing/miniboxing-plugin/commit/3feb8328e3dab20d05c0cb233e184292c804b3fd but still has some rough edges:
Here goes:
- [x] make it work with 2.10 + make it default
- [ ] split the bridges into fast path / slow path
- [ ] write the fast path in Java, so the vm can easily inline it
- [x] new issue described in the comments
Once these are fixed, make the flag default, so everyone benefits from its magic (see #146 for an example of what I mean by magic).
New issue:
$ cat gh-bug-156-issue.scala
package a
final class Stream[@miniboxed T](val streamf: (T => Boolean) => Unit) {
def filter(): Stream[T] =
new Stream(iterf => streamf(value => iterf(value)))
}
$ mb-scalac gh-bug-156-issue.scala
$ mb-scalac -2.10 gh-bug-156-issue.scala
gh-bug-156-issue.scala:5: error: [ occured while creating miniboxed method filter in class Stream_D ]
type mismatch;
found : miniboxing.runtime.MiniboxedFunction1[Tsp,Boolean]
required: Tsp => Boolean
new Stream(iterf => streamf(value => iterf(value)))
^
one error found
Seems the fix broke the build: https://travis-ci.org/miniboxing/miniboxing-plugin/builds/50703046