diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/disabled/java-interop/pos/t2569/Child.scala (renamed from tests/untried/pos/t2569/Child.scala) | 0 | ||||
-rw-r--r-- | tests/disabled/java-interop/pos/t2569/Parent.java (renamed from tests/untried/pos/t2569/Parent.java) | 0 | ||||
-rw-r--r-- | tests/disabled/java-interop/pos/t2764/Ann.java (renamed from tests/untried/pos/t2764/Ann.java) | 0 | ||||
-rw-r--r-- | tests/disabled/java-interop/pos/t2764/Enum.java (renamed from tests/untried/pos/t2764/Enum.java) | 0 | ||||
-rw-r--r-- | tests/disabled/java-interop/pos/t2764/Use.scala (renamed from tests/untried/pos/t2764/Use.scala) | 0 | ||||
-rw-r--r-- | tests/disabled/java-interop/pos/t294/Ann.java (renamed from tests/untried/pos/t294/Ann.java) | 0 | ||||
-rw-r--r-- | tests/disabled/java-interop/pos/t294/Ann2.java (renamed from tests/untried/pos/t294/Ann2.java) | 0 | ||||
-rw-r--r-- | tests/disabled/java-interop/pos/t294/Test_1.scala (renamed from tests/untried/pos/t294/Test_1.scala) | 0 | ||||
-rw-r--r-- | tests/disabled/java-interop/pos/t294/Test_2.scala (renamed from tests/untried/pos/t294/Test_2.scala) | 0 | ||||
-rw-r--r-- | tests/disabled/java-interop/pos/t2940/Cycle.java (renamed from tests/untried/pos/t2940/Cycle.java) | 0 | ||||
-rw-r--r-- | tests/disabled/java-interop/pos/t2940/Error.scala (renamed from tests/untried/pos/t2940/Error.scala) | 0 | ||||
-rw-r--r-- | tests/disabled/java-interop/pos/t2956/BeanDefinitionVisitor.java (renamed from tests/untried/pos/t2956/BeanDefinitionVisitor.java) | 0 | ||||
-rwxr-xr-x | tests/disabled/java-interop/pos/t2956/t2956.scala (renamed from tests/untried/pos/t2956/t2956.scala) | 0 | ||||
-rw-r--r-- | tests/neg/t2994.scala (renamed from tests/untried/pos/t2994a.scala) | 8 | ||||
-rw-r--r-- | tests/pending/pos/t2613.scala | 11 | ||||
-rw-r--r-- | tests/pending/pos/t2693.scala | 6 | ||||
-rw-r--r-- | tests/pending/pos/t2782.scala (renamed from tests/untried/pos/t2782.scala) | 0 | ||||
-rw-r--r-- | tests/pending/pos/t2795-new.scala (renamed from tests/untried/pos/t2795-new.scala) | 0 | ||||
-rw-r--r-- | tests/pending/pos/t2795-old.scala (renamed from tests/untried/pos/t2795-old.scala) | 0 | ||||
-rwxr-xr-x | tests/pending/pos/t2913.scala (renamed from tests/untried/pos/t2913.scala) | 2 | ||||
-rw-r--r-- | tests/pending/pos/t2945.scala (renamed from tests/untried/pos/t2945.scala) | 4 | ||||
-rw-r--r-- | tests/pos/implicitonSelect.scala | 8 | ||||
-rw-r--r-- | tests/pos/resultGuidesInference.scala | 7 | ||||
-rw-r--r-- | tests/pos/t2405.scala (renamed from tests/new/t2405.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t2421.scala (renamed from tests/new/t2421.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t2421_delitedsl.scala (renamed from tests/new/t2421_delitedsl.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t2421b_pos.scala (renamed from tests/new/t2421b_pos.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t2421c.scala (renamed from tests/new/t2421c.scala) | 0 | ||||
-rwxr-xr-x | tests/pos/t2425.scala (renamed from tests/new/t2425.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t2435.scala (renamed from tests/new/t2435.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t2441pos.scala (renamed from tests/new/t2441pos.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t2444.scala (renamed from tests/new/t2444.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t245.scala (renamed from tests/new/t245.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t2454.scala (renamed from tests/pending/pos/t2454.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t247.scala (renamed from tests/new/t247.scala) | 0 | ||||
-rwxr-xr-x | tests/pos/t2484.scala (renamed from tests/new/t2484.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t2486.scala (renamed from tests/new/t2486.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t2500.scala (renamed from tests/untried/pos/t2500.scala) | 0 | ||||
-rwxr-xr-x | tests/pos/t2504.scala (renamed from tests/untried/pos/t2504.scala) | 1 | ||||
-rw-r--r-- | tests/pos/t252.scala (renamed from tests/untried/pos/t252.scala) | 0 | ||||
-rwxr-xr-x | tests/pos/t2545.scala (renamed from tests/untried/pos/t2545.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t2591.scala (renamed from tests/untried/pos/t2591.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t2610.scala | 17 | ||||
-rw-r--r-- | tests/pos/t2619.scala | 80 | ||||
-rw-r--r-- | tests/pos/t262.scala | 14 | ||||
-rw-r--r-- | tests/pos/t2624.scala | 4 | ||||
-rwxr-xr-x | tests/pos/t2635.scala | 16 | ||||
-rw-r--r-- | tests/pos/t2660.scala | 25 | ||||
-rw-r--r-- | tests/pos/t2664.scala | 9 | ||||
-rw-r--r-- | tests/pos/t2665.scala | 3 | ||||
-rw-r--r-- | tests/pos/t2667.scala | 6 | ||||
-rw-r--r-- | tests/pos/t2669.scala | 28 | ||||
-rw-r--r-- | tests/pos/t267.scala | 55 | ||||
-rwxr-xr-x | tests/pos/t2683.scala | 7 | ||||
-rw-r--r-- | tests/pos/t2691.scala | 16 | ||||
-rw-r--r-- | tests/pos/t2698.scala | 14 | ||||
-rw-r--r-- | tests/pos/t2708.scala (renamed from tests/untried/pos/t2708.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t2726/SQLBuilder_1.scala (renamed from tests/untried/pos/t2726/SQLBuilder_1.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t2726/t2726_2.scala (renamed from tests/untried/pos/t2726/t2726_2.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t2741/2741_1.scala (renamed from tests/untried/pos/t2741/2741_1.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t2741/2741_2.scala (renamed from tests/untried/pos/t2741/2741_2.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t2794.scala (renamed from tests/untried/pos/t2794.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t2797.scala (renamed from tests/untried/pos/t2797.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t2799.flags (renamed from tests/untried/pos/t2799.flags) | 0 | ||||
-rw-r--r-- | tests/pos/t2799.scala (renamed from tests/untried/pos/t2799.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t2809.scala (renamed from tests/untried/pos/t2809.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t2810.scala (renamed from tests/untried/pos/t2810.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t284-pos.scala (renamed from tests/untried/pos/t284-pos.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t287.scala (renamed from tests/untried/pos/t287.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t289.scala (renamed from tests/untried/pos/t289.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t2910.scala (renamed from tests/untried/pos/t2910.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t2939.scala (renamed from tests/untried/pos/t2939.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t295.scala (renamed from tests/untried/pos/t295.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t296.scala (renamed from tests/untried/pos/t296.scala) | 0 | ||||
-rw-r--r-- | tests/pos/t2973.scala (renamed from tests/untried/pos/t2973.scala) | 0 | ||||
-rw-r--r-- | tests/pos/test.scala | 6 | ||||
-rw-r--r-- | tests/pos/tuplePatDef.scala | 4 | ||||
-rw-r--r-- | tests/pos/tycons.scala | 22 | ||||
-rw-r--r-- | tests/untried/pos/t2994b.scala | 7 |
79 files changed, 365 insertions, 15 deletions
diff --git a/tests/untried/pos/t2569/Child.scala b/tests/disabled/java-interop/pos/t2569/Child.scala index 64f4dc172..64f4dc172 100644 --- a/tests/untried/pos/t2569/Child.scala +++ b/tests/disabled/java-interop/pos/t2569/Child.scala diff --git a/tests/untried/pos/t2569/Parent.java b/tests/disabled/java-interop/pos/t2569/Parent.java index 89421becb..89421becb 100644 --- a/tests/untried/pos/t2569/Parent.java +++ b/tests/disabled/java-interop/pos/t2569/Parent.java diff --git a/tests/untried/pos/t2764/Ann.java b/tests/disabled/java-interop/pos/t2764/Ann.java index 184fc6e86..184fc6e86 100644 --- a/tests/untried/pos/t2764/Ann.java +++ b/tests/disabled/java-interop/pos/t2764/Ann.java diff --git a/tests/untried/pos/t2764/Enum.java b/tests/disabled/java-interop/pos/t2764/Enum.java index fe0755953..fe0755953 100644 --- a/tests/untried/pos/t2764/Enum.java +++ b/tests/disabled/java-interop/pos/t2764/Enum.java diff --git a/tests/untried/pos/t2764/Use.scala b/tests/disabled/java-interop/pos/t2764/Use.scala index b0c108907..b0c108907 100644 --- a/tests/untried/pos/t2764/Use.scala +++ b/tests/disabled/java-interop/pos/t2764/Use.scala diff --git a/tests/untried/pos/t294/Ann.java b/tests/disabled/java-interop/pos/t294/Ann.java index 934ca4629..934ca4629 100644 --- a/tests/untried/pos/t294/Ann.java +++ b/tests/disabled/java-interop/pos/t294/Ann.java diff --git a/tests/untried/pos/t294/Ann2.java b/tests/disabled/java-interop/pos/t294/Ann2.java index 025b79e79..025b79e79 100644 --- a/tests/untried/pos/t294/Ann2.java +++ b/tests/disabled/java-interop/pos/t294/Ann2.java diff --git a/tests/untried/pos/t294/Test_1.scala b/tests/disabled/java-interop/pos/t294/Test_1.scala index ff1f34b10..ff1f34b10 100644 --- a/tests/untried/pos/t294/Test_1.scala +++ b/tests/disabled/java-interop/pos/t294/Test_1.scala diff --git a/tests/untried/pos/t294/Test_2.scala b/tests/disabled/java-interop/pos/t294/Test_2.scala index 9fb1c6e17..9fb1c6e17 100644 --- a/tests/untried/pos/t294/Test_2.scala +++ b/tests/disabled/java-interop/pos/t294/Test_2.scala diff --git a/tests/untried/pos/t2940/Cycle.java b/tests/disabled/java-interop/pos/t2940/Cycle.java index eef6c23b5..eef6c23b5 100644 --- a/tests/untried/pos/t2940/Cycle.java +++ b/tests/disabled/java-interop/pos/t2940/Cycle.java diff --git a/tests/untried/pos/t2940/Error.scala b/tests/disabled/java-interop/pos/t2940/Error.scala index 92f08f580..92f08f580 100644 --- a/tests/untried/pos/t2940/Error.scala +++ b/tests/disabled/java-interop/pos/t2940/Error.scala diff --git a/tests/untried/pos/t2956/BeanDefinitionVisitor.java b/tests/disabled/java-interop/pos/t2956/BeanDefinitionVisitor.java index 2ff5daa25..2ff5daa25 100644 --- a/tests/untried/pos/t2956/BeanDefinitionVisitor.java +++ b/tests/disabled/java-interop/pos/t2956/BeanDefinitionVisitor.java diff --git a/tests/untried/pos/t2956/t2956.scala b/tests/disabled/java-interop/pos/t2956/t2956.scala index 33803874b..33803874b 100755 --- a/tests/untried/pos/t2956/t2956.scala +++ b/tests/disabled/java-interop/pos/t2956/t2956.scala diff --git a/tests/untried/pos/t2994a.scala b/tests/neg/t2994.scala index f1a4a4a12..f3009b12f 100644 --- a/tests/untried/pos/t2994a.scala +++ b/tests/neg/t2994.scala @@ -25,3 +25,11 @@ object Naturals { } } + +object Test { + trait Bar[X[_]] + trait Baz[S[_] <: Bar[S]] { + type Apply[T] + } + trait Foo[V[_] <: Bar[V]] extends Bar[Baz[V]#Apply] +} diff --git a/tests/pending/pos/t2613.scala b/tests/pending/pos/t2613.scala new file mode 100644 index 000000000..c234d4c0d --- /dev/null +++ b/tests/pending/pos/t2613.scala @@ -0,0 +1,11 @@ +import language.existentials + +object Test { + class Row + + abstract class MyRelation [R <: Row, +Relation <: MyRelation[R, Relation]] + + type M = MyRelation[_ <: Row, _ <: MyRelation] + + val (x,y): (String, M) = null +} diff --git a/tests/pending/pos/t2693.scala b/tests/pending/pos/t2693.scala new file mode 100644 index 000000000..5d4d0380c --- /dev/null +++ b/tests/pending/pos/t2693.scala @@ -0,0 +1,6 @@ +class A { + trait T[A] + def usetHk[T[_], A](ta: T[A]) = 0 + usetHk(new T[Int]{}: T[Int]) + usetHk(new T[Int]{}) // fails with: found: java.lang.Object with T[Int], required: ?T[ ?A ] +} diff --git a/tests/untried/pos/t2782.scala b/tests/pending/pos/t2782.scala index 3b387af80..3b387af80 100644 --- a/tests/untried/pos/t2782.scala +++ b/tests/pending/pos/t2782.scala diff --git a/tests/untried/pos/t2795-new.scala b/tests/pending/pos/t2795-new.scala index e307133e0..e307133e0 100644 --- a/tests/untried/pos/t2795-new.scala +++ b/tests/pending/pos/t2795-new.scala diff --git a/tests/untried/pos/t2795-old.scala b/tests/pending/pos/t2795-old.scala index 935cb1f44..935cb1f44 100644 --- a/tests/untried/pos/t2795-old.scala +++ b/tests/pending/pos/t2795-old.scala diff --git a/tests/untried/pos/t2913.scala b/tests/pending/pos/t2913.scala index 55b72bed4..21700e71a 100755 --- a/tests/untried/pos/t2913.scala +++ b/tests/pending/pos/t2913.scala @@ -1,3 +1,5 @@ +import language.noAutoTupling // try with on and off + class A { def foo(a: Int) = 0 } diff --git a/tests/untried/pos/t2945.scala b/tests/pending/pos/t2945.scala index 0379e9ba1..54f0a7724 100644 --- a/tests/untried/pos/t2945.scala +++ b/tests/pending/pos/t2945.scala @@ -1,9 +1,9 @@ object Foo { def test(s: String) = { (s: Seq[Char]) match { - case Seq('f', 'o', 'o', ' ', rest1 @ _*) => + case Seq('f', 'o', 'o', ' ', rest1: _*) => rest1 - case Seq('b', 'a', 'r', ' ', ' ', rest2 @ _*) => + case Seq('b', 'a', 'r', ' ', ' ', rest2: _*) => rest2 case _ => s diff --git a/tests/pos/implicitonSelect.scala b/tests/pos/implicitonSelect.scala new file mode 100644 index 000000000..4f5f90ada --- /dev/null +++ b/tests/pos/implicitonSelect.scala @@ -0,0 +1,8 @@ +object test { + class A + class B + implicit def a2b(x: A): B = new B + class ARef { val a: A = new A } + val x = new ARef + val b: B = x.a +} diff --git a/tests/pos/resultGuidesInference.scala b/tests/pos/resultGuidesInference.scala new file mode 100644 index 000000000..4e02504e0 --- /dev/null +++ b/tests/pos/resultGuidesInference.scala @@ -0,0 +1,7 @@ +object test { + + def foo[T](x: T => T): Array[T] = ??? + + val x: Array[Int] = foo(x => x) + +} diff --git a/tests/new/t2405.scala b/tests/pos/t2405.scala index 224b2ce83..224b2ce83 100644 --- a/tests/new/t2405.scala +++ b/tests/pos/t2405.scala diff --git a/tests/new/t2421.scala b/tests/pos/t2421.scala index 2544a1cb3..2544a1cb3 100644 --- a/tests/new/t2421.scala +++ b/tests/pos/t2421.scala diff --git a/tests/new/t2421_delitedsl.scala b/tests/pos/t2421_delitedsl.scala index 554702a03..554702a03 100644 --- a/tests/new/t2421_delitedsl.scala +++ b/tests/pos/t2421_delitedsl.scala diff --git a/tests/new/t2421b_pos.scala b/tests/pos/t2421b_pos.scala index 679b8a8d6..679b8a8d6 100644 --- a/tests/new/t2421b_pos.scala +++ b/tests/pos/t2421b_pos.scala diff --git a/tests/new/t2421c.scala b/tests/pos/t2421c.scala index bd24cacd7..bd24cacd7 100644 --- a/tests/new/t2421c.scala +++ b/tests/pos/t2421c.scala diff --git a/tests/new/t2425.scala b/tests/pos/t2425.scala index 477d5467a..477d5467a 100755 --- a/tests/new/t2425.scala +++ b/tests/pos/t2425.scala diff --git a/tests/new/t2435.scala b/tests/pos/t2435.scala index 697e9e1f2..697e9e1f2 100644 --- a/tests/new/t2435.scala +++ b/tests/pos/t2435.scala diff --git a/tests/new/t2441pos.scala b/tests/pos/t2441pos.scala index 25eb2232c..25eb2232c 100644 --- a/tests/new/t2441pos.scala +++ b/tests/pos/t2441pos.scala diff --git a/tests/new/t2444.scala b/tests/pos/t2444.scala index fac1e95d0..fac1e95d0 100644 --- a/tests/new/t2444.scala +++ b/tests/pos/t2444.scala diff --git a/tests/new/t245.scala b/tests/pos/t245.scala index 570ac4178..570ac4178 100644 --- a/tests/new/t245.scala +++ b/tests/pos/t245.scala diff --git a/tests/pending/pos/t2454.scala b/tests/pos/t2454.scala index 00f2e6f67..00f2e6f67 100644 --- a/tests/pending/pos/t2454.scala +++ b/tests/pos/t2454.scala diff --git a/tests/new/t247.scala b/tests/pos/t247.scala index fdcafeb2c..fdcafeb2c 100644 --- a/tests/new/t247.scala +++ b/tests/pos/t247.scala diff --git a/tests/new/t2484.scala b/tests/pos/t2484.scala index 15165c247..15165c247 100755 --- a/tests/new/t2484.scala +++ b/tests/pos/t2484.scala diff --git a/tests/new/t2486.scala b/tests/pos/t2486.scala index 69fe4c127..69fe4c127 100644 --- a/tests/new/t2486.scala +++ b/tests/pos/t2486.scala diff --git a/tests/untried/pos/t2500.scala b/tests/pos/t2500.scala index d0ff99a93..d0ff99a93 100644 --- a/tests/untried/pos/t2500.scala +++ b/tests/pos/t2500.scala diff --git a/tests/untried/pos/t2504.scala b/tests/pos/t2504.scala index 67f822685..72117174c 100755 --- a/tests/untried/pos/t2504.scala +++ b/tests/pos/t2504.scala @@ -1,4 +1,5 @@ object Test { + val zs = Array("abc") val ys: Iterable[_] = Array("abc") val xs = Array("abc") xs sameElements Array("abc") diff --git a/tests/untried/pos/t252.scala b/tests/pos/t252.scala index d51b5511e..d51b5511e 100644 --- a/tests/untried/pos/t252.scala +++ b/tests/pos/t252.scala diff --git a/tests/untried/pos/t2545.scala b/tests/pos/t2545.scala index 6ad994223..6ad994223 100755 --- a/tests/untried/pos/t2545.scala +++ b/tests/pos/t2545.scala diff --git a/tests/untried/pos/t2591.scala b/tests/pos/t2591.scala index 47ae551bf..47ae551bf 100644 --- a/tests/untried/pos/t2591.scala +++ b/tests/pos/t2591.scala diff --git a/tests/pos/t2610.scala b/tests/pos/t2610.scala new file mode 100644 index 000000000..8a82b4a72 --- /dev/null +++ b/tests/pos/t2610.scala @@ -0,0 +1,17 @@ +package mada; package defects; package tests + +package object bbb { + def bar = () + aaa.foo // value foo is not a member of package mada.defects.tests.aaa +} + +package object aaa { + def foo = () +} + +/* compiles successfully if placed here.. +package object bbb { + def bar = () + aaa.foo // value foo is not a member of package mada.defects.tests.aaa +} +*/ diff --git a/tests/pos/t2619.scala b/tests/pos/t2619.scala new file mode 100644 index 000000000..283d93bf2 --- /dev/null +++ b/tests/pos/t2619.scala @@ -0,0 +1,80 @@ +abstract class F { + final def apply(x: Int): AnyRef = null +} +abstract class AbstractModule { + def as: List[AnyRef] + def ms: List[AbstractModule] + def fs: List[F] = Nil + def rs(x: Int): List[AnyRef] = fs.map(_(x)) +} +abstract class ModuleType1 extends AbstractModule {} +abstract class ModuleType2 extends AbstractModule {} + +object ModuleAE extends ModuleType1 { + def as = Nil + def ms = Nil +} +object ModuleAF extends ModuleType2 { + def as = Nil + def ms = List(ModuleAE) +} +object ModuleAG extends ModuleType1 { + def as = List("") + def ms = Nil +} +object ModuleAI extends ModuleType1 { + def as = Nil + def ms = List(ModuleAE) +} +object ModuleAK extends ModuleType2 { + def as = Nil + def ms = List(ModuleAF) +} +object ModuleAL extends ModuleType1 { + def as = Nil + def ms = List( + ModuleAG, + ModuleAI + ) +} +object ModuleAM extends ModuleType1 { + def as = Nil + def ms = List( + ModuleAL, + ModuleAE + ) ::: List(ModuleAK) +} +object ModuleBE extends ModuleType1 { + def as = Nil + def ms = Nil +} +object ModuleBF extends ModuleType2 { + def as = Nil + def ms = List(ModuleBE) +} +object ModuleBG extends ModuleType1 { + def as = List("") + def ms = Nil +} +object ModuleBI extends ModuleType1 { + def as = Nil + def ms = List(ModuleBE) +} +object ModuleBK extends ModuleType2 { + def as = Nil + def ms = List(ModuleBF) +} +object ModuleBL extends ModuleType1 { + def as = Nil + def ms = List( + ModuleBG, + ModuleBI + ) +} +object ModuleBM extends ModuleType1 { + def as = Nil + def ms = List( + ModuleBL, + ModuleBE + ) ::: List(ModuleBK) +} diff --git a/tests/pos/t262.scala b/tests/pos/t262.scala new file mode 100644 index 000000000..ec6187b36 --- /dev/null +++ b/tests/pos/t262.scala @@ -0,0 +1,14 @@ +object O { + abstract class A { + def f:A; + } + class B extends A { + def f = if(1 == 2) new C else new D; + } + class C extends A { + def f = this; + } + class D extends A { + def f = this; + } +} diff --git a/tests/pos/t2624.scala b/tests/pos/t2624.scala new file mode 100644 index 000000000..76f0e3036 --- /dev/null +++ b/tests/pos/t2624.scala @@ -0,0 +1,4 @@ +object Test { + List(1).map(identity(_)) + List(1).map(identity) // this didn't typecheck before the fix +} diff --git a/tests/pos/t2635.scala b/tests/pos/t2635.scala new file mode 100755 index 000000000..7cd553135 --- /dev/null +++ b/tests/pos/t2635.scala @@ -0,0 +1,16 @@ +abstract class Base + +object Test +{ + def run(c: Class[_ <: Base]): Unit = { + } + + def main(args: Array[String]): Unit = + { + val sc: Option[Class[_ <: Base]] = Some(classOf[Base]) + sc match { + case Some(c) => run(c) + case None => + } + } +} diff --git a/tests/pos/t2660.scala b/tests/pos/t2660.scala new file mode 100644 index 000000000..94a40f740 --- /dev/null +++ b/tests/pos/t2660.scala @@ -0,0 +1,25 @@ +package hoho + +class G + +class H extends G + +class A[T](x: T) { + + def this(y: G, z: T) = { + this(z) + print(1) + } + + def this(z: H, h: T) = { + this(h) + print(2) + } +} + +object T { + def main(args: Array[String]): Unit = { + implicit def g2h(g: G): H = new H + new A[Int](new H, 23) + } +} diff --git a/tests/pos/t2664.scala b/tests/pos/t2664.scala new file mode 100644 index 000000000..7b667d010 --- /dev/null +++ b/tests/pos/t2664.scala @@ -0,0 +1,9 @@ +package pkg1 { + class C { + private[pkg1] def foo: Int = 1 + } + + trait T extends C { + private[pkg1] abstract override def foo = super.foo + 1 + } +} diff --git a/tests/pos/t2665.scala b/tests/pos/t2665.scala new file mode 100644 index 000000000..e46453534 --- /dev/null +++ b/tests/pos/t2665.scala @@ -0,0 +1,3 @@ +object Test { + val x: Unit = Array("") +} diff --git a/tests/pos/t2667.scala b/tests/pos/t2667.scala new file mode 100644 index 000000000..7f1f36f00 --- /dev/null +++ b/tests/pos/t2667.scala @@ -0,0 +1,6 @@ +object A { + def foo(x: Int, y: Int*): Int = 45 + def foo[T](x: T*): Int = 55 + + val x: Unit = foo(23, 23f) +} diff --git a/tests/pos/t2669.scala b/tests/pos/t2669.scala new file mode 100644 index 000000000..72e931178 --- /dev/null +++ b/tests/pos/t2669.scala @@ -0,0 +1,28 @@ +// #2629, #2639, #2669 +object Test2669 { + + def test[T](l: java.util.ArrayList[_ <: T]) = 1 + test(new java.util.ArrayList[String]()) + +} + +import java.util.ArrayList + +object Test2629 { + def main(args: Array[String]): Unit = { + val l = new ArrayList[String](1) + val m = new ArrayList(l) + + println(l.size) + println(m.size) + } +} + + +import java.util.Vector + +// scalac cannot detect lack of type params, but then throws AssertionError later: +class TVector2639 { + val b = new Vector // this line passed without error detected + val a = new Vector(1) // this line caused throwing AssertionError when scalac +} diff --git a/tests/pos/t267.scala b/tests/pos/t267.scala new file mode 100644 index 000000000..7e5876eae --- /dev/null +++ b/tests/pos/t267.scala @@ -0,0 +1,55 @@ +package expAbstractData + +/** A base class consisting of + * - a root trait (i.e. abstract class) `Exp' with an `eval' function + * - an abstract type `exp' bounded by `Exp' + * - a concrete instance class `Num' of `Exp' for numeric literals + */ +trait Base { + type exp <: Exp + + trait Exp { + def eval: Int + } + class Num(v: Int) extends Exp { self: exp => + val value = v + def eval = value + } +} + +object testBase extends App with Base { + type exp = Exp + val term = new Num(2); + Console.println(term.eval) +} + +/** Data extension: An extension of `Base' with `Plus' expressions + */ +trait BasePlus extends Base { + class Plus(l: exp, r: exp) extends Exp { self: exp => + val left = l + val right = r + def eval = left.eval + right.eval + } +} + +/** Operation extension: An extension of `Base' with 'show' methods. + */ +trait Show extends Base { + type exp <: Exp1 + + trait Exp1 extends Exp { + def show: String + } + class Num1(v: Int) extends Num(v) with Exp1 { self: exp with Num1 => + def show = value.toString() + } +} + +/** Operation extension: An extension of `BasePlus' with 'show' methods. + */ +trait ShowPlus extends BasePlus with Show { + class Plus1(l: exp, r: exp) extends Plus(l, r) with Exp1 { self: exp with Plus1 => + def show = left.show + " + " + right.show + } +} diff --git a/tests/pos/t2683.scala b/tests/pos/t2683.scala new file mode 100755 index 000000000..4ba34b554 --- /dev/null +++ b/tests/pos/t2683.scala @@ -0,0 +1,7 @@ +class A +class B extends A + +object Test { + val c: Class[_ <: A] = Class.forName("B").asSubclass(classOf[A]) + val x: Option[Class[_ <: A]] = Some(3).map { case _ => c } +} diff --git a/tests/pos/t2691.scala b/tests/pos/t2691.scala new file mode 100644 index 000000000..5f0ddd122 --- /dev/null +++ b/tests/pos/t2691.scala @@ -0,0 +1,16 @@ +object Breakdown { + def unapplySeq(x: Int): Some[List[String]] = Some(List("", "there")) +} +object Test { + 42 match { + case Breakdown("") => // needed to trigger bug + case Breakdown("", who) => println ("hello " + who) + } +} +object Test2 { + 42 match { + case Breakdown("") => // needed to trigger bug + case Breakdown("foo") => // needed to trigger bug + case Breakdown("", who) => println ("hello " + who) + } +} diff --git a/tests/pos/t2698.scala b/tests/pos/t2698.scala new file mode 100644 index 000000000..bce02e48b --- /dev/null +++ b/tests/pos/t2698.scala @@ -0,0 +1,14 @@ +class WordExp { + abstract class Label + type _labelT <: Label +} + +import scala.collection._ + +abstract class S2 { + val lang: WordExp + type __labelT = lang._labelT + + var deltaq: Array[__labelT] = _ + def delta1 = immutable.Map(deltaq.zipWithIndex: _*) +} diff --git a/tests/untried/pos/t2708.scala b/tests/pos/t2708.scala index 19485bf4c..19485bf4c 100644 --- a/tests/untried/pos/t2708.scala +++ b/tests/pos/t2708.scala diff --git a/tests/untried/pos/t2726/SQLBuilder_1.scala b/tests/pos/t2726/SQLBuilder_1.scala index 8d07a8826..8d07a8826 100644 --- a/tests/untried/pos/t2726/SQLBuilder_1.scala +++ b/tests/pos/t2726/SQLBuilder_1.scala diff --git a/tests/untried/pos/t2726/t2726_2.scala b/tests/pos/t2726/t2726_2.scala index e738143ae..e738143ae 100644 --- a/tests/untried/pos/t2726/t2726_2.scala +++ b/tests/pos/t2726/t2726_2.scala diff --git a/tests/untried/pos/t2741/2741_1.scala b/tests/pos/t2741/2741_1.scala index d9d04f7ab..d9d04f7ab 100644 --- a/tests/untried/pos/t2741/2741_1.scala +++ b/tests/pos/t2741/2741_1.scala diff --git a/tests/untried/pos/t2741/2741_2.scala b/tests/pos/t2741/2741_2.scala index a9fd9d7d0..a9fd9d7d0 100644 --- a/tests/untried/pos/t2741/2741_2.scala +++ b/tests/pos/t2741/2741_2.scala diff --git a/tests/untried/pos/t2794.scala b/tests/pos/t2794.scala index a17edf8cb..a17edf8cb 100644 --- a/tests/untried/pos/t2794.scala +++ b/tests/pos/t2794.scala diff --git a/tests/untried/pos/t2797.scala b/tests/pos/t2797.scala index cf579d8de..cf579d8de 100644 --- a/tests/untried/pos/t2797.scala +++ b/tests/pos/t2797.scala diff --git a/tests/untried/pos/t2799.flags b/tests/pos/t2799.flags index d1b831ea8..d1b831ea8 100644 --- a/tests/untried/pos/t2799.flags +++ b/tests/pos/t2799.flags diff --git a/tests/untried/pos/t2799.scala b/tests/pos/t2799.scala index 7710cce26..7710cce26 100644 --- a/tests/untried/pos/t2799.scala +++ b/tests/pos/t2799.scala diff --git a/tests/untried/pos/t2809.scala b/tests/pos/t2809.scala index 1f68b0b07..1f68b0b07 100644 --- a/tests/untried/pos/t2809.scala +++ b/tests/pos/t2809.scala diff --git a/tests/untried/pos/t2810.scala b/tests/pos/t2810.scala index c85eca164..c85eca164 100644 --- a/tests/untried/pos/t2810.scala +++ b/tests/pos/t2810.scala diff --git a/tests/untried/pos/t284-pos.scala b/tests/pos/t284-pos.scala index 40277e2db..40277e2db 100644 --- a/tests/untried/pos/t284-pos.scala +++ b/tests/pos/t284-pos.scala diff --git a/tests/untried/pos/t287.scala b/tests/pos/t287.scala index 8e5e8831c..8e5e8831c 100644 --- a/tests/untried/pos/t287.scala +++ b/tests/pos/t287.scala diff --git a/tests/untried/pos/t289.scala b/tests/pos/t289.scala index 96c0244df..96c0244df 100644 --- a/tests/untried/pos/t289.scala +++ b/tests/pos/t289.scala diff --git a/tests/untried/pos/t2910.scala b/tests/pos/t2910.scala index f9f2c87a9..f9f2c87a9 100644 --- a/tests/untried/pos/t2910.scala +++ b/tests/pos/t2910.scala diff --git a/tests/untried/pos/t2939.scala b/tests/pos/t2939.scala index 57dd52024..57dd52024 100644 --- a/tests/untried/pos/t2939.scala +++ b/tests/pos/t2939.scala diff --git a/tests/untried/pos/t295.scala b/tests/pos/t295.scala index 22c7beff4..22c7beff4 100644 --- a/tests/untried/pos/t295.scala +++ b/tests/pos/t295.scala diff --git a/tests/untried/pos/t296.scala b/tests/pos/t296.scala index 0c267a307..0c267a307 100644 --- a/tests/untried/pos/t296.scala +++ b/tests/pos/t296.scala diff --git a/tests/untried/pos/t2973.scala b/tests/pos/t2973.scala index f5dde856d..f5dde856d 100644 --- a/tests/untried/pos/t2973.scala +++ b/tests/pos/t2973.scala diff --git a/tests/pos/test.scala b/tests/pos/test.scala deleted file mode 100644 index 71fa1b1d9..000000000 --- a/tests/pos/test.scala +++ /dev/null @@ -1,6 +0,0 @@ -object test { - - val m = new java.util.HashMap[String, String] - m.size - -}
\ No newline at end of file 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 +} diff --git a/tests/pos/tycons.scala b/tests/pos/tycons.scala new file mode 100644 index 000000000..f138c78be --- /dev/null +++ b/tests/pos/tycons.scala @@ -0,0 +1,22 @@ +class TypeConstructor { + type TypeArg +} + +trait List[+T] extends TypeConstructor { type TypeArg <: T } + +trait Set[T] extends TypeConstructor { type TypeArg <: T } + +object obj extends List[Number] with Set[Exception] { + val x: TypeArg = ??? + val n: Number = x + val e: Exception = x +} + +class Functor[F <: TypeConstructor] { + def map[A, B](f: F { type TypeArg <: A }): F { type TypeArg <: B } +} + +implicit object ListFunctor extends Functor[List] { + def map[A, B](f: List[A]): List[B] = ??? +} + diff --git a/tests/untried/pos/t2994b.scala b/tests/untried/pos/t2994b.scala deleted file mode 100644 index 8b5eb9692..000000000 --- a/tests/untried/pos/t2994b.scala +++ /dev/null @@ -1,7 +0,0 @@ -object Test { - trait Bar[X[_]] - trait Baz[S[_] <: Bar[S]] { - type Apply[T] - } - trait Foo[V[_] <: Bar[V]] extends Bar[Baz[V]#Apply] -} |