mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-17 08:31:29 +00:00
Instance field generation in objects
This commit is contained in:
4
compiler/testData/codegen/boxWithJava/deprecatedFieldForObject/B.java
vendored
Normal file
4
compiler/testData/codegen/boxWithJava/deprecatedFieldForObject/B.java
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
public class B {
|
||||
public static int a = A.INSTANCE$.getC();
|
||||
public static int b = A.INSTANCE$.foo();
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import B
|
||||
|
||||
object A {
|
||||
val c = 1
|
||||
fun foo() = 4
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return if (B.a == 1 && B.b == 4) "OK" else "${B.a} ${B.b}"
|
||||
}
|
||||
Reference in New Issue
Block a user