FIR: Support adding expect type to calls in foo() as R position

See https://kotlinlang.org/docs/whatsnew12.html#support-for-foo-as-a-shorthand-for-this-foo
This commit is contained in:
Denis.Zharkov
2021-05-26 17:44:05 +03:00
committed by TeamCityServer
parent 6136526a3a
commit d932d5b0a5
20 changed files with 219 additions and 49 deletions
+2 -2
View File
@@ -8,9 +8,9 @@ inline fun <reified T> foo(): T {
}
fun test() {
val fooCall = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>foo<!>() as String // T in foo should be inferred to String
val fooCall = foo() as String // T in foo should be inferred to String
fooCall checkType { _<String>() }
val safeFooCall = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>foo<!>() as? String
val safeFooCall = foo() as? String
safeFooCall checkType { _<String?>() }
}