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 -1
View File
@@ -26,7 +26,7 @@ fun box(): String {
return "OK"
}
fun check<T>(param: T, f: (T) -> Unit): String {
fun <T> check(param: T, f: (T) -> Unit): String {
try {
f(param)
}
+1 -1
View File
@@ -1,4 +1,4 @@
fun castToString<T>(t: T) {
fun <T> castToString(t: T) {
t as String
}
+1 -1
View File
@@ -1,5 +1,5 @@
fun box() : String {
fun foo<T>(t:() -> T) : T = t()
fun <T> foo(t:() -> T) : T = t()
return foo {"OK"}
}
+1 -1
View File
@@ -16,4 +16,4 @@ fun box(): String {
return "OK"
}
fun run1<T>(f: () -> T): T { return f() }
fun <T> run1(f: () -> T): T { return f() }
@@ -16,4 +16,4 @@ fun box(): String {
return "OK"
}
fun run1<T>(f: () -> T): T { return f() }
fun <T> run1(f: () -> T): T { return f() }
@@ -7,7 +7,7 @@ class Delegate {
fun propertyDelegated(a: Int) { inner = "fail" }
fun propertyDelegated(a: String) { inner = "fail" }
fun propertyDelegated(p: PropertyMetadata, a: Int) { inner = "fail" }
fun propertyDelegated<T>(p: PropertyMetadata, s: String = "") { inner = "fail" }
fun <T> propertyDelegated(p: PropertyMetadata, s: String = "") { inner = "fail" }
}
val prop by Delegate()
+1 -1
View File
@@ -1,4 +1,4 @@
fun foo<T>(t: T) {
fun <T> foo(t: T) {
t!!
}
@@ -6,9 +6,9 @@ fun Int.foo2() : (i : Int) -> Int {
return { x -> x + this }
}
fun fooT1<T>(t : T) = { t.toString() }
fun <T> fooT1(t : T) = { t.toString() }
fun fooT2<T>(t: T) = { x:T -> t.toString() + x.toString() }
fun <T> fooT2(t: T) = { x:T -> t.toString() + x.toString() }
object t
+1 -1
View File
@@ -1,6 +1,6 @@
// KT-2739 Error type inferred for hashSet(Pair, Pair, Pair)
fun foo<T>(vararg ts: T): T? = null
fun <T> foo(vararg ts: T): T? = null
class Pair<A>(a: A)
+1 -1
View File
@@ -1,4 +1,4 @@
fun foo<T>(t: T) {
fun <T> foo(t: T) {
}
fun box(): String {
@@ -1,5 +1,5 @@
fun box(): String {
fun foo<T>(t: T) = t
fun <T> foo(t: T) = t
return foo("OK")
}
+1 -1
View File
@@ -102,7 +102,7 @@ var Int.Companion.TopField : Int
fun Int.Companion.TopFun() : String = "TopFun"
fun myAssertEquals<T>(a: T, b: T) {
fun <T> myAssertEquals(a: T, b: T) {
if (a != b) throw Exception("$a != $b")
}
+1 -1
View File
@@ -4,7 +4,7 @@ class Identifier<T>(t : T?, myHasDollar : Boolean) {
public fun getName() : T? { return myT }
companion object {
open public fun init<T>(name : T?) : Identifier<T> {
open public fun <T> init(name : T?) : Identifier<T> {
val __ = Identifier<T>(name, false)
return __
}
+1 -1
View File
@@ -15,7 +15,7 @@ public open class Identifier<T>(myName : T?, myHasDollar : Boolean) {
}
companion object {
open public fun init<T>(name : T?) : Identifier<T> {
open public fun <T> init(name : T?) : Identifier<T> {
val __ = Identifier<T>(name, false)
return __
}
@@ -1,6 +1,6 @@
var entered = 0
fun foo<T>(t: T): T {
fun <T> foo(t: T): T {
entered++
return t
}
+1 -1
View File
@@ -1,4 +1,4 @@
fun assertEquals<T>(a: T, b: T) {
fun <T> assertEquals(a: T, b: T) {
if (a != b) throw AssertionError("$a != $b")
}
+1 -1
View File
@@ -1,6 +1,6 @@
class Foo {
fun bar(): String {
fun foo<T>(t:() -> T) : T = t()
fun <T> foo(t:() -> T) : T = t()
foo { }
return "OK"
}