dasralph
10/26/2015, 5:16 PMclass Outer {
val foo: String? = null
inner class Inner {
fun foo() {
if (foo != null) {
foo.concat("bar")
}
}
}
}
generates this Java Class
public final class Outer {
@Nullable
private final String foo;
@Nullable
public final String getFoo() {
return this.foo;
}
public final class Inner {
public final void foo() {
if (this.this$0.getFoo() != null) {
StringsKt.concat(this.this$0.getFoo(), "bar");
}
}
}
}
My question now is: Is it possible to generate Java code where the inner class uses a WeakReference to access the outer class?