diff options
author | Paul Phillips <paulp@improving.org> | 2012-07-27 16:40:55 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-07-27 16:40:55 -0700 |
commit | 1f95d356ee69a442f98aedc024a1aa7e4672d20a (patch) | |
tree | fe8ec1d2786c94ae38d3b2e482b366f2f29fe049 /test/files/pos | |
parent | ad08f24448729009fc8d5ff0acf307a43b4cfe0a (diff) | |
parent | a716b00235dcda53b554c466dcd4879a72824985 (diff) | |
download | scala-1f95d356ee69a442f98aedc024a1aa7e4672d20a.tar.gz scala-1f95d356ee69a442f98aedc024a1aa7e4672d20a.tar.bz2 scala-1f95d356ee69a442f98aedc024a1aa7e4672d20a.zip |
Merge pull request #1004 from paulp/topic/warnings-2.10.x
Topic/warnings 2.10.x
Diffstat (limited to 'test/files/pos')
-rw-r--r-- | test/files/pos/unchecked-a.flags | 1 | ||||
-rw-r--r-- | test/files/pos/unchecked-a.scala | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/test/files/pos/unchecked-a.flags b/test/files/pos/unchecked-a.flags new file mode 100644 index 0000000000..779916d58f --- /dev/null +++ b/test/files/pos/unchecked-a.flags @@ -0,0 +1 @@ +-unchecked -Xfatal-warnings
\ No newline at end of file diff --git a/test/files/pos/unchecked-a.scala b/test/files/pos/unchecked-a.scala new file mode 100644 index 0000000000..deceb91c36 --- /dev/null +++ b/test/files/pos/unchecked-a.scala @@ -0,0 +1,15 @@ +trait Y +trait Z extends Y +class X[+A <: Y] + +object Test { + def f1(x: X[_ <: Y]) = x match { + case _: X[Any] => // looks a little funny; `Any` is outside the bounds for `A` + } + def f2(x: X[_ <: Y]) = x match { + case _: X[Y] => // looks better, let's allow this (too) + } + + // NonLocalReturnControl[_] warnings + def foo: Int = List(0).foldLeft(0){case _ => return 0} +} |