diff options
author | Martin Odersky <odersky@gmail.com> | 2014-03-16 18:39:36 +0100 |
---|---|---|
committer | Tobias Schlatter <tobias@meisch.ch> | 2014-03-21 11:24:03 +0100 |
commit | 6436fa67e561442ef2e2d9b99852a50f323ccacc (patch) | |
tree | 9063ea5a0df1f01fb69ef64dcf0ef638e63f54e2 /tests | |
parent | 6f1ef32d728320c31cc59daad0f4849c9cd0a87c (diff) | |
download | dotty-6436fa67e561442ef2e2d9b99852a50f323ccacc.tar.gz dotty-6436fa67e561442ef2e2d9b99852a50f323ccacc.tar.bz2 dotty-6436fa67e561442ef2e2d9b99852a50f323ccacc.zip |
More tests
Added more tests which all pass, except for tests in disabled and pending.
t0694 went from pos to neg, because the kind of alias type used in t0695 is no longer supported.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/disabled/java-interop/pos/t0695/JavaClass.java | 5 | ||||
-rw-r--r-- | tests/disabled/java-interop/pos/t0695/Test.scala | 3 | ||||
-rw-r--r-- | tests/neg/t0654.scala | 5 | ||||
-rw-r--r-- | tests/pending/pos/t0625.scala (renamed from tests/untried/pos/t0625.scala) | 0 | ||||
-rw-r--r-- | tests/pos/ostermann.scala | 3 | ||||
-rw-r--r-- | tests/pos/t0301.scala | 12 | ||||
-rw-r--r-- | tests/pos/t0304.scala | 5 | ||||
-rw-r--r-- | tests/pos/t0305.scala | 7 | ||||
-rw-r--r-- | tests/pos/t0453.scala | 6 | ||||
-rw-r--r-- | tests/pos/t0586.scala (renamed from tests/untried/pos/t0586.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t0599.scala (renamed from tests/untried/pos/t0599.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t0644.scala (renamed from tests/untried/pos/t0644.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t0674.scala (renamed from tests/untried/pos/t0674.scala) | 0 | ||||
-rw-r--r-- | tests/untried/pos/t0654.scala | 5 |
14 files changed, 46 insertions, 5 deletions
diff --git a/tests/disabled/java-interop/pos/t0695/JavaClass.java b/tests/disabled/java-interop/pos/t0695/JavaClass.java new file mode 100644 index 000000000..a765f7e32 --- /dev/null +++ b/tests/disabled/java-interop/pos/t0695/JavaClass.java @@ -0,0 +1,5 @@ +public class JavaClass<A> { + class InnerClass { + public A method() { return null; } + } +} diff --git a/tests/disabled/java-interop/pos/t0695/Test.scala b/tests/disabled/java-interop/pos/t0695/Test.scala new file mode 100644 index 000000000..7318867bf --- /dev/null +++ b/tests/disabled/java-interop/pos/t0695/Test.scala @@ -0,0 +1,3 @@ +object Test extends JavaClass[AnyRef] { + var field: InnerClass = null +} diff --git a/tests/neg/t0654.scala b/tests/neg/t0654.scala new file mode 100644 index 000000000..52dbbb014 --- /dev/null +++ b/tests/neg/t0654.scala @@ -0,0 +1,5 @@ +object Test { + class Foo[T] + type C[T] = Foo[_ <: T] // error: parameter type T of type alias does not appear as type argument of the aliased class Foo + val a: C[AnyRef] = new Foo[AnyRef] // follow-on error: wrong number of type arguments for Test.C, should be 0 +} diff --git a/tests/untried/pos/t0625.scala b/tests/pending/pos/t0625.scala index 561454259..561454259 100644 --- a/tests/untried/pos/t0625.scala +++ b/tests/pending/pos/t0625.scala diff --git a/tests/pos/ostermann.scala b/tests/pos/ostermann.scala new file mode 100644 index 000000000..f3acafc72 --- /dev/null +++ b/tests/pos/ostermann.scala @@ -0,0 +1,3 @@ +trait A { def foo(a: A) : Unit } + +trait C extends A { override def foo(a: A with Any) : Unit } diff --git a/tests/pos/t0301.scala b/tests/pos/t0301.scala new file mode 100644 index 000000000..24b477601 --- /dev/null +++ b/tests/pos/t0301.scala @@ -0,0 +1,12 @@ +package fos + +abstract class Expr +case class Var() extends Expr + +object Analyzer { + def substitution(expr: Expr, cls: (Var,Var)): Expr = + expr match { + case cls._2 => cls._1 // source of the error + case _ => expr + } +} diff --git a/tests/pos/t0304.scala b/tests/pos/t0304.scala new file mode 100644 index 000000000..607a115db --- /dev/null +++ b/tests/pos/t0304.scala @@ -0,0 +1,5 @@ +object O { + def f1 = -1; + def f2 = 0-1; + def f3 = f1 + f2; +} diff --git a/tests/pos/t0305.scala b/tests/pos/t0305.scala new file mode 100644 index 000000000..4838b1fcf --- /dev/null +++ b/tests/pos/t0305.scala @@ -0,0 +1,7 @@ +object Test extends App { + + def foo(is:Int*) = 1; + def foo(i:Int) = 2; + + assert(foo( List(3):_* ) == 1) +} diff --git a/tests/pos/t0453.scala b/tests/pos/t0453.scala new file mode 100644 index 000000000..dfacc5eed --- /dev/null +++ b/tests/pos/t0453.scala @@ -0,0 +1,6 @@ +object Test { + val foo = new { + trait Bar + def l () : Bar = { new Bar {} } + } +} diff --git a/tests/untried/pos/t0586.scala b/tests/pos/t0586.scala index 540e225a1..540e225a1 100644 --- a/tests/untried/pos/t0586.scala +++ b/tests/pos/t0586.scala diff --git a/tests/untried/pos/t0599.scala b/tests/pos/t0599.scala index 885159af6..885159af6 100644 --- a/tests/untried/pos/t0599.scala +++ b/tests/pos/t0599.scala diff --git a/tests/untried/pos/t0644.scala b/tests/pos/t0644.scala index e51ec7df5..e51ec7df5 100644 --- a/tests/untried/pos/t0644.scala +++ b/tests/pos/t0644.scala diff --git a/tests/untried/pos/t0674.scala b/tests/pos/t0674.scala index 589eeec9f..589eeec9f 100644 --- a/tests/untried/pos/t0674.scala +++ b/tests/pos/t0674.scala diff --git a/tests/untried/pos/t0654.scala b/tests/untried/pos/t0654.scala deleted file mode 100644 index 07b4e7279..000000000 --- a/tests/untried/pos/t0654.scala +++ /dev/null @@ -1,5 +0,0 @@ -object Test { - class Foo[T] - type C[T] = Foo[_ <: T] - val a: C[AnyRef] = new Foo[AnyRef] -} |