Permalink
Browse files

massive new collections checkin.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@17680 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
  • Loading branch information...
1 parent b0bae96 commit fca30808c1af24fa489aaef13268de73e4f71884 odersky committed May 8, 2009
Showing 517 changed files with 13,543 additions and 21,357 deletions.
View
Binary file not shown.
@@ -11,7 +11,7 @@
package scala.tools.ant {
- import scala.collection.Map
+ import scala.collection.DefaultMap
import scala.collection.mutable.HashMap
import java.io.{File, FileInputStream, FileOutputStream,
FileWriter, StringReader}
@@ -78,11 +78,11 @@ package scala.tools.ant {
private var link: Option[String] = None
/** The sets of files to include in the package */
- private object fileSetsMap extends Map[String, List[FileSet]] {
+ private object fileSetsMap extends DefaultMap[String, List[FileSet]] {
private var content = new HashMap[String, List[FileSet]]()
def get(key: String): Option[List[FileSet]] = content.get(key)
- def size: Int = content.size
- def update(key: String, value: FileSet) = {
+ override def size: Int = content.size
+ def update(key: String, value: FileSet) {
if (content.contains(key) && content(key) != Nil)
content.update(key, value :: content(key))
else content.update(key, List(value))
@@ -12,7 +12,7 @@ package scala.tools.ant.sabbus
import java.net.URL
-object Compilers extends collection.Map[String, Compiler] {
+object Compilers extends collection.DefaultMap[String, Compiler] {
val debug = false
@@ -22,7 +22,7 @@ object Compilers extends collection.Map[String, Compiler] {
def get(id: String) = container.get(id)
- def size = container.size
+ override def size = container.size
def make(id: String, classpath: Array[URL], settings: Settings): Compiler = {
val runtime = Runtime.getRuntime
@@ -43,5 +43,4 @@ object Compilers extends collection.Map[String, Compiler] {
if (debug) println(" memory after: " + (runtime.freeMemory/1048576.).formatted("%10.2f") + " MB")
null
}
-
}
@@ -10,7 +10,6 @@ import java.io.{BufferedOutputStream, File, FileOutputStream, PrintStream}
import java.lang.{Runtime, System, Thread}
import scala.concurrent.ops.spawn
-import scala.tools.nsc.doc.{DocDriver => DocGenerator}
import scala.tools.nsc.reporters.{Reporter, ConsoleReporter}
import scala.tools.nsc.util.FakePos //Position
import scala.tools.util.SocketServer
@@ -277,7 +277,7 @@ class Global(var settings: Settings, var reporter: Reporter) extends SymbolTable
val global: Global.this.type = Global.this
val runsAfter = List[String]()
val runsRightAfter = None
- } with SyntaxAnalyzer
+ } with SyntaxAnalyzer1
// factory method for
// phaseName = "namer"
@@ -550,7 +550,7 @@ class Interpreter(val settings: Settings, out: PrintWriter)
lazy val extractor = """
| {
| val s = scala.runtime.ScalaRunTime.stringOf(%s)
- | val nl = if (s.toSeq.contains('\n')) "\n" else ""
+ | val nl = if (s.contains('\n')) "\n" else ""
| nl + s + "\n"
| }
""".stripMargin.format(req fullPath vname)
@@ -76,7 +76,7 @@ object Main extends AnyRef with EvalLoop {
}
} catch {
case ex @ FatalError(msg) =>
- if (command.settings.debug.value)
+ if (true || command.settings.debug.value) // !!!
ex.printStackTrace();
reporter.error(null, "fatal error: " + msg)
}
@@ -133,6 +133,8 @@ abstract class TreeGen {
def mkAttributedCastUntyped(tree: Tree, pt: Type): Tree = {
if (settings.debug.value) log("casting " + tree + ":" + tree.tpe + " to " + pt)
assert(!tree.tpe.isInstanceOf[MethodType], tree)
+ assert(!pt.typeSymbol.isPackageClass)
+ assert(!pt.typeSymbol.isPackageObjectClass)
assert(pt eq pt.normalize) //@MAT only called during erasure, which already takes care of that
atPos(tree.pos) {
Apply(TypeApply(mkAttributedSelect(tree, Object_asInstanceOf), List(TypeTree(pt))), List())
@@ -159,8 +161,16 @@ abstract class TreeGen {
qual.symbol.name.toTermName == nme.EMPTY_PACKAGE_NAME)) {
mkAttributedIdent(sym)
} else {
- val result = Select(qual, sym.name) setSymbol sym
- if (qual.tpe ne null) result setType qual.tpe.memberType(sym)
+ val qual1 =
+ if ((qual.tpe ne null) &&
+ sym.owner.isPackageObjectClass &&
+ sym.owner.owner == qual.tpe.typeSymbol) {
+ //println("insert package for "+qual+"/"+sym)
+ val pkgobj = sym.owner.sourceModule
+ Select(qual, nme.PACKAGEkw) setSymbol pkgobj setType singleType(qual.tpe, pkgobj)
+ } else qual
+ val result = Select(qual1, sym.name) setSymbol sym
+ if (qual1.tpe ne null) result setType qual.tpe.memberType(sym)
result
}
Oops, something went wrong. Retry.

0 comments on commit fca3080

Please sign in to comment.