diagnostics for deprecated syntax of function type parameter list

This commit is contained in:
Dmitry Jemerov
2015-10-05 20:26:47 +02:00
parent c5d3673b6b
commit 7c20630272
156 changed files with 236 additions and 213 deletions
@@ -1,7 +1,7 @@
//KT-2195 error "Only safe calls are allowed ..." but it is function param (val)
package foo
private fun sendCommand<T>(errorCallback: (()->Unit)? = null) {
private fun <T> sendCommand(errorCallback: (()->Unit)? = null) {
if (errorCallback != null) {
<!DEBUG_INFO_SMARTCAST!>errorCallback<!>()
}
@@ -1,13 +1,13 @@
// The type checker used to think that T is not null no matter what the upper bound
fun nullableUpperBound<T, INDIRECT: T>(t: T, ind: INDIRECT) {
fun <T, INDIRECT: T> nullableUpperBound(t: T, ind: INDIRECT) {
if (t == null) {} // was a warning
if (t != null) {} // was a warning
if (ind == null) {} // was a warning
if (ind != null) {} // was a warning
}
fun notNullUpperBound<T: Any, INDIRECT: T>(t: T, ind: INDIRECT) {
fun <T: Any, INDIRECT: T> notNullUpperBound(t: T, ind: INDIRECT) {
if (<!SENSELESS_COMPARISON!>t == null<!>) {} // still a warning
if (<!SENSELESS_COMPARISON!>t != null<!>) {} // still a warning
if (<!SENSELESS_COMPARISON!>ind == null<!>) {} // still a warning