summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/util
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-05-03 10:15:10 -0700
committerPaul Phillips <paulp@improving.org>2013-05-03 11:36:37 -0700
commit80ac7d006350c0d60ff1b293ee955c3435288a9e (patch)
tree1cb3f2dfbec47cb1a966b7bc459907a14f937f1b /src/compiler/scala/tools/nsc/util
parent6eb33d4ad15ae3548c21535de652ea246582a44f (diff)
downloadscala-80ac7d006350c0d60ff1b293ee955c3435288a9e.tar.gz
scala-80ac7d006350c0d60ff1b293ee955c3435288a9e.tar.bz2
scala-80ac7d006350c0d60ff1b293ee955c3435288a9e.zip
Absolutized paths involving the scala package.
Confusing, now-it-happens now-it-doesn't mysteries lurk in the darkness. When scala packages are declared like this: package scala.collection.mutable Then paths relative to scala can easily be broken via the unlucky presence of an empty (or nonempty) directory. Example: // a.scala package scala.foo class Bar { new util.Random } % scalac ./a.scala % mkdir util % scalac ./a.scala ./a.scala:4: error: type Random is not a member of package util new util.Random ^ one error found There are two ways to play defense against this: - don't use relative paths; okay sometimes, less so others - don't "opt out" of the scala package This commit mostly pursues the latter, with occasional doses of the former. I created a scratch directory containing these empty directories: actors annotation ant api asm beans cmd collection compat concurrent control convert docutil dtd duration event factory forkjoin generic hashing immutable impl include internal io logging macros man1 matching math meta model mutable nsc parallel parsing partest persistent process pull ref reflect reify remote runtime scalap scheduler script swing sys text threadpool tools transform unchecked util xml I stopped when I could compile the main src directories even with all those empties on my classpath.
Diffstat (limited to 'src/compiler/scala/tools/nsc/util')
-rw-r--r--src/compiler/scala/tools/nsc/util/JavaCharArrayReader.scala3
-rw-r--r--src/compiler/scala/tools/nsc/util/ShowPickled.scala3
-rw-r--r--src/compiler/scala/tools/nsc/util/package.scala4
3 files changed, 7 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/util/JavaCharArrayReader.scala b/src/compiler/scala/tools/nsc/util/JavaCharArrayReader.scala
index 26d19906c2..58a5442465 100644
--- a/src/compiler/scala/tools/nsc/util/JavaCharArrayReader.scala
+++ b/src/compiler/scala/tools/nsc/util/JavaCharArrayReader.scala
@@ -3,7 +3,8 @@
* @author Martin Odersky
*/
-package scala.tools.nsc
+package scala
+package tools.nsc
package util
import scala.reflect.internal.Chars._
diff --git a/src/compiler/scala/tools/nsc/util/ShowPickled.scala b/src/compiler/scala/tools/nsc/util/ShowPickled.scala
index 76b1394b85..f9d706ae55 100644
--- a/src/compiler/scala/tools/nsc/util/ShowPickled.scala
+++ b/src/compiler/scala/tools/nsc/util/ShowPickled.scala
@@ -3,7 +3,8 @@
* @author Martin Odersky
*/
-package scala.tools
+package scala
+package tools
package nsc
package util
diff --git a/src/compiler/scala/tools/nsc/util/package.scala b/src/compiler/scala/tools/nsc/util/package.scala
index 039fec8605..5faa2f7513 100644
--- a/src/compiler/scala/tools/nsc/util/package.scala
+++ b/src/compiler/scala/tools/nsc/util/package.scala
@@ -3,7 +3,9 @@
* @author Paul Phillips
*/
-package scala.tools.nsc
+package scala
+package tools
+package nsc
import java.io.{ OutputStream, PrintStream, ByteArrayOutputStream, PrintWriter, StringWriter }