Add better quickfix for scope functions #KT-13676 Fixed

This commit is contained in:
shiraji
2017-06-11 01:50:45 +03:00
committed by Mikhail Glukhikh
parent 09d8c31433
commit ab4eb1dd20
26 changed files with 335 additions and 0 deletions
@@ -0,0 +1,14 @@
// "Replace scope function with safe (?.) call" "false"
// WITH_RUNTIME
// ACTION: Introduce local variable
// ACTION: Add non-null asserted (!!) call
// ACTION: Replace with safe (?.) call
// ERROR: Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type My?
class My(val prop: Int)
fun My?.foo(a: String?) {
a.apply {
this@foo<caret>.prop
}
}