summaryrefslogtreecommitdiff
path: root/test/files/presentation/ide-t1000976/Test.scala
diff options
context:
space:
mode:
authorLukas Rytz <lukas.rytz@epfl.ch>2012-07-02 17:25:18 +0200
committerLukas Rytz <lukas.rytz@epfl.ch>2012-07-05 14:36:44 +0200
commit70503355299263f95a3447701bb483375bf46665 (patch)
tree70439d6bca065cc9b28c5f681e86bef3e7a6f9ad /test/files/presentation/ide-t1000976/Test.scala
parent4b6ae392a7aaf147de3991998d52be5e7b7e665e (diff)
downloadscala-70503355299263f95a3447701bb483375bf46665.tar.gz
scala-70503355299263f95a3447701bb483375bf46665.tar.bz2
scala-70503355299263f95a3447701bb483375bf46665.zip
Allow attachments for symbols, just like for trees.
Removes the two global hash maps in Namers, and the one in NamesDefaults. Also fixes SI-5975.
Diffstat (limited to 'test/files/presentation/ide-t1000976/Test.scala')
-rw-r--r--test/files/presentation/ide-t1000976/Test.scala30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/files/presentation/ide-t1000976/Test.scala b/test/files/presentation/ide-t1000976/Test.scala
new file mode 100644
index 0000000000..722259d3a1
--- /dev/null
+++ b/test/files/presentation/ide-t1000976/Test.scala
@@ -0,0 +1,30 @@
+import scala.tools.nsc.interactive.tests.InteractiveTest
+import scala.reflect.internal.util.SourceFile
+import scala.tools.nsc.interactive.Response
+
+object Test extends InteractiveTest {
+ override def execute(): Unit = {
+ loadSourceAndWaitUntilTypechecked("A.scala")
+ val sourceB = loadSourceAndWaitUntilTypechecked("B.scala")
+ checkErrors(sourceB)
+ }
+
+ private def loadSourceAndWaitUntilTypechecked(sourceName: String): SourceFile = {
+ val sourceFile = sourceFiles.find(_.file.name == sourceName).head
+ compiler.askToDoFirst(sourceFile)
+ val res = new Response[Unit]
+ compiler.askReload(List(sourceFile), res)
+ res.get
+ askLoadedTyped(sourceFile).get
+ sourceFile
+ }
+
+ private def checkErrors(source: SourceFile): Unit = compiler.getUnitOf(source) match {
+ case Some(unit) =>
+ val problems = unit.problems.toList
+ if(problems.isEmpty) reporter.println("Test OK")
+ else problems.foreach(problem => reporter.println(problem.msg))
+
+ case None => reporter.println("No compilation unit found for " + source.file.name)
+ }
+}