Extract Function: Do not suggest "unit" as function name
#KT-6402 Fixed
This commit is contained in:
+5
-5
@@ -731,7 +731,8 @@ fun ExtractionData.performAnalysis(): AnalysisResult {
|
|||||||
)
|
)
|
||||||
controlFlowMessage?.let { messages.add(it) }
|
controlFlowMessage?.let { messages.add(it) }
|
||||||
|
|
||||||
controlFlow.outputValueBoxer.returnType.processTypeIfExtractable(paramsInfo.typeParameters, paramsInfo.nonDenotableTypes)
|
val returnType = controlFlow.outputValueBoxer.returnType
|
||||||
|
returnType.processTypeIfExtractable(paramsInfo.typeParameters, paramsInfo.nonDenotableTypes)
|
||||||
|
|
||||||
if (paramsInfo.nonDenotableTypes.isNotEmpty()) {
|
if (paramsInfo.nonDenotableTypes.isNotEmpty()) {
|
||||||
val typeStr = paramsInfo.nonDenotableTypes.map {it.renderForMessage()}.sort()
|
val typeStr = paramsInfo.nonDenotableTypes.map {it.renderForMessage()}.sort()
|
||||||
@@ -751,10 +752,9 @@ fun ExtractionData.performAnalysis(): AnalysisResult {
|
|||||||
if (targetSibling is JetClassInitializer) targetSibling.getParent() else targetSibling,
|
if (targetSibling is JetClassInitializer) targetSibling.getParent() else targetSibling,
|
||||||
JetNameValidatorImpl.Target.FUNCTIONS_AND_CLASSES
|
JetNameValidatorImpl.Target.FUNCTIONS_AND_CLASSES
|
||||||
)
|
)
|
||||||
val functionName = JetNameSuggester.suggestNames(
|
val functionName = if (returnType.isDefault()) "" else {
|
||||||
controlFlow.outputValueBoxer.returnType,
|
JetNameSuggester.suggestNames(returnType, functionNameValidator, DEFAULT_FUNCTION_NAME).first()
|
||||||
functionNameValidator, DEFAULT_FUNCTION_NAME
|
}
|
||||||
).first()
|
|
||||||
|
|
||||||
controlFlow.jumpOutputValue?.elementToInsertAfterCall?.accept(
|
controlFlow.jumpOutputValue?.elementToInsertAfterCall?.accept(
|
||||||
object : JetTreeVisitorVoid() {
|
object : JetTreeVisitorVoid() {
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ fun ExtractableCodeDescriptor.getDeclarationText(
|
|||||||
|
|
||||||
receiverParameter?.let { builder.receiver(descriptorRenderer.renderType(it.parameterType)) }
|
receiverParameter?.let { builder.receiver(descriptorRenderer.renderType(it.parameterType)) }
|
||||||
|
|
||||||
builder.name(name)
|
builder.name(if (name != "") name else DEFAULT_FUNCTION_NAME)
|
||||||
|
|
||||||
parameters.forEach { parameter ->
|
parameters.forEach { parameter ->
|
||||||
builder.param(parameter.name, descriptorRenderer.renderType(parameter.parameterType))
|
builder.param(parameter.name, descriptorRenderer.renderType(parameter.parameterType))
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
// PARAM_DESCRIPTOR: internal fun <T> kotlin.Array<T>.test(): kotlin.Unit defined in root package
|
// PARAM_DESCRIPTOR: internal fun <T> kotlin.Array<T>.test(): kotlin.Unit defined in root package
|
||||||
// SIBLING:
|
// SIBLING:
|
||||||
fun <T> Array<T>.test() {
|
fun <T> Array<T>.test() {
|
||||||
unit()
|
__dummyTestFun__()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun <T> Array<T>.unit() {
|
private fun <T> Array<T>.__dummyTestFun__() {
|
||||||
this.isEmpty()
|
this.isEmpty()
|
||||||
}
|
}
|
||||||
+2
-2
@@ -6,13 +6,13 @@
|
|||||||
fun foo(a: Int): Int {
|
fun foo(a: Int): Int {
|
||||||
val b: Int = 1
|
val b: Int = 1
|
||||||
for (n in 1..a) {
|
for (n in 1..a) {
|
||||||
unit(a, b)
|
__dummyTestFun__(a, b)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit(a: Int, b: Int) {
|
private fun __dummyTestFun__(a: Int, b: Int) {
|
||||||
if (a + b > 0) return
|
if (a + b > 0) return
|
||||||
println(a - b)
|
println(a - b)
|
||||||
return
|
return
|
||||||
|
|||||||
+2
-2
@@ -6,13 +6,13 @@
|
|||||||
fun foo(a: Int): Int {
|
fun foo(a: Int): Int {
|
||||||
val b: Int = 1
|
val b: Int = 1
|
||||||
for (n in 1..a) {
|
for (n in 1..a) {
|
||||||
unit(a, b)
|
__dummyTestFun__(a, b)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit(a: Int, b: Int) {
|
private fun __dummyTestFun__(a: Int, b: Int) {
|
||||||
if (a + b > 0) return
|
if (a + b > 0) return
|
||||||
else {
|
else {
|
||||||
println(a - b)
|
println(a - b)
|
||||||
|
|||||||
+2
-2
@@ -6,13 +6,13 @@
|
|||||||
fun foo(a: Int): Int {
|
fun foo(a: Int): Int {
|
||||||
val b: Int = 1
|
val b: Int = 1
|
||||||
for (n in 1..a) {
|
for (n in 1..a) {
|
||||||
unit(a, b)
|
__dummyTestFun__(a, b)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit(a: Int, b: Int) {
|
private fun __dummyTestFun__(a: Int, b: Int) {
|
||||||
when {
|
when {
|
||||||
a + b > 0 -> return
|
a + b > 0 -> return
|
||||||
a - b > 0 -> return
|
a - b > 0 -> return
|
||||||
|
|||||||
@@ -7,10 +7,10 @@
|
|||||||
fun foo(a: Int) {
|
fun foo(a: Int) {
|
||||||
val b: Int = 1
|
val b: Int = 1
|
||||||
|
|
||||||
unit(a, b)
|
__dummyTestFun__(a, b)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit(a: Int, b: Int) {
|
private fun __dummyTestFun__(a: Int, b: Int) {
|
||||||
if (a > 0) {
|
if (a > 0) {
|
||||||
println(a)
|
println(a)
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -8,13 +8,13 @@ fun foo(a: Int) {
|
|||||||
val b: Int = 1
|
val b: Int = 1
|
||||||
|
|
||||||
val c: Int
|
val c: Int
|
||||||
unit(a, b)
|
__dummyTestFun__(a, b)
|
||||||
|
|
||||||
c = 1
|
c = 1
|
||||||
println(c)
|
println(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit(a: Int, b: Int) {
|
private fun __dummyTestFun__(a: Int, b: Int) {
|
||||||
if (a > 0) {
|
if (a > 0) {
|
||||||
println(a)
|
println(a)
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -4,10 +4,10 @@
|
|||||||
fun foo(a: Int) {
|
fun foo(a: Int) {
|
||||||
val b: Int = 1
|
val b: Int = 1
|
||||||
|
|
||||||
unit(a)
|
__dummyTestFun__(a)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit(a: Int) {
|
private fun __dummyTestFun__(a: Int) {
|
||||||
var t = a
|
var t = a
|
||||||
while (t > 0) {
|
while (t > 0) {
|
||||||
if (t == 2) continue
|
if (t == 2) continue
|
||||||
|
|||||||
+2
-2
@@ -11,11 +11,11 @@ fun bar(a: Int): Int {
|
|||||||
fun foo(a: Int) {
|
fun foo(a: Int) {
|
||||||
val b: Int = 1
|
val b: Int = 1
|
||||||
|
|
||||||
unit(a, b)
|
__dummyTestFun__(a, b)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit(a: Int, b: Int) {
|
private fun __dummyTestFun__(a: Int, b: Int) {
|
||||||
if (a > 0) {
|
if (a > 0) {
|
||||||
bar(a)
|
bar(a)
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
+2
-2
@@ -11,9 +11,9 @@ fun bar(a: Int): Int {
|
|||||||
fun foo(a: Int) {
|
fun foo(a: Int) {
|
||||||
val b: Int = 1
|
val b: Int = 1
|
||||||
|
|
||||||
unit(a, b)
|
__dummyTestFun__(a, b)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit(a: Int, b: Int) {
|
private fun __dummyTestFun__(a: Int, b: Int) {
|
||||||
if (a > 0) bar(a) else b
|
if (a > 0) bar(a) else b
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -11,11 +11,11 @@ fun bar(a: Int): Int {
|
|||||||
fun foo(a: Int) {
|
fun foo(a: Int) {
|
||||||
val b: Int = 1
|
val b: Int = 1
|
||||||
|
|
||||||
unit(a, b)
|
__dummyTestFun__(a, b)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit(a: Int, b: Int) {
|
private fun __dummyTestFun__(a: Int, b: Int) {
|
||||||
when {
|
when {
|
||||||
a > 0 -> {
|
a > 0 -> {
|
||||||
bar(a)
|
bar(a)
|
||||||
|
|||||||
+2
-2
@@ -11,11 +11,11 @@ fun bar(a: Int): Int {
|
|||||||
fun foo(a: Int) {
|
fun foo(a: Int) {
|
||||||
val b: Int = 1
|
val b: Int = 1
|
||||||
|
|
||||||
unit(a, b)
|
__dummyTestFun__(a, b)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit(a: Int, b: Int) {
|
private fun __dummyTestFun__(a: Int, b: Int) {
|
||||||
when {
|
when {
|
||||||
a > 0 -> bar(a)
|
a > 0 -> bar(a)
|
||||||
else -> b
|
else -> b
|
||||||
|
|||||||
+2
-2
@@ -2,10 +2,10 @@ class T(val n: Int)
|
|||||||
|
|
||||||
// SIBLING:
|
// SIBLING:
|
||||||
fun foo() {
|
fun foo() {
|
||||||
unit()
|
__dummyTestFun__()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit() {
|
private fun __dummyTestFun__() {
|
||||||
bar { t ->
|
bar { t ->
|
||||||
val k = 1
|
val k = 1
|
||||||
t.n + k + 1
|
t.n + k + 1
|
||||||
|
|||||||
+2
-2
@@ -2,10 +2,10 @@ class T(val n: Int)
|
|||||||
|
|
||||||
// SIBLING:
|
// SIBLING:
|
||||||
fun foo() {
|
fun foo() {
|
||||||
unit()
|
__dummyTestFun__()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit() {
|
private fun __dummyTestFun__() {
|
||||||
if (true) {
|
if (true) {
|
||||||
val k = 1
|
val k = 1
|
||||||
T().n + k + 1
|
T().n + k + 1
|
||||||
|
|||||||
@@ -5,17 +5,17 @@
|
|||||||
|
|
||||||
// SIBLING:
|
// SIBLING:
|
||||||
fun foo(a: Int, b: Int) {
|
fun foo(a: Int, b: Int) {
|
||||||
unit(a, b)
|
__dummyTestFun__(a, b)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun bar() {
|
fun bar() {
|
||||||
val x = 1
|
val x = 1
|
||||||
val y = 2
|
val y = 2
|
||||||
|
|
||||||
unit(x, y)
|
__dummyTestFun__(x, y)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit(a: Int, b: Int) {
|
private fun __dummyTestFun__(a: Int, b: Int) {
|
||||||
println("a = $a")
|
println("a = $a")
|
||||||
println("b = $b")
|
println("b = $b")
|
||||||
println(a + b * a)
|
println(a + b * a)
|
||||||
|
|||||||
+2
-2
@@ -3,13 +3,13 @@
|
|||||||
fun foo() {
|
fun foo() {
|
||||||
val (a, b) =
|
val (a, b) =
|
||||||
if (true) {
|
if (true) {
|
||||||
unit()
|
__dummyTestFun__()
|
||||||
1 to 2
|
1 to 2
|
||||||
} else {
|
} else {
|
||||||
2 to 3
|
2 to 3
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit() {
|
private fun __dummyTestFun__() {
|
||||||
1 + 1
|
1 + 1
|
||||||
}
|
}
|
||||||
+2
-2
@@ -5,10 +5,10 @@
|
|||||||
// SIBLING:
|
// SIBLING:
|
||||||
val x = object {
|
val x = object {
|
||||||
fun test() {
|
fun test() {
|
||||||
unit()
|
__dummyTestFun__()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun Any.unit() {
|
private fun Any.__dummyTestFun__() {
|
||||||
println(this)
|
println(this)
|
||||||
}
|
}
|
||||||
+2
-2
@@ -13,9 +13,9 @@ fun foo(a: A) {
|
|||||||
// SIBLING:
|
// SIBLING:
|
||||||
fun test() {
|
fun test() {
|
||||||
val x = object: A() { }
|
val x = object: A() { }
|
||||||
unit(x)
|
__dummyTestFun__(x)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit(x: A) {
|
private fun __dummyTestFun__(x: A) {
|
||||||
foo(x)
|
foo(x)
|
||||||
}
|
}
|
||||||
+2
-2
@@ -11,10 +11,10 @@ class X<T> {
|
|||||||
// SIBLING:
|
// SIBLING:
|
||||||
fun foo(s: String?, x: X<Any>) {
|
fun foo(s: String?, x: X<Any>) {
|
||||||
when {
|
when {
|
||||||
s != null -> unit(s, x)
|
s != null -> __dummyTestFun__(s, x)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit(s: String, x: X<Any>) {
|
private fun __dummyTestFun__(s: String, x: X<Any>) {
|
||||||
x.add(s)
|
x.add(s)
|
||||||
}
|
}
|
||||||
+2
-2
@@ -11,10 +11,10 @@ class X<T> {
|
|||||||
// SIBLING:
|
// SIBLING:
|
||||||
fun foo(s: String?, x: X<Any?>) {
|
fun foo(s: String?, x: X<Any?>) {
|
||||||
when {
|
when {
|
||||||
s != null -> unit(s, x)
|
s != null -> __dummyTestFun__(s, x)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit(s: String?, x: X<Any?>) {
|
private fun __dummyTestFun__(s: String?, x: X<Any?>) {
|
||||||
x.add(s)
|
x.add(s)
|
||||||
}
|
}
|
||||||
+2
-2
@@ -30,11 +30,11 @@ class C: AImpl(), B {
|
|||||||
|
|
||||||
// SIBLING:
|
// SIBLING:
|
||||||
fun foo(c: C) {
|
fun foo(c: C) {
|
||||||
unit(c)
|
__dummyTestFun__(c)
|
||||||
c.doB()
|
c.doB()
|
||||||
c.doC()
|
c.doC()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit(c: C) {
|
private fun __dummyTestFun__(c: C) {
|
||||||
c.doA()
|
c.doA()
|
||||||
}
|
}
|
||||||
+2
-2
@@ -31,10 +31,10 @@ class C: AImpl(), B {
|
|||||||
// SIBLING:
|
// SIBLING:
|
||||||
fun foo(c: C) {
|
fun foo(c: C) {
|
||||||
c.doA()
|
c.doA()
|
||||||
unit(c)
|
__dummyTestFun__(c)
|
||||||
c.doC()
|
c.doC()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit(c: C) {
|
private fun __dummyTestFun__(c: C) {
|
||||||
c.doB()
|
c.doB()
|
||||||
}
|
}
|
||||||
+2
-2
@@ -32,9 +32,9 @@ class C: AImpl(), B {
|
|||||||
fun foo(c: C) {
|
fun foo(c: C) {
|
||||||
c.doA()
|
c.doA()
|
||||||
c.doB()
|
c.doB()
|
||||||
unit(c)
|
__dummyTestFun__(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit(c: C) {
|
private fun __dummyTestFun__(c: C) {
|
||||||
c.doC()
|
c.doC()
|
||||||
}
|
}
|
||||||
+2
-2
@@ -30,11 +30,11 @@ class C: AImpl(), B {
|
|||||||
|
|
||||||
// SIBLING:
|
// SIBLING:
|
||||||
fun foo(c: C) {
|
fun foo(c: C) {
|
||||||
unit(c)
|
__dummyTestFun__(c)
|
||||||
c.doC()
|
c.doC()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit(c: C) {
|
private fun __dummyTestFun__(c: C) {
|
||||||
c.doA()
|
c.doA()
|
||||||
c.doB()
|
c.doB()
|
||||||
}
|
}
|
||||||
@@ -3,10 +3,10 @@
|
|||||||
// SIBLING:
|
// SIBLING:
|
||||||
fun main(args: Array<String>) {
|
fun main(args: Array<String>) {
|
||||||
val (a, b) = Data(1, 2)
|
val (a, b) = Data(1, 2)
|
||||||
unit(a)
|
__dummyTestFun__(a)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit(a: Int) {
|
private fun __dummyTestFun__(a: Int) {
|
||||||
a
|
a
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,13 +1,13 @@
|
|||||||
// SIBLING:
|
// SIBLING:
|
||||||
class MyClass {
|
class MyClass {
|
||||||
fun test() {
|
fun test() {
|
||||||
unit()
|
__dummyTestFun__()
|
||||||
}
|
}
|
||||||
|
|
||||||
public annotation class P
|
public annotation class P
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit() {
|
private fun __dummyTestFun__() {
|
||||||
[MyClass.P] val t: Int = 1
|
[MyClass.P] val t: Int = 1
|
||||||
t
|
t
|
||||||
}
|
}
|
||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
// SIBLING:
|
// SIBLING:
|
||||||
class MyClass {
|
class MyClass {
|
||||||
fun test() {
|
fun test() {
|
||||||
unit()
|
__dummyTestFun__()
|
||||||
}
|
}
|
||||||
|
|
||||||
public class P {
|
public class P {
|
||||||
@@ -12,7 +12,7 @@ class MyClass {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit() {
|
private fun __dummyTestFun__() {
|
||||||
MyClass.P.foo()
|
MyClass.P.foo()
|
||||||
MyClass.P.a
|
MyClass.P.a
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
// SIBLING:
|
// SIBLING:
|
||||||
class MyClass {
|
class MyClass {
|
||||||
fun test() {
|
fun test() {
|
||||||
unit()
|
__dummyTestFun__()
|
||||||
}
|
}
|
||||||
|
|
||||||
enum class P {
|
enum class P {
|
||||||
@@ -12,7 +12,7 @@ class MyClass {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit() {
|
private fun __dummyTestFun__() {
|
||||||
MyClass.P.A.foo()
|
MyClass.P.A.foo()
|
||||||
MyClass.P.A.a
|
MyClass.P.A.a
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
// SIBLING:
|
// SIBLING:
|
||||||
class MyClass {
|
class MyClass {
|
||||||
fun test() {
|
fun test() {
|
||||||
unit()
|
__dummyTestFun__()
|
||||||
}
|
}
|
||||||
|
|
||||||
object P {
|
object P {
|
||||||
@@ -10,7 +10,7 @@ class MyClass {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit() {
|
private fun __dummyTestFun__() {
|
||||||
MyClass.P.foo()
|
MyClass.P.foo()
|
||||||
MyClass.P.a
|
MyClass.P.a
|
||||||
}
|
}
|
||||||
@@ -6,11 +6,11 @@ fun foo() = 1
|
|||||||
// SIBLING:
|
// SIBLING:
|
||||||
class MyClass {
|
class MyClass {
|
||||||
fun test() {
|
fun test() {
|
||||||
unit()
|
__dummyTestFun__()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit() {
|
private fun __dummyTestFun__() {
|
||||||
foo()
|
foo()
|
||||||
a
|
a
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
// SIBLING:
|
// SIBLING:
|
||||||
class MyClass {
|
class MyClass {
|
||||||
fun test() {
|
fun test() {
|
||||||
unit()
|
__dummyTestFun__()
|
||||||
}
|
}
|
||||||
|
|
||||||
public class P<T> {
|
public class P<T> {
|
||||||
@@ -11,6 +11,6 @@ class MyClass {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit() {
|
private fun __dummyTestFun__() {
|
||||||
val t: MyClass.P<MyClass.P.Q>? = null
|
val t: MyClass.P<MyClass.P.Q>? = null
|
||||||
}
|
}
|
||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
// SIBLING:
|
// SIBLING:
|
||||||
class MyClass {
|
class MyClass {
|
||||||
fun test() {
|
fun test() {
|
||||||
unit()
|
__dummyTestFun__()
|
||||||
}
|
}
|
||||||
|
|
||||||
public class P<T> {
|
public class P<T> {
|
||||||
@@ -15,7 +15,7 @@ class MyClass {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit() {
|
private fun __dummyTestFun__() {
|
||||||
val a: Any = MyClass.P.Q()
|
val a: Any = MyClass.P.Q()
|
||||||
val t = MyClass.P.R<MyClass.P.Q>(a as MyClass.P.Q)
|
val t = MyClass.P.R<MyClass.P.Q>(a as MyClass.P.Q)
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
// SIBLING:
|
// SIBLING:
|
||||||
class MyClass {
|
class MyClass {
|
||||||
fun test() {
|
fun test() {
|
||||||
unit()
|
__dummyTestFun__()
|
||||||
}
|
}
|
||||||
|
|
||||||
public class P {
|
public class P {
|
||||||
@@ -11,7 +11,7 @@ class MyClass {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit() {
|
private fun __dummyTestFun__() {
|
||||||
val t: MyClass.P.Q = MyClass.P.Q()
|
val t: MyClass.P.Q = MyClass.P.Q()
|
||||||
t
|
t
|
||||||
}
|
}
|
||||||
@@ -4,10 +4,10 @@ package p
|
|||||||
object O {
|
object O {
|
||||||
val a = 1
|
val a = 1
|
||||||
fun test() {
|
fun test() {
|
||||||
unit()
|
__dummyTestFun__()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit() {
|
private fun __dummyTestFun__() {
|
||||||
O.a
|
O.a
|
||||||
}
|
}
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
// SIBLING:
|
// SIBLING:
|
||||||
class MyClass {
|
class MyClass {
|
||||||
fun test() {
|
fun test() {
|
||||||
unit()
|
__dummyTestFun__()
|
||||||
}
|
}
|
||||||
|
|
||||||
public class P
|
public class P
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit() {
|
private fun __dummyTestFun__() {
|
||||||
val t: MyClass.P = MyClass.P()
|
val t: MyClass.P = MyClass.P()
|
||||||
t
|
t
|
||||||
}
|
}
|
||||||
+2
-2
@@ -6,9 +6,9 @@ class A {
|
|||||||
// SIBLING:
|
// SIBLING:
|
||||||
fun testProp() {
|
fun testProp() {
|
||||||
val foo = A()
|
val foo = A()
|
||||||
unit(foo)
|
__dummyTestFun__(foo)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun unit(foo: A) {
|
private fun __dummyTestFun__(foo: A) {
|
||||||
foo()
|
foo()
|
||||||
}
|
}
|
||||||
+1
-1
@@ -125,7 +125,7 @@ public abstract class AbstractJetExtractionTest() : JetLightCodeInsightFixtureTe
|
|||||||
assertEquals(expectedDescriptors, actualDescriptors, "Expected descriptors mismatch.")
|
assertEquals(expectedDescriptors, actualDescriptors, "Expected descriptors mismatch.")
|
||||||
assertEquals(expectedTypes, actualTypes, "Expected types mismatch.")
|
assertEquals(expectedTypes, actualTypes, "Expected types mismatch.")
|
||||||
|
|
||||||
return descriptor
|
return if (descriptor.name == "") descriptor.copy(name = "__dummyTestFun__") else descriptor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
).doInvoke(editor, file, elements, explicitPreviousSibling ?: previousSibling)
|
).doInvoke(editor, file, elements, explicitPreviousSibling ?: previousSibling)
|
||||||
|
|||||||
Reference in New Issue
Block a user