diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-09-16 17:29:25 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-09-16 17:29:25 +1000 |
commit | eb5d0a6b31e2f2c5c8a7505232cfc648f581af71 (patch) | |
tree | b6b3ff256dd858b5ab30a3ce9144d0d5891b5f32 /test | |
parent | 3307e44a9d980eef5a442a688ef22765556f609f (diff) | |
parent | c9ec916f20c4f06a0aebe0a9929443c1c8b60c5c (diff) | |
download | scala-eb5d0a6b31e2f2c5c8a7505232cfc648f581af71.tar.gz scala-eb5d0a6b31e2f2c5c8a7505232cfc648f581af71.tar.bz2 scala-eb5d0a6b31e2f2c5c8a7505232cfc648f581af71.zip |
Merge pull request #3936 from som-snytt/issue/8806
SI-8806 Add lower bound check to Any lint
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/warn-inferred-any.check | 5 | ||||
-rw-r--r-- | test/files/neg/warn-inferred-any.scala | 8 |
2 files changed, 12 insertions, 1 deletions
diff --git a/test/files/neg/warn-inferred-any.check b/test/files/neg/warn-inferred-any.check index 4628033e55..8ad81d1529 100644 --- a/test/files/neg/warn-inferred-any.check +++ b/test/files/neg/warn-inferred-any.check @@ -7,6 +7,9 @@ warn-inferred-any.scala:16: warning: a type was inferred to be `AnyVal`; this ma warn-inferred-any.scala:17: warning: a type was inferred to be `AnyVal`; this may indicate a programming error. { 1l to 5l contains 5d } ^ +warn-inferred-any.scala:25: warning: a type was inferred to be `Any`; this may indicate a programming error. + def za = f(1, "one") + ^ error: No warnings can be incurred under -Xfatal-warnings. -three warnings found +four warnings found one error found diff --git a/test/files/neg/warn-inferred-any.scala b/test/files/neg/warn-inferred-any.scala index b853e6e5a8..693c33e7be 100644 --- a/test/files/neg/warn-inferred-any.scala +++ b/test/files/neg/warn-inferred-any.scala @@ -17,3 +17,11 @@ trait Ys[+A] { { 1l to 5l contains 5d } { 1l to 5l contains 5l } } + +trait Zs { + def f[A](a: A*) = 42 + def g[A >: Any](a: A*) = 42 // don't warn + + def za = f(1, "one") + def zu = g(1, "one") +} |