Unused symbol: do not report for @JsName annotated declarations
#KT-17368 Fixed
This commit is contained in:
committed by
Yan Zhulanow
parent
7abd0831a1
commit
905d0c1016
@@ -98,7 +98,7 @@ class UnusedSymbolInspection : AbstractKotlinInspection() {
|
||||
|
||||
private val javaInspection = UnusedDeclarationInspection()
|
||||
|
||||
private val KOTLIN_ADDITIONAL_ANNOTATIONS = listOf("kotlin.test.*")
|
||||
private val KOTLIN_ADDITIONAL_ANNOTATIONS = listOf("kotlin.test.*", "kotlin.js.JsName")
|
||||
|
||||
private val KOTLIN_BUILTIN_ENUM_FUNCTIONS = listOf(FqName("kotlin.enumValues"), FqName("kotlin.enumValueOf"))
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
// PROBLEM: none
|
||||
// JS
|
||||
class Person(val name: String) {
|
||||
fun hello() {
|
||||
println("Hello $name!")
|
||||
}
|
||||
|
||||
@JsName("helloWithGreeting")
|
||||
fun <caret>hello(greeting: String) {
|
||||
println("$greeting $name!")
|
||||
}
|
||||
}
|
||||
+5
@@ -13521,6 +13521,11 @@ public class LocalInspectionTestGenerated extends AbstractLocalInspectionTest {
|
||||
runTest("idea/testData/inspectionsLocal/unusedSymbol/internal.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("jsName.kt")
|
||||
public void testJsName() throws Exception {
|
||||
runTest("idea/testData/inspectionsLocal/unusedSymbol/jsName.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("propertyOfInlineClassType.kt")
|
||||
public void testPropertyOfInlineClassType() throws Exception {
|
||||
runTest("idea/testData/inspectionsLocal/unusedSymbol/propertyOfInlineClassType.kt");
|
||||
|
||||
Reference in New Issue
Block a user