aboutsummaryrefslogtreecommitdiff
path: root/tests/pos
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-05-16 14:25:39 +0200
committerMartin Odersky <odersky@gmail.com>2014-05-30 14:38:31 +0200
commit315c097d3a72077512fa06d7c26e8ad09a8b3f66 (patch)
treebe8502f05c4bb84580ba2e72e39b16b2fb029918 /tests/pos
parent996f47d48c3c10c51da58558643ec02844e45687 (diff)
downloaddotty-315c097d3a72077512fa06d7c26e8ad09a8b3f66.tar.gz
dotty-315c097d3a72077512fa06d7c26e8ad09a8b3f66.tar.bz2
dotty-315c097d3a72077512fa06d7c26e8ad09a8b3f66.zip
Triage of tests t27xx-t29xx.
Diffstat (limited to 'tests/pos')
-rw-r--r--tests/pos/t2708.scala1
-rw-r--r--tests/pos/t2726/SQLBuilder_1.scala7
-rw-r--r--tests/pos/t2726/t2726_2.scala3
-rw-r--r--tests/pos/t2741/2741_1.scala9
-rw-r--r--tests/pos/t2741/2741_2.scala5
-rw-r--r--tests/pos/t2794.scala9
-rw-r--r--tests/pos/t2797.scala9
-rw-r--r--tests/pos/t2799.flags1
-rw-r--r--tests/pos/t2799.scala1
-rw-r--r--tests/pos/t2809.scala20
-rw-r--r--tests/pos/t2810.scala8
-rw-r--r--tests/pos/t284-pos.scala5
-rw-r--r--tests/pos/t287.scala12
-rw-r--r--tests/pos/t289.scala5
-rw-r--r--tests/pos/t2910.scala33
-rw-r--r--tests/pos/t2939.scala13
-rw-r--r--tests/pos/t295.scala2
-rw-r--r--tests/pos/t296.scala3
-rw-r--r--tests/pos/t2973.scala1
-rw-r--r--tests/pos/tuplePatDef.scala4
20 files changed, 151 insertions, 0 deletions
diff --git a/tests/pos/t2708.scala b/tests/pos/t2708.scala
new file mode 100644
index 000000000..19485bf4c
--- /dev/null
+++ b/tests/pos/t2708.scala
@@ -0,0 +1 @@
+class Foo(@volatile var v: Int)
diff --git a/tests/pos/t2726/SQLBuilder_1.scala b/tests/pos/t2726/SQLBuilder_1.scala
new file mode 100644
index 000000000..8d07a8826
--- /dev/null
+++ b/tests/pos/t2726/SQLBuilder_1.scala
@@ -0,0 +1,7 @@
+class SQLBuilder extends SQLBuilder.Segment
+
+object SQLBuilder {
+ trait Segment
+}
+
+
diff --git a/tests/pos/t2726/t2726_2.scala b/tests/pos/t2726/t2726_2.scala
new file mode 100644
index 000000000..e738143ae
--- /dev/null
+++ b/tests/pos/t2726/t2726_2.scala
@@ -0,0 +1,3 @@
+object SQuery2Test {
+ new SQLBuilder
+}
diff --git a/tests/pos/t2741/2741_1.scala b/tests/pos/t2741/2741_1.scala
new file mode 100644
index 000000000..d9d04f7ab
--- /dev/null
+++ b/tests/pos/t2741/2741_1.scala
@@ -0,0 +1,9 @@
+trait Partial {
+ type Apply[XYZ] = List[XYZ]
+}
+trait MA[M[_]]
+trait MAs {
+ val a: MA[Partial#Apply] = null // after compilation, the type is pickled as `MA[ [B] List[B] ]`
+}
+
+object Scalaz extends MAs
diff --git a/tests/pos/t2741/2741_2.scala b/tests/pos/t2741/2741_2.scala
new file mode 100644
index 000000000..a9fd9d7d0
--- /dev/null
+++ b/tests/pos/t2741/2741_2.scala
@@ -0,0 +1,5 @@
+// object Test compiles jointly, but not separately.
+object Test {
+ import Scalaz._
+ Scalaz.a
+}
diff --git a/tests/pos/t2794.scala b/tests/pos/t2794.scala
new file mode 100644
index 000000000..a17edf8cb
--- /dev/null
+++ b/tests/pos/t2794.scala
@@ -0,0 +1,9 @@
+class Key[T]
+
+class Entry[T](val k: Key[T], val v: T)
+
+object Entry {
+
+ def makeDefault[T >: Null <: AnyRef] = new Entry[T](new Key[T], null: T)
+
+}
diff --git a/tests/pos/t2797.scala b/tests/pos/t2797.scala
new file mode 100644
index 000000000..cf579d8de
--- /dev/null
+++ b/tests/pos/t2797.scala
@@ -0,0 +1,9 @@
+class MyVector[A] {
+ def map[B](f: A => B): MyVector[B] = sys.error("")
+}
+
+object Test {
+ def unzip[B, C](_this: MyVector[(B, C)]): (MyVector[B], MyVector[C]) = {
+ (_this.map{ bc => bc._1 }, _this.map{ bc => bc._2 })
+ }
+}
diff --git a/tests/pos/t2799.flags b/tests/pos/t2799.flags
new file mode 100644
index 000000000..d1b831ea8
--- /dev/null
+++ b/tests/pos/t2799.flags
@@ -0,0 +1 @@
+-deprecation -Xfatal-warnings \ No newline at end of file
diff --git a/tests/pos/t2799.scala b/tests/pos/t2799.scala
new file mode 100644
index 000000000..7710cce26
--- /dev/null
+++ b/tests/pos/t2799.scala
@@ -0,0 +1 @@
+@deprecated("hi mom", "") case class Bob ()
diff --git a/tests/pos/t2809.scala b/tests/pos/t2809.scala
new file mode 100644
index 000000000..1f68b0b07
--- /dev/null
+++ b/tests/pos/t2809.scala
@@ -0,0 +1,20 @@
+package p1 {
+ abstract class T1 {
+ protected def bug(p: Int = 1): Int // without 'protected' compiles fine
+ }
+}
+package p2 { // all being in the same package compiles fine
+ import p1._
+ abstract class T2 extends T1 {
+ class A {
+ bug()
+ }
+ }
+
+ abstract class T3 extends T2 {
+ class A {
+ bug()
+ }
+ }
+}
+
diff --git a/tests/pos/t2810.scala b/tests/pos/t2810.scala
new file mode 100644
index 000000000..c85eca164
--- /dev/null
+++ b/tests/pos/t2810.scala
@@ -0,0 +1,8 @@
+
+
+
+
+object Test {
+ val closeable1: { def close(): Unit } = new scala.io.Source { val iter: Iterator[Char] = "".iterator }
+ val closeable2: { def close(): Unit } = new java.io.Closeable { def close() = {} }
+}
diff --git a/tests/pos/t284-pos.scala b/tests/pos/t284-pos.scala
new file mode 100644
index 000000000..40277e2db
--- /dev/null
+++ b/tests/pos/t284-pos.scala
@@ -0,0 +1,5 @@
+trait B[T] {
+ def f1(a: T): Unit { }
+ def f2(a: T): Unit
+ def f3(a: T): Unit = { }
+}
diff --git a/tests/pos/t287.scala b/tests/pos/t287.scala
new file mode 100644
index 000000000..8e5e8831c
--- /dev/null
+++ b/tests/pos/t287.scala
@@ -0,0 +1,12 @@
+object testBuf {
+ class mystream extends java.io.BufferedOutputStream(new java.io.FileOutputStream("/dev/null")) {
+ def w( x:String ):Unit = {
+ val foo = new Array[Byte](2);
+
+ // write( byte[] ) is defined in FilterOutputStream, the superclass of BufferedOutputStream
+ super.write( foo ); // error
+
+ super.write( foo, 0, foo.length ); // this works however
+ }
+ }
+}
diff --git a/tests/pos/t289.scala b/tests/pos/t289.scala
new file mode 100644
index 000000000..96c0244df
--- /dev/null
+++ b/tests/pos/t289.scala
@@ -0,0 +1,5 @@
+class A {
+ object B;
+}
+
+object C extends A;
diff --git a/tests/pos/t2910.scala b/tests/pos/t2910.scala
new file mode 100644
index 000000000..f9f2c87a9
--- /dev/null
+++ b/tests/pos/t2910.scala
@@ -0,0 +1,33 @@
+object Test {
+ def test1: Unit = {
+ C
+ object C
+ }
+
+ def test2: Unit = {
+ println(s.length)
+ lazy val s = "abc"
+ }
+
+ def test3: Unit = {
+ lazy val lazyBar = bar
+ object bar {
+ val foo = 12
+ }
+ lazy val lazyBar2 = bar
+ }
+
+ def test4: Unit = {
+ lazy val x = {
+ x
+ lazy val x = 12
+ 0
+ }
+ }
+
+ def test5: Unit = {
+ lazy val f: Int = g
+ Console.println("foo")
+ lazy val g: Int = f
+ }
+}
diff --git a/tests/pos/t2939.scala b/tests/pos/t2939.scala
new file mode 100644
index 000000000..57dd52024
--- /dev/null
+++ b/tests/pos/t2939.scala
@@ -0,0 +1,13 @@
+import collection._
+
+object Proxies {
+ class C1 extends MapProxy[Int,Int] { def self = Map[Int,Int]() }
+ class C2 extends mutable.MapProxy[Int,Int] { def self = mutable.Map[Int,Int]() }
+ class C3 extends immutable.MapProxy[Int,Int] { def self = immutable.Map[Int,Int]() }
+
+ class C4 extends SetProxy[Int] { def self = Set[Int]() }
+ class C5 extends mutable.SetProxy[Int] { def self = mutable.Set[Int]() }
+ class C6 extends immutable.SetProxy[Int] { def self = immutable.Set[Int]() }
+
+ class C7 extends SeqProxy[Int] { def self = Seq[Int]() }
+}
diff --git a/tests/pos/t295.scala b/tests/pos/t295.scala
new file mode 100644
index 000000000..22c7beff4
--- /dev/null
+++ b/tests/pos/t295.scala
@@ -0,0 +1,2 @@
+object Test extends java.rmi.server.UnicastRemoteObject {
+}
diff --git a/tests/pos/t296.scala b/tests/pos/t296.scala
new file mode 100644
index 000000000..0c267a307
--- /dev/null
+++ b/tests/pos/t296.scala
@@ -0,0 +1,3 @@
+object Bug {
+ def foo (l: => String) : String = 12 match { case _ => l}
+}
diff --git a/tests/pos/t2973.scala b/tests/pos/t2973.scala
new file mode 100644
index 000000000..f5dde856d
--- /dev/null
+++ b/tests/pos/t2973.scala
@@ -0,0 +1 @@
+package foo {}; package bar {}; package baz {}
diff --git a/tests/pos/tuplePatDef.scala b/tests/pos/tuplePatDef.scala
new file mode 100644
index 000000000..22f8f8e7d
--- /dev/null
+++ b/tests/pos/tuplePatDef.scala
@@ -0,0 +1,4 @@
+
+object Test {
+ val (x,y): (String, Int) = null
+}