diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/files/pos/t5198.scala | 15 | ||||
-rw-r--r-- | test/files/presentation/patmat.flags | 1 | ||||
-rw-r--r-- | test/files/run/reify_fors.flags | 1 | ||||
-rw-r--r-- | test/files/run/reify_maps.flags | 1 | ||||
-rw-r--r-- | test/files/run/repl-suppressed-warnings.scala | 2 | ||||
-rw-r--r-- | test/files/run/t4536.check | 8 | ||||
-rw-r--r-- | test/files/run/t4536.scala | 46 | ||||
-rw-r--r-- | test/files/run/t5272_1.flags | 1 | ||||
-rw-r--r-- | test/files/run/t5272_2.flags | 1 | ||||
-rw-r--r-- | test/files/run/t5273_1.flags | 1 | ||||
-rw-r--r-- | test/files/run/t5273_2a.flags | 1 | ||||
-rw-r--r-- | test/files/run/t5273_2b.flags | 1 | ||||
-rw-r--r-- | test/pending/neg/t5618.check | 7 | ||||
-rw-r--r-- | test/pending/neg/t5618.scala | 27 | ||||
-rw-r--r-- | test/pending/pos/t4683.scala | 11 | ||||
-rw-r--r-- | test/pending/pos/t5240.scala | 11 | ||||
-rw-r--r-- | test/pending/pos/t5559.scala | 23 | ||||
-rw-r--r-- | test/pending/pos/t5606.scala | 9 | ||||
-rw-r--r-- | test/pending/run/t5514.scala | 35 |
19 files changed, 193 insertions, 9 deletions
diff --git a/test/files/pos/t5198.scala b/test/files/pos/t5198.scala new file mode 100644 index 0000000000..f403f77f7d --- /dev/null +++ b/test/files/pos/t5198.scala @@ -0,0 +1,15 @@ +package gaga + + + + + +trait Sys[Self <: Sys[Self]] { + type Tx +} + + +sealed trait AssocEntry[S <: Sys[S], @specialized(Int) A] { + def value: A + def value(implicit tx: S#Tx): A +} diff --git a/test/files/presentation/patmat.flags b/test/files/presentation/patmat.flags index 468b48c9e3..dc13682c5e 100644 --- a/test/files/presentation/patmat.flags +++ b/test/files/presentation/patmat.flags @@ -1,3 +1,2 @@ # This test will fail in the new pattern matcher because # it generates trees whose positions are not transparent --Xoldpatmat diff --git a/test/files/run/reify_fors.flags b/test/files/run/reify_fors.flags index ba80cad69b..e69de29bb2 100644 --- a/test/files/run/reify_fors.flags +++ b/test/files/run/reify_fors.flags @@ -1 +0,0 @@ --Xoldpatmat diff --git a/test/files/run/reify_maps.flags b/test/files/run/reify_maps.flags index ba80cad69b..e69de29bb2 100644 --- a/test/files/run/reify_maps.flags +++ b/test/files/run/reify_maps.flags @@ -1 +0,0 @@ --Xoldpatmat diff --git a/test/files/run/repl-suppressed-warnings.scala b/test/files/run/repl-suppressed-warnings.scala index 9afbbaf1a5..1a51afe34f 100644 --- a/test/files/run/repl-suppressed-warnings.scala +++ b/test/files/run/repl-suppressed-warnings.scala @@ -1,7 +1,7 @@ import scala.tools.partest.ReplTest object Test extends ReplTest { - override def extraSettings = "-Xoldpatmat" + override def extraSettings = "" def code = """ // "Is this thing on?" Not working on first couple diff --git a/test/files/run/t4536.check b/test/files/run/t4536.check new file mode 100644 index 0000000000..0c5a72ada7 --- /dev/null +++ b/test/files/run/t4536.check @@ -0,0 +1,8 @@ +cls: bar +obj: foo +obj: bar +cls: bar +obj: bar +trait: pili +trait: mili +trait: foo
\ No newline at end of file diff --git a/test/files/run/t4536.scala b/test/files/run/t4536.scala new file mode 100644 index 0000000000..acd91deb7f --- /dev/null +++ b/test/files/run/t4536.scala @@ -0,0 +1,46 @@ + + + + + + +object dynamicObject extends Dynamic { + def applyDynamic(m: String)() = println("obj: " + m); + this.foo() +} + + +class dynamicClass extends Dynamic { + def applyDynamic(m: String)() = println("cls: " + m); + this.bar() + dynamicObject.bar() +} + + +abstract class dynamicAbstractClass extends Dynamic { + def applyDynamic(m: String)(args: Any*): Unit + this.pili(1, new dynamicClass, "hello"); +} + + +trait dynamicTrait extends Dynamic { + def applyDynamic(m: String)(args: Any*) = println("trait: " + m); + def two = 2 + this.mili(1,2,3) + two +} + + +object dynamicMixin extends dynamicAbstractClass with dynamicTrait { + this.foo(None) +} + + +object Test { + + def main(args: Array[String]) { + val cls = new dynamicClass + dynamicMixin + } + +} diff --git a/test/files/run/t5272_1.flags b/test/files/run/t5272_1.flags index cb8324a345..e69de29bb2 100644 --- a/test/files/run/t5272_1.flags +++ b/test/files/run/t5272_1.flags @@ -1 +0,0 @@ --Xoldpatmat
\ No newline at end of file diff --git a/test/files/run/t5272_2.flags b/test/files/run/t5272_2.flags index cb8324a345..e69de29bb2 100644 --- a/test/files/run/t5272_2.flags +++ b/test/files/run/t5272_2.flags @@ -1 +0,0 @@ --Xoldpatmat
\ No newline at end of file diff --git a/test/files/run/t5273_1.flags b/test/files/run/t5273_1.flags index ba80cad69b..e69de29bb2 100644 --- a/test/files/run/t5273_1.flags +++ b/test/files/run/t5273_1.flags @@ -1 +0,0 @@ --Xoldpatmat diff --git a/test/files/run/t5273_2a.flags b/test/files/run/t5273_2a.flags index ba80cad69b..e69de29bb2 100644 --- a/test/files/run/t5273_2a.flags +++ b/test/files/run/t5273_2a.flags @@ -1 +0,0 @@ --Xoldpatmat diff --git a/test/files/run/t5273_2b.flags b/test/files/run/t5273_2b.flags index ba80cad69b..e69de29bb2 100644 --- a/test/files/run/t5273_2b.flags +++ b/test/files/run/t5273_2b.flags @@ -1 +0,0 @@ --Xoldpatmat diff --git a/test/pending/neg/t5618.check b/test/pending/neg/t5618.check new file mode 100644 index 0000000000..118e812ae4 --- /dev/null +++ b/test/pending/neg/t5618.check @@ -0,0 +1,7 @@ +t5618.scala:12: error: could not find implicit value for parameter class1: Class1 + val class2 = new Class2 + ^ +t5618.scala:18: error: could not find implicit value for parameter class1: Class1 + val class2 = new Class2 + ^ +two errors found
\ No newline at end of file diff --git a/test/pending/neg/t5618.scala b/test/pending/neg/t5618.scala new file mode 100644 index 0000000000..66e06787f1 --- /dev/null +++ b/test/pending/neg/t5618.scala @@ -0,0 +1,27 @@ + + + + +case class Class1 + + +case class Class2(implicit class1: Class1) + + +object Test1 { + val class2 = new Class2 + implicit val class1 = new Class1 +} + + +object Test2 { + val class2 = new Class2 + implicit val class1: Class1 = new Class1 +} + + +object Test3 { + implicit val class1 = new Class1 + val class2 = new Class2 +} + diff --git a/test/pending/pos/t4683.scala b/test/pending/pos/t4683.scala new file mode 100644 index 0000000000..7af7024159 --- /dev/null +++ b/test/pending/pos/t4683.scala @@ -0,0 +1,11 @@ + + + + +class DelayedInitTest { + def a = () + class B extends DelayedInit { + a + def delayedInit(body: => Unit) = () + } +} diff --git a/test/pending/pos/t5240.scala b/test/pending/pos/t5240.scala new file mode 100644 index 0000000000..2db689c27d --- /dev/null +++ b/test/pending/pos/t5240.scala @@ -0,0 +1,11 @@ + + + + + + +package object foo { + + var labels: Array[_ <: String] = null + +} diff --git a/test/pending/pos/t5559.scala b/test/pending/pos/t5559.scala new file mode 100644 index 0000000000..586e52cd4f --- /dev/null +++ b/test/pending/pos/t5559.scala @@ -0,0 +1,23 @@ + + + + +object Test { + + class Inv[T] + + def foo[S](interface: Inv[_ >: S], implementation: Inv[S]) {} + + def bar[R, T <: R](interface: Inv[R], impl: Inv[T]) { + //foo[T](interface, impl) + foo(interface, impl) // Compilation Error + // Inv[R] <: Inv[_ >: S] + // Inv[T] <: Inv[S] + // ---------------------- + // R >: S + // T == S + } + +} + + diff --git a/test/pending/pos/t5606.scala b/test/pending/pos/t5606.scala new file mode 100644 index 0000000000..2545271e32 --- /dev/null +++ b/test/pending/pos/t5606.scala @@ -0,0 +1,9 @@ + + + + + + + + +case class CaseTest[_](someData:String) diff --git a/test/pending/run/t5514.scala b/test/pending/run/t5514.scala new file mode 100644 index 0000000000..eacad21cd8 --- /dev/null +++ b/test/pending/run/t5514.scala @@ -0,0 +1,35 @@ + + + +import scala.io.Source +import scala.util.parsing.combinator.Parsers +import scala.util.parsing.input.Reader +import scala.util.parsing.input.Position + + + +object DemoApp extends App { + val parsers = new DemoParsers + val reader = new DemoReader(10) + val result = parsers.startsWith("s").*(reader) + Console println result +} + + +class DemoReader(n: Int) extends Reader[String] { + def atEnd = n == 0 + def first = "s" + n + def rest = new DemoReader(n - 1) + def pos = new Position { + def line = 0 + def column = 0 + def lineContents = first + } + println("reader: " + n) +} + + +class DemoParsers extends Parsers { + type Elem = String + def startsWith(prefix: String) = acceptIf(_ startsWith prefix)("Error: " + _) +} |