Data Flow from Here: do not include named argument references
This commit is contained in:
@@ -103,6 +103,8 @@ class OutflowSlicer(
|
||||
return
|
||||
}
|
||||
|
||||
if (refElement.parent is KtValueArgumentName) return // named argument reference is not a read or write
|
||||
|
||||
val refExpression = KtPsiUtil.safeDeparenthesize(refElement)
|
||||
if (withDereferences) {
|
||||
refExpression.processDereferences()
|
||||
|
||||
@@ -3,4 +3,3 @@
|
||||
3 data class DataClass(<bold>val value1: Int</bold>, val value2: Int) (in DataClass)
|
||||
6 val v = dataClass.<bold>value1</bold> (in foo(DataClass))
|
||||
6 <bold>val v</bold> = dataClass.value1 (in foo(DataClass))
|
||||
10 foo(dataClass.copy(<bold>value1</bold> = value)) (in bar(Int, DataClass))
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
// FLOW: OUT
|
||||
|
||||
class C(val <caret>v: Int)
|
||||
|
||||
fun foo() = C(v = 1)
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
3 class C(<bold>val v: Int</bold>) (in C)
|
||||
@@ -688,6 +688,11 @@ public class SlicerTreeTestGenerated extends AbstractSlicerTreeTest {
|
||||
runTest("idea/testData/slicer/outflow/memberPropertyUsages.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("namedArgumentForConstructorParameter.kt")
|
||||
public void testNamedArgumentForConstructorParameter() throws Exception {
|
||||
runTest("idea/testData/slicer/outflow/namedArgumentForConstructorParameter.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("nonInlineLetResult.kt")
|
||||
public void testNonInlineLetResult() throws Exception {
|
||||
runTest("idea/testData/slicer/outflow/nonInlineLetResult.kt");
|
||||
|
||||
Reference in New Issue
Block a user