From 9b2c10ad1807e62c348b6a38be76f2500185b2ab Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Fri, 7 Nov 2014 12:25:56 +0100 Subject: 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 --- test/files/run/t8960.scala | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'test/files') 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) } -- cgit v1.2.3