Replace with safe call works now on UNSAFE_IMPLICIT_INVOKE #KT-12628 Fixed

(cherry picked from commit 208798d)
This commit is contained in:
Mikhail Glukhikh
2016-07-27 18:09:57 +03:00
committed by Mikhail Glukhikh
parent a9c30e878b
commit 995a633229
6 changed files with 44 additions and 3 deletions
@@ -0,0 +1,3 @@
// "Replace with safe (?.) call" "true"
fun foo(exec: (() -> Unit)?) = exec<caret>()
@@ -0,0 +1,3 @@
// "Replace with safe (?.) call" "true"
fun foo(exec: (() -> Unit)?) = exec?.invoke()
@@ -0,0 +1,7 @@
// "Replace with safe (?.) call" "false"
// ACTION: Convert to block body
// ACTION: Replace overloaded operator with function call
// ACTION: Wrap with '?.let { ... }' call
// ERROR: Reference has a nullable type '(String.() -> Unit)?', use explicit '?.invoke()' to make a function-like call instead
fun foo(exec: (String.() -> Unit)?) = "".exec<caret>()