From 02c6aa766b53523dbb126fd5f8236becfe09036e Mon Sep 17 00:00:00 2001 From: Miles Sabin Date: Mon, 25 Jan 2010 16:14:02 +0000 Subject: Use file paths for equality and hashCode to dea... Use file paths for equality and hashCode to deal with mixed-type file equality test issues in the IDE. Fixes #2931. --- src/compiler/scala/tools/nsc/Global.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/compiler/scala/tools/nsc/Global.scala') diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index 08671526e6..3504f019d4 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -701,12 +701,12 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable // ----------- Units and top-level classes and objects -------- private var unitbuf = new ListBuffer[CompilationUnit] - var compiledFiles = new HashSet[AbstractFile] + var compiledFiles = new HashSet[String] /** add unit to be compiled in this run */ private def addUnit(unit: CompilationUnit) { unitbuf += unit - compiledFiles += unit.source.file + compiledFiles += unit.source.file.path } /* An iterator returning all the units being compiled in this run */ @@ -855,7 +855,7 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable " was found\n(This file cannot be loaded as a source file)" inform(msg) throw new FatalError(msg) - } else if (!(compiledFiles contains file)) { + } else if (!(compiledFiles contains file.path)) { compileLate(new CompilationUnit(getSourceFile(file))) } } -- cgit v1.2.3