diff options
author | Lukas Rytz <lukas.rytz@gmail.com> | 2015-04-01 16:47:22 +0200 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@gmail.com> | 2015-04-01 16:47:22 +0200 |
commit | dcd9a83916f9e0128ef6869def82d4f23bdea0e0 (patch) | |
tree | e58331aebe8ba06fd1c15faf36fdbb3f77b489b9 /test/files/run/t9097.scala | |
parent | ebf0976c363c67e6a46c66d70b39704f1ce5e74a (diff) | |
parent | fcc20fe4d3ac5caceb50965bc202b880e61f984c (diff) | |
download | scala-dcd9a83916f9e0128ef6869def82d4f23bdea0e0.tar.gz scala-dcd9a83916f9e0128ef6869def82d4f23bdea0e0.tar.bz2 scala-dcd9a83916f9e0128ef6869def82d4f23bdea0e0.zip |
Merge commit 'fcc20fe' into merge/2.11-to-2.12-apr-1
Diffstat (limited to 'test/files/run/t9097.scala')
-rw-r--r-- | test/files/run/t9097.scala | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/test/files/run/t9097.scala b/test/files/run/t9097.scala new file mode 100644 index 0000000000..d2bf55fc44 --- /dev/null +++ b/test/files/run/t9097.scala @@ -0,0 +1,34 @@ +import scala.tools.partest._ +import java.io.{Console => _, _} + +object Test extends StoreReporterDirectTest { + + override def extraSettings: String = List( + "-usejavacp", + "-Xfatal-warnings", + "-Ybackend:GenBCode", + "-Ydelambdafy:method", + "-Xprint:delambdafy", + s"-d ${testOutput.path}" + ) mkString " " + + override def code = """package o + |package a { + | class C { + | def hihi = List(1,2).map(_ * 2) + | } + |} + |package object a { + | def f = 1 + |} + |""".stripMargin.trim + + override def show(): Unit = { + val baos = new java.io.ByteArrayOutputStream() + Console.withOut(baos)(Console.withErr(baos)(compile())) + assert(!storeReporter.hasErrors, message = filteredInfos map (_.msg) mkString "; ") + val out = baos.toString("UTF-8") + // was 2 before the fix, the two PackageDefs for a would both contain the ClassDef for the closure + assert(out.lines.count(_ contains "class hihi$1") == 1, out) + } +} |