diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2016-03-25 19:08:23 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2016-03-28 17:48:23 -0700 |
commit | 3ae39036771acb107cbb4a37fe6113c243d89acc (patch) | |
tree | 31479991adc4552fb0b95800cf461b9b791900dd /test/junit | |
parent | a17d247a8acea2daaddb39263ebf1dcf5673bcba (diff) | |
download | scala-3ae39036771acb107cbb4a37fe6113c243d89acc.tar.gz scala-3ae39036771acb107cbb4a37fe6113c243d89acc.tar.bz2 scala-3ae39036771acb107cbb4a37fe6113c243d89acc.zip |
Target FunctionN, not scala/runtime/java8/JFunction.
We compile FunctionN to Java 8's idea of a function now,
so no need to target the artisanal JFunction and friends,
except when the function is specialized, as I don't yet
see how we can use LMF with the way specialization handles
FunctionN:
First, the working status quo -- the hand-crafted specialized
versions of JFunction0. Notice how `apply$mcB$sp` is looking
pretty SAMmy:
```
@FunctionalInterface
public interface JFunction0$mcB$sp extends JFunction0 {
@Override
public byte apply$mcB$sp();
@Override
default public Object apply() {
return BoxesRunTime.boxToByte(this.apply$mcB$sp());
}
}
```
Contrast this with our specialized standard FunctionN:
```
public interface Function0<R> {
public R apply();
default public byte apply$mcB$sp() {
return BoxesRunTime.unboxToByte(this.apply());
}
}
public interface Function0$mcB$sp extends Function0<Object> { }
```
The single abstract method in `Function0$mcB$sp` is `apply`, and
the method that would let us avoid boxing, if it were abstract,
is `apply$mcB$sp`...
TODO (after M4):
- do same for specialized functions (issues with boxing?)
- remove scala/runtime/java8/JFunction* (need new STARR?)
Diffstat (limited to 'test/junit')
0 files changed, 0 insertions, 0 deletions