Do not suggest destructuring for invisible properties #KT-18665 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
c4ebfe8e84
commit
c149c37ac7
@@ -71,4 +71,12 @@
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Use destructuring declaration</problem_class>
|
||||
<description>Use destructuring declaration</description>
|
||||
</problem>
|
||||
<problem>
|
||||
<file>visible.kt</file>
|
||||
<line>7</line>
|
||||
<module>light_idea_test_case</module>
|
||||
<entry_point TYPE="file" FQNAME="temp:///src/visible.kt" />
|
||||
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">Use destructuring declaration</problem_class>
|
||||
<description>Use destructuring declaration</description>
|
||||
</problem>
|
||||
</problems>
|
||||
@@ -0,0 +1,16 @@
|
||||
// SKIP_ERRORS_BEFORE
|
||||
// SKIP_ERRORS_AFTER
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
fun foo(s: String) {}
|
||||
|
||||
data class Example(private val str: String) {
|
||||
fun doWithExample(block : (Example) -> Unit) = block(Example("hello"))
|
||||
|
||||
}
|
||||
|
||||
fun Example.runExample() {
|
||||
doWithExample { example<caret> ->
|
||||
foo(example.str)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fun foo(s: String) {}
|
||||
|
||||
data class Example(private val str: String) {
|
||||
fun doWithExample(block : (Example) -> Unit) = block(Example("hello"))
|
||||
|
||||
fun runExample() {
|
||||
doWithExample { example<caret> ->
|
||||
foo(example.str)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fun foo(s: String) {}
|
||||
|
||||
data class Example(private val str: String) {
|
||||
fun doWithExample(block : (Example) -> Unit) = block(Example("hello"))
|
||||
|
||||
fun runExample() {
|
||||
doWithExample { (str1) ->
|
||||
foo(str1)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user