summaryrefslogtreecommitdiff
path: root/test/files/neg/t4851.check
diff options
context:
space:
mode:
authorAntoine Gourlay <antoine@gourlay.fr>2014-07-31 17:52:13 +0200
committerAntoine Gourlay <antoine@gourlay.fr>2014-08-12 15:47:20 +0200
commit756e551b30461b548ea59e99562634775b7ebd74 (patch)
tree678fd556b17768d1cf533135bbfd1741df025d8d /test/files/neg/t4851.check
parent84d4ebc19a1e54dbe446ef35b71efa7ad3890c19 (diff)
downloadscala-756e551b30461b548ea59e99562634775b7ebd74.tar.gz
scala-756e551b30461b548ea59e99562634775b7ebd74.tar.bz2
scala-756e551b30461b548ea59e99562634775b7ebd74.zip
SI-5691 lint warning when a type parameter shadows an existing type.
This adds a new lint warning for when a class/method/type-member's type parameter shadows an existing type: `-Xlint:type-parameter-shadow`. It excludes type parameters of synthetic methods (the user can't rename or remove those anyway), otherwise, for example, every case class triggers the warning. Also fixes a test that contained wrong java sources (that didn't even compile...), discovered thanks to the warning. --- This kind of errors shows up every now and then on the mailing-list, on stackoverflow, etc. so maybe a warning would be useful. I was afraid this would yield too many warnings for libraries that are heavy on type parameters, but no: running this on scalaz and shapeless HEAD (`v7.1.0-RC1-41-g1cc0a96` and `v2.0.0-M1-225-g78426a0` respectively) yields 44 warnings. None of them are false positives; they usually come from: - scalaz loving using `A` as type parameter, even several levels deep of parametrized classes/methods - or calling a type parameter that will hold a map `Map`, or similar, thus shadowing an existing type
Diffstat (limited to 'test/files/neg/t4851.check')
-rw-r--r--test/files/neg/t4851.check4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/files/neg/t4851.check b/test/files/neg/t4851.check
index 132dd91b50..d5711a889b 100644
--- a/test/files/neg/t4851.check
+++ b/test/files/neg/t4851.check
@@ -29,13 +29,13 @@ S.scala:7: warning: Adapting argument list by creating a 3-tuple: this may not b
val y2 = new Some(1, 2, 3)
^
S.scala:9: warning: Adaptation of argument list by inserting () has been deprecated: this is unlikely to be what you want.
- signature: J2[T](x: T): J2[T]
+ signature: J2(x: T): J2[T]
given arguments: <none>
after adaptation: new J2((): Unit)
val z1 = new J2
^
S.scala:10: warning: Adaptation of argument list by inserting () has been deprecated: this is unlikely to be what you want.
- signature: J2[T](x: T): J2[T]
+ signature: J2(x: T): J2[T]
given arguments: <none>
after adaptation: new J2((): Unit)
val z2 = new J2()