forked from typelevel/scala
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request scala#4263 from lrytz/t9097
SI-9097 Remove spurious warning about conflicting filenames
- Loading branch information
Showing
4 changed files
with
40 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) | ||
} | ||
} |