Rename: Fix exception on attempt to rename KtConstructorDelegationReference
#KT-21536 Fixed
This commit is contained in:
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class Banana2 {
|
||||
final Supplier<String> f;
|
||||
|
||||
Banana2(Supplier<String> f) {this.f = f;}
|
||||
|
||||
Banana2() {this(() -> "Default");}
|
||||
|
||||
void goCrazy() {
|
||||
System.out.println(f.get());
|
||||
}
|
||||
}
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
class DoesntWork : Banana2 {
|
||||
constructor() : super()
|
||||
constructor(f: () -> String) : super(f)
|
||||
|
||||
companion object {
|
||||
@JvmStatic fun main(args: Array<String>) {
|
||||
val inst = DoesntWork {"Hi there"}
|
||||
inst.goCrazy()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ThisWorks(f: () -> String) : Banana2(f) {
|
||||
companion object {
|
||||
@JvmStatic fun main(args: Array<String>) {
|
||||
val inst = ThisWorks {"Hi there"}
|
||||
inst.goCrazy()
|
||||
}
|
||||
}
|
||||
}
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class Banana {
|
||||
final Supplier<String> f;
|
||||
|
||||
Banana(Supplier<String> f) {this.f = f;}
|
||||
|
||||
Banana() {this(() -> "Default");}
|
||||
|
||||
void goCrazy() {
|
||||
System.out.println(f.get());
|
||||
}
|
||||
}
|
||||
Vendored
+20
@@ -0,0 +1,20 @@
|
||||
class DoesntWork : Banana {
|
||||
constructor() : super()
|
||||
constructor(f: () -> String) : super(f)
|
||||
|
||||
companion object {
|
||||
@JvmStatic fun main(args: Array<String>) {
|
||||
val inst = DoesntWork {"Hi there"}
|
||||
inst.goCrazy()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ThisWorks(f: () -> String) : Banana(f) {
|
||||
companion object {
|
||||
@JvmStatic fun main(args: Array<String>) {
|
||||
val inst = ThisWorks {"Hi there"}
|
||||
inst.goCrazy()
|
||||
}
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"type": "JAVA_CLASS",
|
||||
"classId": "Banana",
|
||||
"newName": "Banana2"
|
||||
}
|
||||
Reference in New Issue
Block a user