deprecating types after colon

This commit is contained in:
Dmitry Jemerov
2015-04-21 18:32:31 +02:00
parent b7a4b3c17d
commit f374eec8f1
268 changed files with 1055 additions and 769 deletions
@@ -1,3 +1,4 @@
// !CHECK_TYPE
// !DIAGNOSTICS: -UNUSED_PARAMETER
annotation class ann(val name: String)
@@ -16,5 +17,5 @@ val withExpression = fun() = 5
val funfun = fun() = fun() = 5
val parentesized = (fun () {})
val parentesizedWithType = (fun () {}) : () -> Unit
val withType = (fun () {}) : () -> Unit
val parentesizedWithType = checkSubtype<() -> Unit>((fun () {}))
val withType = checkSubtype<() -> Unit>((fun () {}))
@@ -4,7 +4,7 @@
fun testReturnType(foo: String) {
val bar = fun () = foo
bar.checkType { it : _<() -> String> }
bar.checkType { _<() -> String>() }
val bas: () -> String = fun () = foo
@@ -14,7 +14,7 @@ fun testReturnType(foo: String) {
fun testParamType() {
val bar = fun (bal: String){}
bar.checkType { it : _<(String) -> Unit> }
bar.checkType { _<(String) -> Unit>() }
val bas: (String) -> Unit = fun (param: String) {}
val bag: (Int) -> Unit = <!TYPE_MISMATCH!>fun (<!EXPECTED_PARAMETER_TYPE_MISMATCH!>param: String<!>) {}<!>
@@ -23,7 +23,7 @@ fun testParamType() {
fun testReceiverType() {
val bar = fun String.() {}
bar.checkType { it : _<String.() -> Unit> }
bar.checkType { _<String.() -> Unit>() }
val bas: String.() -> Unit = fun String.() {}
@@ -1,3 +1,4 @@
// !CHECK_TYPE
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
fun listOf<T>(): List<T> = null!!
@@ -6,13 +7,13 @@ fun test(a: (Int) -> Int) {
test(fun (x) = x)
test(fun (x): Int { x: Int; return 4 })
test(fun (x): Int { checkSubtype<Int>(x); return 4 })
}
fun test2(a: () -> List<Int>) {
test2(fun () = <!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>listOf<!>())
}
val a: (Int) -> Unit = fun(x) { x: Int }
val a: (Int) -> Unit = fun(x) { checkSubtype<Int>(x) }
val b: (Int) -> Unit = <!TYPE_MISMATCH!>fun(<!EXPECTED_PARAMETER_TYPE_MISMATCH!>x: String<!>) {}<!>
@@ -1,3 +1,4 @@
// !CHECK_TYPE
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
val a = fun (<!CANNOT_INFER_PARAMETER_TYPE!>x<!>) = <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>x<!>
@@ -13,7 +14,7 @@ val e: (Int, String) -> Int = <!TYPE_MISMATCH!>fun <!EXPECTED_PARAMETERS_NUMBER_
val f: (Int) -> Int = <!TYPE_MISMATCH!>fun (<!EXPECTED_PARAMETER_TYPE_MISMATCH!>x: String<!>) = 3<!>
fun test1(a: (Int) -> Unit) {
test1(fun (x) { x : Int})
test1(fun (x) { checkSubtype<Int>(x)})
}
fun test2(a: (Int) -> Unit) {