diff options
author | Paul Phillips <paulp@improving.org> | 2011-10-15 00:14:04 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-10-15 00:14:04 +0000 |
commit | e52053f10b65105ca6ba58806da41a0d14803a37 (patch) | |
tree | 644632ac8a1f7c7e2a34f15286b6c859ea964847 /src/compiler/scala/tools/nsc/io/AbstractFile.scala | |
parent | 9ea2cefb2079aebad2b215f6a699fe6262e2c7a7 (diff) | |
download | scala-e52053f10b65105ca6ba58806da41a0d14803a37.tar.gz scala-e52053f10b65105ca6ba58806da41a0d14803a37.tar.bz2 scala-e52053f10b65105ca6ba58806da41a0d14803a37.zip |
Fix regression in companion check.
Pulling back from expensive path normalization caused a regression where
companions were no longer recognized as such after specialization.
(Specifically, the paths turned up as "test.scala" and "./test.scala".)
I made it a two-level check, doing the expensive one before failing.
Closes SI-5023, no review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/io/AbstractFile.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/io/AbstractFile.scala | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/io/AbstractFile.scala b/src/compiler/scala/tools/nsc/io/AbstractFile.scala index d60ecd8734..27dd8625a5 100644 --- a/src/compiler/scala/tools/nsc/io/AbstractFile.scala +++ b/src/compiler/scala/tools/nsc/io/AbstractFile.scala @@ -89,6 +89,9 @@ abstract class AbstractFile extends AnyRef with Iterable[AbstractFile] { /** Returns the path of this abstract file. */ def path: String + /** Returns the path of this abstract file in a canonical form. */ + def canonicalPath: String = if (file == null) path else file.getCanonicalPath + /** Checks extension case insensitively. */ def hasExtension(other: String) = extension == other.toLowerCase private lazy val extension: String = Path.extension(name) |