Introduce intention 'expr.unsafeCast<Type>()' <- -> 'expr as Type'

So #KT-16382 Fixed
This commit is contained in:
Toshiaki Kameyama
2018-02-07 08:07:50 +03:00
committed by Mikhail Glukhikh
parent 085c7d30ed
commit e35ec8ee08
18 changed files with 187 additions and 0 deletions
@@ -0,0 +1 @@
org.jetbrains.kotlin.idea.intentions.ConvertUnsafeCastToUnsafeCastCallIntention
@@ -0,0 +1,4 @@
// JS
fun test(foo: dynamic) {
val s = <caret>foo as String
}
@@ -0,0 +1,4 @@
// JS
fun test(foo: dynamic) {
val s = <caret>foo.unsafeCast<String>()
}
@@ -0,0 +1,5 @@
// JS
// IS_APPLICABLE: false
fun test(foo: Any) {
val s = <caret>foo as? String
}