summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-02-03 10:36:17 -0800
committerPaul Phillips <paulp@improving.org>2012-02-03 12:47:19 -0800
commit8c7005fc90008b6874431d318b482c2ad985181a (patch)
treeabec4ca8192e8500df925325516ad6379c9e7b1f /src
parent4aa290f3ba9b1b4029304f4d19e90e68ab18d781 (diff)
downloadscala-8c7005fc90008b6874431d318b482c2ad985181a.tar.gz
scala-8c7005fc90008b6874431d318b482c2ad985181a.tar.bz2
scala-8c7005fc90008b6874431d318b482c2ad985181a.zip
Eliminated ScalaObject.
"This too shall pass."
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/reflect/internal/TreeGen.scala8
-rw-r--r--src/compiler/scala/tools/nsc/transform/UnCurry.scala2
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Namers.scala11
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/RefChecks.scala5
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala2
-rw-r--r--src/library/scala/Proxy.scala3
6 files changed, 23 insertions, 8 deletions
diff --git a/src/compiler/scala/reflect/internal/TreeGen.scala b/src/compiler/scala/reflect/internal/TreeGen.scala
index d0c5bc8e5b..def1350187 100644
--- a/src/compiler/scala/reflect/internal/TreeGen.scala
+++ b/src/compiler/scala/reflect/internal/TreeGen.scala
@@ -10,10 +10,10 @@ abstract class TreeGen {
def rootId(name: Name) = Select(Ident(nme.ROOTPKG), name)
def rootScalaDot(name: Name) = Select(rootId(nme.scala_) setSymbol ScalaPackage, name)
def scalaDot(name: Name) = Select(Ident(nme.scala_) setSymbol ScalaPackage, name)
- def scalaAnyRefConstr = scalaDot(tpnme.AnyRef)
- def scalaUnitConstr = scalaDot(tpnme.Unit)
- def productConstr = scalaDot(tpnme.Product)
- def serializableConstr = scalaDot(tpnme.Serializable)
+ def scalaAnyRefConstr = scalaDot(tpnme.AnyRef) setSymbol AnyRefClass
+ def scalaUnitConstr = scalaDot(tpnme.Unit) setSymbol UnitClass
+ def productConstr = scalaDot(tpnme.Product) setSymbol ProductRootClass
+ def serializableConstr = scalaDot(tpnme.Serializable) setSymbol SerializableClass
def scalaFunctionConstr(argtpes: List[Tree], restpe: Tree, abstractFun: Boolean = false): Tree = {
val cls = if (abstractFun)
diff --git a/src/compiler/scala/tools/nsc/transform/UnCurry.scala b/src/compiler/scala/tools/nsc/transform/UnCurry.scala
index ab4a2141a9..adbb7bc7f1 100644
--- a/src/compiler/scala/tools/nsc/transform/UnCurry.scala
+++ b/src/compiler/scala/tools/nsc/transform/UnCurry.scala
@@ -633,7 +633,7 @@ abstract class UnCurry extends InfoTransform
tree1
}
} setType {
- assert(tree.tpe != null, tree + " tpe is null")
+ assert(tree.tpe != null, "tpe is null at " + tree.pos + " for " + tree.summaryString + " / " + tree)
uncurryTreeType(tree.tpe)
}
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
index 7bb9ab2fc9..35ee46363c 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
@@ -705,6 +705,17 @@ trait Namers extends MethodSynthesis {
if (needsCycleCheck && !typer.checkNonCyclic(tree.pos, tp))
sym setInfo ErrorType
}
+ tree match {
+ case ClassDef(_, _, _, impl) =>
+ val parentsOK = (
+ treeInfo.isInterface(sym, impl.body)
+ || (sym eq ArrayClass)
+ || (sym isSubClass AnyValClass)
+ )
+ if (!parentsOK)
+ ensureParent(sym, AnyRefClass)
+ case _ => ()
+ }
}
def moduleClassTypeCompleter(tree: Tree) = {
diff --git a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
index 21c1b8aa11..04213cfda7 100644
--- a/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
@@ -1482,7 +1482,10 @@ abstract class RefChecks extends InfoTransform with reflect.internal.transform.R
if (settings.Xmigration28.value)
checkMigration(sym, tree.pos)
- if (currentClass != sym.owner && sym.hasLocalFlag) {
+ if (sym eq NoSymbol) {
+ unit.warning(tree.pos, "Select node has NoSymbol! " + tree + " / " + tree.tpe)
+ }
+ else if (currentClass != sym.owner && sym.hasLocalFlag) {
var o = currentClass
var hidden = false
while (!hidden && o != sym.owner && o != sym.owner.moduleClass && !o.isPackage) {
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index f6cc71c0ca..a20e78a81f 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -1196,7 +1196,7 @@ trait Typers extends Modes with Adaptations with PatMatVirtualiser {
}
def parentTypes(templ: Template): List[Tree] =
- if (templ.parents.isEmpty) List()
+ if (templ.parents.isEmpty) List(TypeTree(AnyRefClass.tpe))
else try {
val clazz = context.owner
// Normalize supertype and mixins so that supertype is always a class, not a trait.
diff --git a/src/library/scala/Proxy.scala b/src/library/scala/Proxy.scala
index 16c3c3fa56..7102ed0db2 100644
--- a/src/library/scala/Proxy.scala
+++ b/src/library/scala/Proxy.scala
@@ -22,7 +22,8 @@ package scala
* @author Matthias Zenger
* @version 1.0, 26/04/2004
*/
-trait Proxy extends Any {
+// trait Proxy extends Any {
+trait Proxy {
def self: Any
override def hashCode: Int = self.hashCode