diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2014-11-07 12:25:56 +0100 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@gmail.com> | 2014-11-07 12:26:35 +0100 |
commit | 9b2c10ad1807e62c348b6a38be76f2500185b2ab (patch) | |
tree | 8d007bb2318df783c282e39c7f600a9e0bba823d /test | |
parent | f7c3c6bc37228a70e06d5542ed4927bf3614486f (diff) | |
download | scala-9b2c10ad1807e62c348b6a38be76f2500185b2ab.tar.gz scala-9b2c10ad1807e62c348b6a38be76f2500185b2ab.tar.bz2 scala-9b2c10ad1807e62c348b6a38be76f2500185b2ab.zip |
Make t8960 pass under delambdafy:method
When using delambdafy:method, anonymous function classes are not
currently specialized, as noted here:
https://github.com/scala/scala/blob/f08e96571479552b103b15cc2d40ea5454999546/src/compiler/scala/tools/nsc/transform/Delambdafy.scala#L26
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/t8960.scala | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/files/run/t8960.scala b/test/files/run/t8960.scala index c6bcd0770c..a58ac53d33 100644 --- a/test/files/run/t8960.scala +++ b/test/files/run/t8960.scala @@ -1,6 +1,12 @@ object Test extends App { def test(o: AnyRef, sp: Boolean = false) = { - if (sp) assert(o.getClass.getSuperclass.getName contains "$sp") + val isSpecialized = o.getClass.getSuperclass.getName contains "$sp" + val isDelambdafyMethod = o.getClass.getName contains "$lambda$" + assert( + // delambdafy:method doesn't currently emit specialized anonymous function classes + if (sp) (isSpecialized || isDelambdafyMethod) else !isSpecialized, + o.getClass.getName) + val Some(f) = o.getClass.getDeclaredFields.find(_.getName == "serialVersionUID") assert(f.getLong(null) == 0l) } |