Unused symbol: remove forced "used" from actual declarations

Now we really check whether actual declaration has usages
(in expect or actual code) or not
Related to KT-17512
Related to KT-15666
This commit is contained in:
Mikhail Glukhikh
2018-06-20 18:51:18 +03:00
parent e885e54233
commit 7e0e7dc983
16 changed files with 135 additions and 75 deletions
@@ -0,0 +1,7 @@
expect class My constructor() {
fun foo()
}
fun test() {
My().foo()
}
@@ -0,0 +1,7 @@
expect class My constructor() {
fun foo()
}
fun test() {
My().foo()
}
@@ -0,0 +1,8 @@
// "Safe delete 'foo'" "false"
// TOOL: org.jetbrains.kotlin.idea.inspections.UnusedSymbolInspection
// ACTION: Convert member to extension
// ACTION: Move to companion object
actual class My {
actual fun <caret>foo() {}
}
@@ -0,0 +1,8 @@
// "Safe delete 'foo'" "false"
// TOOL: org.jetbrains.kotlin.idea.inspections.UnusedSymbolInspection
// ACTION: Convert member to extension
// ACTION: Move to companion object
actual class My {
actual fun foo() {}
}
@@ -0,0 +1,4 @@
expect class My constructor() {
// TODO: also should be deleted (KT-15666)
fun foo()
}
@@ -0,0 +1,4 @@
expect class My constructor() {
// TODO: also should be deleted (KT-15666)
fun foo()
}
@@ -0,0 +1,6 @@
// "Safe delete 'foo'" "true"
// TOOL: org.jetbrains.kotlin.idea.inspections.UnusedSymbolInspection
actual class My {
actual fun <caret>foo() {}
}
@@ -0,0 +1,5 @@
// "Safe delete 'foo'" "true"
// TOOL: org.jetbrains.kotlin.idea.inspections.UnusedSymbolInspection
actual class My {
}