summaryrefslogtreecommitdiff
path: root/test/files/pos
diff options
context:
space:
mode:
authorAntonio Cunei <antonio.cunei@epfl.ch>2011-04-20 12:19:47 +0000
committerAntonio Cunei <antonio.cunei@epfl.ch>2011-04-20 12:19:47 +0000
commit517acfdd56af4562d3c4f2963f656f2834ca23e2 (patch)
tree609c95d6aafff786460300162991ce5b31fe8c32 /test/files/pos
parente5ad9c55f8a7a97aa7c36a057078db2031f468e8 (diff)
downloadscala-517acfdd56af4562d3c4f2963f656f2834ca23e2.tar.gz
scala-517acfdd56af4562d3c4f2963f656f2834ca23e2.tar.bz2
scala-517acfdd56af4562d3c4f2963f656f2834ca23e2.zip
Fixing an incomplete svnmerge; second, merge ag...
Fixing an incomplete svnmerge; second, merge again from trunk.
Diffstat (limited to 'test/files/pos')
-rw-r--r--test/files/pos/bug1071.scala17
-rw-r--r--test/files/pos/bug4275.scala13
-rw-r--r--test/files/pos/spec-List.scala2
-rw-r--r--test/files/pos/t2799.scala2
-rw-r--r--test/files/pos/t4402/A.scala3
-rw-r--r--test/files/pos/t4402/Bar.java7
-rw-r--r--test/files/pos/t4402/Foo.java8
-rw-r--r--test/files/pos/t4432.scala42
8 files changed, 92 insertions, 2 deletions
diff --git a/test/files/pos/bug1071.scala b/test/files/pos/bug1071.scala
new file mode 100644
index 0000000000..59149a021b
--- /dev/null
+++ b/test/files/pos/bug1071.scala
@@ -0,0 +1,17 @@
+class C {
+ private val a = 0
+ def getA = a
+}
+
+class D(c: C) {
+ def a = c.getA
+}
+
+object Test {
+ implicit def c2d(c: C): D = new D(c)
+
+ val c = new C
+ (c: D).a // works
+ c.a // error
+}
+
diff --git a/test/files/pos/bug4275.scala b/test/files/pos/bug4275.scala
new file mode 100644
index 0000000000..1938aceadc
--- /dev/null
+++ b/test/files/pos/bug4275.scala
@@ -0,0 +1,13 @@
+object Test {
+ def f = "abc".count(_ > 'a')
+
+ class A {
+ private val count: Int = 0
+ }
+ class B extends A { }
+ object B {
+ implicit def b2seq(x: B): Seq[Int] = Nil
+
+ def f = (new B) count (_ > 0)
+ }
+}
diff --git a/test/files/pos/spec-List.scala b/test/files/pos/spec-List.scala
index e3055f3051..04ab7d1543 100644
--- a/test/files/pos/spec-List.scala
+++ b/test/files/pos/spec-List.scala
@@ -144,7 +144,7 @@ sealed trait List[@specialized +A] extends LinearSeq[A]
/** Create a new list which contains all elements of this list
* followed by all elements of Traversable `that'
*/
- override def ++[B >: A, That](xs: TraversableOnce[B])(implicit bf: CanBuildFrom[List[A], B, That]): That = {
+ override def ++[B >: A, That](xs: GenTraversableOnce[B])(implicit bf: CanBuildFrom[List[A], B, That]): That = {
val b = bf(this)
if (b.isInstanceOf[ListBuffer[_]]) (this ::: xs.toList).asInstanceOf[That]
else super.++(xs)
diff --git a/test/files/pos/t2799.scala b/test/files/pos/t2799.scala
index fe93c0e301..7710cce26c 100644
--- a/test/files/pos/t2799.scala
+++ b/test/files/pos/t2799.scala
@@ -1 +1 @@
-@deprecated("hi mom") case class Bob ()
+@deprecated("hi mom", "") case class Bob ()
diff --git a/test/files/pos/t4402/A.scala b/test/files/pos/t4402/A.scala
new file mode 100644
index 0000000000..f43f0865f0
--- /dev/null
+++ b/test/files/pos/t4402/A.scala
@@ -0,0 +1,3 @@
+package ohmy
+
+class A extends other.Bar
diff --git a/test/files/pos/t4402/Bar.java b/test/files/pos/t4402/Bar.java
new file mode 100644
index 0000000000..edc00a5fd1
--- /dev/null
+++ b/test/files/pos/t4402/Bar.java
@@ -0,0 +1,7 @@
+package other;
+
+public class Bar extends test.Foo {
+ void createMeSth(test.Foo.Inner aaa) {
+ aaa.hello();
+ }
+}
diff --git a/test/files/pos/t4402/Foo.java b/test/files/pos/t4402/Foo.java
new file mode 100644
index 0000000000..585a5e0a2c
--- /dev/null
+++ b/test/files/pos/t4402/Foo.java
@@ -0,0 +1,8 @@
+package test;
+
+public abstract class Foo {
+ protected interface Inner {
+ public void hello();
+ }
+}
+
diff --git a/test/files/pos/t4432.scala b/test/files/pos/t4432.scala
new file mode 100644
index 0000000000..106312311a
--- /dev/null
+++ b/test/files/pos/t4432.scala
@@ -0,0 +1,42 @@
+object Main {
+ def foo1 = {
+ class A {
+ val x = {
+ lazy val cc = 1 //
+ cc
+ ()
+ }
+ }
+ new A
+ }
+
+ def foo2 = {
+ class B {
+ val x = {
+ object cc
+ cc
+ ()
+ }
+ }
+ new B
+ }
+
+ def foo3 = {
+ object C {
+ val x = {
+ lazy val cc = 1
+ cc
+ }
+ }
+ C
+ }
+
+ def foo4 = {
+ class D {
+ lazy val cc = 1
+ cc
+ }
+ new D
+ }
+
+}