diff options
author | Martin Odersky <odersky@gmail.com> | 2007-12-19 13:21:09 +0000 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2007-12-19 13:21:09 +0000 |
commit | 422a46993cdb74ccf3650e0b171f65c6c12bdedf (patch) | |
tree | fcd3449613e8c47a8196212004fc60fa3153cb9d /src | |
parent | 7d3efa0e191d805d171961b26baab773669b2b69 (diff) | |
download | scala-422a46993cdb74ccf3650e0b171f65c6c12bdedf.tar.gz scala-422a46993cdb74ccf3650e0b171f65c6c12bdedf.tar.bz2 scala-422a46993cdb74ccf3650e0b171f65c6c12bdedf.zip |
-target 1.5 now the default.
Diffstat (limited to 'src')
-rw-r--r-- | src/actors/scala/actors/Actor.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/ant/Scalac.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/Interpreter.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/ObjectRunner.scala | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/Settings.scala | 3 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/models/SemanticTokens.scala | 4 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/plugins/Plugin.scala | 8 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala | 4 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/clr/CLRTypes.scala | 4 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Typers.scala | 33 | ||||
-rw-r--r-- | src/dbc/scala/dbc/Vendor.scala | 2 | ||||
-rw-r--r-- | src/library/scala/xml/include/sax/XIncludeFilter.scala | 4 | ||||
-rw-r--r-- | src/library/scala/xml/include/sax/XIncluder.scala | 2 |
13 files changed, 38 insertions, 34 deletions
diff --git a/src/actors/scala/actors/Actor.scala b/src/actors/scala/actors/Actor.scala index 5bde8948ca..6f796d0dac 100644 --- a/src/actors/scala/actors/Actor.scala +++ b/src/actors/scala/actors/Actor.scala @@ -24,7 +24,7 @@ import scala.compat.Platform */ object Actor { - private[actors] val tl = new ThreadLocal + private[actors] val tl = new ThreadLocal[Actor] /** * Returns the currently executing actor. Should be used instead diff --git a/src/compiler/scala/tools/ant/Scalac.scala b/src/compiler/scala/tools/ant/Scalac.scala index cee423f944..c840f571e5 100644 --- a/src/compiler/scala/tools/ant/Scalac.scala +++ b/src/compiler/scala/tools/ant/Scalac.scala @@ -555,7 +555,7 @@ class Scalac extends MatchingTask { if (!assemname.isEmpty) settings.assemname.value = assemname.get if (!assemrefs.isEmpty) settings.assemrefs.value = assemrefs.get - if (!generics.isEmpty) settings.Xgenerics.value = generics.get +// if (!generics.isEmpty) settings.Xgenerics.value = generics.get log("Scalac params = '" + addParams + "'", Project.MSG_DEBUG) var args = diff --git a/src/compiler/scala/tools/nsc/Interpreter.scala b/src/compiler/scala/tools/nsc/Interpreter.scala index 6b7bd86104..3517c75132 100644 --- a/src/compiler/scala/tools/nsc/Interpreter.scala +++ b/src/compiler/scala/tools/nsc/Interpreter.scala @@ -776,7 +776,7 @@ class Interpreter(val settings: Settings, out: PrintWriter) { /** load and run the code using reflection */ def loadAndRun: (String, Boolean) = { - val interpreterResultObject: Class = + val interpreterResultObject: Class[_] = Class.forName(resultObjectName, true, classLoader) val resultValMethod: java.lang.reflect.Method = interpreterResultObject.getMethod("result", null) diff --git a/src/compiler/scala/tools/nsc/ObjectRunner.scala b/src/compiler/scala/tools/nsc/ObjectRunner.scala index f2fb6d6cd7..befdddef9b 100644 --- a/src/compiler/scala/tools/nsc/ObjectRunner.scala +++ b/src/compiler/scala/tools/nsc/ObjectRunner.scala @@ -23,7 +23,7 @@ object ObjectRunner { /** Look up a class with a given class path. */ private def findClass(loader: ClassLoader, objectName: String) - : Option[Class] = + : Option[Class[T] forSome { type T }] = { try { Some(Class.forName(objectName, true, loader)) diff --git a/src/compiler/scala/tools/nsc/Settings.scala b/src/compiler/scala/tools/nsc/Settings.scala index d51c173149..ff45801767 100644 --- a/src/compiler/scala/tools/nsc/Settings.scala +++ b/src/compiler/scala/tools/nsc/Settings.scala @@ -94,7 +94,7 @@ class Settings(error: String => Unit) { val extdirs = StringSetting ("-extdirs", "dirs", "Override location of installed extensions", extdirsDefault) val outdir = StringSetting ("-d", "directory", "Specify where to place generated class files", ".") val encoding = StringSetting ("-encoding", "encoding", "Specify character encoding used by source files", encodingDefault) - val target = ChoiceSetting ("-target", "Specify for which target object files should be built", List("jvm-1.5", "jvm-1.4", "msil", "cldc"), "jvm-1.4") + val target = ChoiceSetting ("-target", "Specify for which target object files should be built", List("jvm-1.5", "jvm-1.4", "msil", "cldc"), "jvm-1.5") val printLate = BooleanSetting ("-print", "Print program with all Scala-specific features removed").hideToIDE val XO = BooleanSetting ("-optimise", "Generates faster bytecode by applying optimisations to the program") val explaintypes = BooleanSetting ("-explaintypes", "Explain type errors in more detail").hideToIDE @@ -136,7 +136,6 @@ class Settings(error: String => Unit) { val Xdce = BooleanSetting ("-Ydead-code", "Perform dead code elimination") val Xdetach = BooleanSetting ("-Ydetach", "Perform detaching of remote closures") val doc = BooleanSetting ("-Ydoc", "Generate documentation").hideToIDE - val Xgenerics = BooleanSetting ("-Ygenerics", "Use generic Java types") val inline = BooleanSetting ("-Yinline", "Perform inlining when possible") val Xlinearizer = ChoiceSetting ("-Ylinearizer", "Linearizer to use", List("normal", "dfs", "rpo", "dump"), "rpo") val log = PhasesSetting ("-Ylog", "Log operations in") diff --git a/src/compiler/scala/tools/nsc/models/SemanticTokens.scala b/src/compiler/scala/tools/nsc/models/SemanticTokens.scala index f8b6f26545..3cafc191e1 100644 --- a/src/compiler/scala/tools/nsc/models/SemanticTokens.scala +++ b/src/compiler/scala/tools/nsc/models/SemanticTokens.scala @@ -27,6 +27,8 @@ class SemanticTokens(val compiler: Global) { object ARG extends Kind object TPARAM extends Kind + type AnyClass = Class[_] + // static constants here abstract class Token { @@ -282,7 +284,7 @@ class SemanticTokens(val compiler: Global) { case tree : TypeTree => val treex = tree val tree1 = if (tree.original ne null) tree.original else tree - def classes(clazz: java.lang.Class): List[java.lang.Class] = + def classes(clazz: AnyClass): List[AnyClass] = if (clazz eq null) Nil else clazz :: classes(clazz.getSuperclass()) if (tree.original eq null) { diff --git a/src/compiler/scala/tools/nsc/plugins/Plugin.scala b/src/compiler/scala/tools/nsc/plugins/Plugin.scala index aa0a80e0aa..202e0ef26a 100644 --- a/src/compiler/scala/tools/nsc/plugins/Plugin.scala +++ b/src/compiler/scala/tools/nsc/plugins/Plugin.scala @@ -96,11 +96,13 @@ object Plugin { } } + type AnyClass = Class[_] + /** Loads a plugin class from the named jar file. Returns None * if the jar file has no plugin in it or if the plugin * is badly formed. */ - def loadFrom(jarfile: File, loader: ClassLoader): Option[Class[_]] = { + def loadFrom(jarfile: File, loader: ClassLoader): Option[AnyClass] = { val pluginInfo = loadDescription(jarfile).get try { @@ -120,7 +122,7 @@ object Plugin { */ def loadAllFrom(jars: List[File], dirs: List[File], - ignoring: List[String]): List[Class[_]] = + ignoring: List[String]): List[AnyClass] = { val alljars = new ListBuffer[File] @@ -143,7 +145,7 @@ object Plugin { /** Instantiate a plugin class, given the class and * the compiler it is to be used in. */ - def instantiate(clazz: Class[_], global: Global): Plugin = { + def instantiate(clazz: AnyClass, global: Global): Plugin = { val constructor = clazz.getConstructor(Array(classOf[Global])) constructor.newInstance(Array(global)).asInstanceOf[Plugin] } diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala index 13c666e122..73b81107ee 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala @@ -585,11 +585,11 @@ abstract class ClassfileParser { val oldpb = in.bp attrName match { case nme.SignatureATTR => - if (global.settings.Xgenerics.value) { + if (global.settings.target.value == "jvm-1.5") { val sig = pool.getExternalName(in.nextChar) val newType = sigToType(sym, sig) sym.setInfo(newType) -// if (settings.debug.value) + if (settings.debug.value) println("" + sym + "; signature = " + sig + " type = " + newType) hasMeta = true } else diff --git a/src/compiler/scala/tools/nsc/symtab/clr/CLRTypes.scala b/src/compiler/scala/tools/nsc/symtab/clr/CLRTypes.scala index 0f83354b16..e312c61f3f 100644 --- a/src/compiler/scala/tools/nsc/symtab/clr/CLRTypes.scala +++ b/src/compiler/scala/tools/nsc/symtab/clr/CLRTypes.scala @@ -116,8 +116,8 @@ abstract class CLRTypes { alltypes = Array.concat(alltypes, atypes) } - val typeNameComparator: Comparator = - new Comparator() { + val typeNameComparator: Comparator[Any] = + new Comparator[Any]() { def compare(o1: Any, o2: Any): Int = { val t1 = o1.asInstanceOf[Type] val t2 = o2.asInstanceOf[Type] diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala index a42a7fbb6d..4543111fba 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala @@ -3341,22 +3341,23 @@ trait Typers { self: Analyzer => val tc = newTyper(context.makeImplicit(reportAmbiguous)) def ambiguousImplicitError(info1: ImplicitInfo, info2: ImplicitInfo, - pre1: String, pre2: String, trailer: String) = { - val coreMsg = - pre1+" "+info1.sym+info1.sym.locationString+" of type "+info1.tpe+"\n "+ - pre2+" "+info2.sym+info2.sym.locationString+" of type "+info2.tpe+"\n "+ - trailer - error(pos, - if (isView) { - val found = pt.typeArgs(0) - val req = pt.typeArgs(1) - typeErrorMsg(found, req)+ - "\nNote that implicit conversions are not applicable because they are ambiguous:\n "+ - coreMsg+"are possible conversion functions from "+ found+" to "+req - } else { - "ambiguous implicit values:\n "+coreMsg + "match expected type "+pt - }) - } + pre1: String, pre2: String, trailer: String) = + if (!info1.tpe.isErroneous && !info2.tpe.isErroneous) { + val coreMsg = + pre1+" "+info1.sym+info1.sym.locationString+" of type "+info1.tpe+"\n "+ + pre2+" "+info2.sym+info2.sym.locationString+" of type "+info2.tpe+"\n "+ + trailer + error(pos, + if (isView) { + val found = pt.typeArgs(0) + val req = pt.typeArgs(1) + typeErrorMsg(found, req)+ + "\nNote that implicit conversions are not applicable because they are ambiguous:\n "+ + coreMsg+"are possible conversion functions from "+ found+" to "+req + } else { + "ambiguous implicit values:\n "+coreMsg + "match expected type "+pt + }) + } /** Search list of implicit info lists for one matching prototype * <code>pt</code>. If found return a tree from found implicit info diff --git a/src/dbc/scala/dbc/Vendor.scala b/src/dbc/scala/dbc/Vendor.scala index 927d505b31..c26f204b2a 100644 --- a/src/dbc/scala/dbc/Vendor.scala +++ b/src/dbc/scala/dbc/Vendor.scala @@ -19,7 +19,7 @@ import java.sql.{Connection, Driver}; */ abstract class Vendor { - def nativeDriverClass: Class[Driver]; + def nativeDriverClass: Class[_]; def uri: java.net.URI; def user: String; def pass: String; diff --git a/src/library/scala/xml/include/sax/XIncludeFilter.scala b/src/library/scala/xml/include/sax/XIncludeFilter.scala index 7a0bcfe1fc..19dc5ecead 100644 --- a/src/library/scala/xml/include/sax/XIncludeFilter.scala +++ b/src/library/scala/xml/include/sax/XIncludeFilter.scala @@ -96,8 +96,8 @@ class XIncludeFilter extends XMLFilterImpl { final val XINCLUDE_NAMESPACE = "http://www.w3.org/2001/XInclude"; - private val bases = new Stack(); - private val locators = new Stack(); + private val bases = new Stack[URL](); + private val locators = new Stack[Locator](); /* private EntityResolver resolver; diff --git a/src/library/scala/xml/include/sax/XIncluder.scala b/src/library/scala/xml/include/sax/XIncluder.scala index 79c1807fb9..bac9c9d82e 100644 --- a/src/library/scala/xml/include/sax/XIncluder.scala +++ b/src/library/scala/xml/include/sax/XIncluder.scala @@ -146,7 +146,7 @@ with ContentHandler with LexicalHandler { // LexicalHandler methods private var inDTD: Boolean = false - private val entities: Stack = new Stack() + private val entities = new Stack[String]() def startDTD(name: String, publicID: String, systemID: String) { inDTD = true |