summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2010-12-09 10:33:13 +0000
committerAdriaan Moors <adriaan.moors@epfl.ch>2010-12-09 10:33:13 +0000
commit3bbe3c70a3dcd32ce2f2b19c192c76871472d095 (patch)
tree1efd5518dcb423cc27350bfdc4cc91980930031e
parentff7589681dc8be7517c76e16acd3285ef1bb899c (diff)
downloadscala-3bbe3c70a3dcd32ce2f2b19c192c76871472d095.tar.gz
scala-3bbe3c70a3dcd32ce2f2b19c192c76871472d095.tar.bz2
scala-3bbe3c70a3dcd32ce2f2b19c192c76871472d095.zip
closes #4064.
-rw-r--r--src/compiler/scala/tools/nsc/ast/TreeGen.scala4
-rw-r--r--test/files/neg/t4064.check4
-rw-r--r--test/files/neg/t4064.scala5
3 files changed, 11 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/TreeGen.scala b/src/compiler/scala/tools/nsc/ast/TreeGen.scala
index e606b1c6af..e2ff0f6600 100644
--- a/src/compiler/scala/tools/nsc/ast/TreeGen.scala
+++ b/src/compiler/scala/tools/nsc/ast/TreeGen.scala
@@ -128,8 +128,8 @@ abstract class TreeGen {
def stableTypeFor(tree: Tree): Option[Type] = tree match {
case Ident(_) if tree.symbol.isStable =>
Some(singleType(tree.symbol.owner.thisType, tree.symbol))
- case Select(qual, _) if {assert((tree.symbol ne null) && (qual.tpe ne null));
- tree.symbol.isStable && qual.tpe.isStable} =>
+ case Select(qual, _) if ((tree.symbol ne null) && (qual.tpe ne null)) && // turned assert into guard for #4064
+ tree.symbol.isStable && qual.tpe.isStable =>
Some(singleType(qual.tpe, tree.symbol))
case _ =>
None
diff --git a/test/files/neg/t4064.check b/test/files/neg/t4064.check
new file mode 100644
index 0000000000..0d0e20ded1
--- /dev/null
+++ b/test/files/neg/t4064.check
@@ -0,0 +1,4 @@
+t4064.scala:4: error: value FALSE is not a member of object Boolean
+ new Foo[Boolean](Boolean.FALSE)
+ ^
+one error found
diff --git a/test/files/neg/t4064.scala b/test/files/neg/t4064.scala
new file mode 100644
index 0000000000..097a62eae2
--- /dev/null
+++ b/test/files/neg/t4064.scala
@@ -0,0 +1,5 @@
+class Foo[T](v: T) {}
+
+object Test {
+ new Foo[Boolean](Boolean.FALSE)
+} \ No newline at end of file