diff options
author | Paul Phillips <paulp@improving.org> | 2012-12-28 13:18:42 -0800 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2013-01-05 01:39:16 +0300 |
commit | 1f1e36922af099d647931a61ebdf5cec97ab54ac (patch) | |
tree | 79fe8ab4e990498d6d16e64cfcefe6aa83dd14bc /src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala | |
parent | 348c8fac9f897f9661f84e32949b8a4e0c99e93a (diff) | |
download | scala-1f1e36922af099d647931a61ebdf5cec97ab54ac.tar.gz scala-1f1e36922af099d647931a61ebdf5cec97ab54ac.tar.bz2 scala-1f1e36922af099d647931a61ebdf5cec97ab54ac.zip |
Made Symbol#associatedFile always return non-null
So we don't have to clutter everything with null checks.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala index 27944b8767..ea03aca8c4 100644 --- a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala +++ b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala @@ -13,6 +13,7 @@ import scala.reflect.runtime.ReflectionUtils import scala.reflect.macros.runtime.AbortMacroException import scala.util.control.NonFatal import scala.tools.nsc.util.stackTraceString +import scala.reflect.io.NoAbstractFile trait ContextErrors { self: Analyzer => @@ -642,7 +643,7 @@ trait ContextErrors { val addendums = List( if (sym0.associatedFile eq sym1.associatedFile) Some("conflicting symbols both originated in file '%s'".format(sym0.associatedFile.canonicalPath)) - else if ((sym0.associatedFile ne null) && (sym1.associatedFile ne null)) + else if ((sym0.associatedFile ne NoAbstractFile) && (sym1.associatedFile ne NoAbstractFile)) Some("conflicting symbols originated in files '%s' and '%s'".format(sym0.associatedFile.canonicalPath, sym1.associatedFile.canonicalPath)) else None , if (isBug) Some("Note: this may be due to a bug in the compiler involving wildcards in package objects") else None |