diff options
author | Martin Odersky <odersky@gmail.com> | 2016-12-14 17:38:21 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-12-14 18:25:19 +0100 |
commit | 90ce8875c874f011b335390b3b41422793e1c7aa (patch) | |
tree | fae5c3e54ab92b8651122931035ddfd35f61e532 /tests/neg/t3683-modified.scala | |
parent | ba06bf06721f1a8de7d68d22ad7eba27fff90c43 (diff) | |
download | dotty-90ce8875c874f011b335390b3b41422793e1c7aa.tar.gz dotty-90ce8875c874f011b335390b3b41422793e1c7aa.tar.bz2 dotty-90ce8875c874f011b335390b3b41422793e1c7aa.zip |
More tests and other odds and end
- Add tests that work to pos/neg, tests that don't work yet to pending/pos/neg.
- Also, change .gitignore to allow for a local directory.
- Also add a draft page to the docs.
Diffstat (limited to 'tests/neg/t3683-modified.scala')
-rw-r--r-- | tests/neg/t3683-modified.scala | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/neg/t3683-modified.scala b/tests/neg/t3683-modified.scala new file mode 100644 index 000000000..19b981e0a --- /dev/null +++ b/tests/neg/t3683-modified.scala @@ -0,0 +1,20 @@ +sealed trait Foo +sealed trait Bar extends Foo +sealed trait W[T >: Bar <: Foo] +case class X() extends W[Foo] +case class XX() extends W[Bar] +case class Y() extends W[Bar] +case class Z[T >: T <: Foo]( // error: cyclic reference + z1: W[T] +) extends W[T] + +object Main { + // should warn for not including XX() + def f1(w: W[Bar]): Int = { + w match { + // case XX() => 2 + case Y() => 1 + case Z(z) => f1(z) + } + } +} |