summaryrefslogtreecommitdiff
path: root/test/files/neg/warn-inferred-any.scala
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2014-08-20 10:25:28 -0700
committerSom Snytt <som.snytt@gmail.com>2014-09-05 01:07:44 -0700
commitc9ec916f20c4f06a0aebe0a9929443c1c8b60c5c (patch)
tree9c592c054af335510d57fa2ff3fc0e733f8953a1 /test/files/neg/warn-inferred-any.scala
parentd4b5c7b95de88d3890be654e06da812c6eb607f5 (diff)
downloadscala-c9ec916f20c4f06a0aebe0a9929443c1c8b60c5c.tar.gz
scala-c9ec916f20c4f06a0aebe0a9929443c1c8b60c5c.tar.bz2
scala-c9ec916f20c4f06a0aebe0a9929443c1c8b60c5c.zip
SI-8806 Add lower bound check to Any lint
We already exclude the lint check for infer-any if Any is somewhere explicit. This commit adds lower bounds of type params to the somewheres. Motivated by: ``` scala> f"${42}" <console>:8: warning: a type was inferred to be `Any`; this may indicate a programming error. f"${42}" ^ res0: String = 42 ```
Diffstat (limited to 'test/files/neg/warn-inferred-any.scala')
-rw-r--r--test/files/neg/warn-inferred-any.scala8
1 files changed, 8 insertions, 0 deletions
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")
+}