aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/pending/pos/annot.scala5
-rw-r--r--tests/pos/annot.scala6
-rw-r--r--tests/pos/i0268.scala15
3 files changed, 18 insertions, 8 deletions
diff --git a/tests/pending/pos/annot.scala b/tests/pending/pos/annot.scala
deleted file mode 100644
index 8e21803b4..000000000
--- a/tests/pending/pos/annot.scala
+++ /dev/null
@@ -1,5 +0,0 @@
-class Test {
-
- @SuppressWarnings("hi") def foo() = ???
-
-}
diff --git a/tests/pos/annot.scala b/tests/pos/annot.scala
index ab80aba27..c3a17ff1d 100644
--- a/tests/pos/annot.scala
+++ b/tests/pos/annot.scala
@@ -2,11 +2,11 @@ import java.beans.Transient
class Test {
- @SuppressWarnings(Array("hi")) def foo() = ??? // evalutation of annotation on type cannot be deffered as requires implicit resolution(only generic Array$.apply applies here)
+ @SuppressWarnings(Array("hi")) def foo() = ??? // evalutation of annotation on type cannot be deferred as requires implicit resolution(only generic Array$.apply applies here)
- @SuppressWarnings(Array("hi", "foo")) def foo2() = ??? //can be deffered as there is a non-generic method
+ @SuppressWarnings(Array("hi", "foo")) def foo2() = ??? //can be deferred as there is a non-generic method
-// @SuppressWarnings("hi") def foo3() = ??? // can be written in java and is serialized this way in bytecode. doesn't typecheck
+ @SuppressWarnings("hi") def foo3() = ??? // can be written in java and is serialized this way in bytecode. doesn't typecheck
@Transient(false) def bar = ???
diff --git a/tests/pos/i0268.scala b/tests/pos/i0268.scala
new file mode 100644
index 000000000..6ac0c5c90
--- /dev/null
+++ b/tests/pos/i0268.scala
@@ -0,0 +1,15 @@
+package typespatmat
+
+sealed trait Box2[T]
+final case class Int2(x: Int) extends Box2[Int]
+final case class Str2(x: String)
+ extends Box2[String]
+final case class Gen[T](x: T) extends Box2[T]
+
+object Box2 {
+ def double2[T](x: Box2[T]): T = x match {
+ case Int2(i) => i * 2
+ case Str2(s) => s + s
+ case Gen(x) => x
+ }
+}