diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-11-06 15:21:19 +0100 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2014-11-07 12:00:48 +0100 |
commit | a34be74e8f2630f1862a34e538cbe1162d279e5e (patch) | |
tree | a404c5fb955bf1fd1f192895cee32adb805544df /test/osgi/src/BasicReflection.scala | |
parent | 9c36a76171d497fe277030d2f682f927ae2657f4 (diff) | |
download | scala-a34be74e8f2630f1862a34e538cbe1162d279e5e.tar.gz scala-a34be74e8f2630f1862a34e538cbe1162d279e5e.tar.bz2 scala-a34be74e8f2630f1862a34e538cbe1162d279e5e.zip |
[sammy] use correct type for method to override
Don't naively derive types for the single method's signature
from the provided function's type, as it may be a subtype
of the method's MethodType.
Instead, once the sam class type is fully defined, determine
the sam's info as seen from the class's type, and use those
to generate the correct override.
```
scala> Arrays.stream(Array(1, 2, 3)).map(n => 2 * n + 1).average.ifPresent(println)
5.0
scala> IntStream.range(1, 4).forEach(println)
1
2
3
```
Also, minimal error reporting
Can't figure out how to do it properly, but some reporting
is better than crashing. Right? Test case that illustrates
necessity of the clumsy stop gap `if (block exists (_.isErroneous))`
enclosed as `sammy_error_exist_no_crash`
added TODO for repeated and by-name params
Diffstat (limited to 'test/osgi/src/BasicReflection.scala')
0 files changed, 0 insertions, 0 deletions