diff --git a/transpiler/javatests/com/google/j2cl/readable/java/nativekttypes/Main.java b/transpiler/javatests/com/google/j2cl/readable/java/nativekttypes/Main.java index 4616ab2812..4ae212cd7d 100644 --- a/transpiler/javatests/com/google/j2cl/readable/java/nativekttypes/Main.java +++ b/transpiler/javatests/com/google/j2cl/readable/java/nativekttypes/Main.java @@ -35,6 +35,8 @@ public void memberAccess() { topLevel.instanceField = "foo"; Object fooStaticField = topLevel.staticField; topLevel.staticField = "foo"; + // TODO(b/380317304): Uncomment when fixed. + // topLevel.nonPublicField = 0; int i1 = topLevel.fieldToRename; int i2 = topLevel.methodToRename(); int i3 = topLevel.getMethodAsProperty(); @@ -43,6 +45,8 @@ public void memberAccess() { boolean i6 = topLevel.isFieldToRename; boolean i7 = topLevel.isMethodAsProperty(); int i8 = topLevel.getstartingmethodAsProperty(); + // TODO(b/380317304): Uncomment when fixed. + // topLevel.nonPublicMethod(); NativeTopLevel.Nested nested = new NativeTopLevel.Nested<>("foo"); String nestedInstanceMethod = nested.instanceMethod("foo"); diff --git a/transpiler/javatests/com/google/j2cl/readable/java/nativekttypes/NativeTopLevel.java b/transpiler/javatests/com/google/j2cl/readable/java/nativekttypes/NativeTopLevel.java index 8fd00b65db..f5136df8b2 100644 --- a/transpiler/javatests/com/google/j2cl/readable/java/nativekttypes/NativeTopLevel.java +++ b/transpiler/javatests/com/google/j2cl/readable/java/nativekttypes/NativeTopLevel.java @@ -45,6 +45,8 @@ public Inner(I i) {} @KtName("renamedField") public int fieldToRename; + int nonPublicField; + @KtName("renamedMethod") public native int methodToRename(); @@ -75,5 +77,7 @@ public NativeTopLevel(O o) {} public native O instanceMethod(O o); + native void nonPublicMethod(); + public static native S staticMethod(S s); } diff --git a/transpiler/javatests/com/google/j2cl/readable/java/nativekttypes/nativekt/KTopLevel.java b/transpiler/javatests/com/google/j2cl/readable/java/nativekttypes/nativekt/KTopLevel.java index 1e06f6ffb9..a179af705a 100644 --- a/transpiler/javatests/com/google/j2cl/readable/java/nativekttypes/nativekt/KTopLevel.java +++ b/transpiler/javatests/com/google/j2cl/readable/java/nativekttypes/nativekt/KTopLevel.java @@ -47,6 +47,8 @@ public KInner(I i) {} public static Object staticField; public int renamedField; + int nonPublicField; + public int renamedMethod() { return 0; } @@ -90,6 +92,8 @@ public O instanceMethod(O o) { return o; } + void nonPublicMethod() {} + public static S staticMethod(S s) { return s; } diff --git a/transpiler/javatests/com/google/j2cl/readable/java/nativekttypes/output_kt/nativekt/KTopLevel.kt.txt b/transpiler/javatests/com/google/j2cl/readable/java/nativekttypes/output_kt/nativekt/KTopLevel.kt.txt index 4eca89957d..e187da07a6 100644 --- a/transpiler/javatests/com/google/j2cl/readable/java/nativekttypes/output_kt/nativekt/KTopLevel.kt.txt +++ b/transpiler/javatests/com/google/j2cl/readable/java/nativekttypes/output_kt/nativekt/KTopLevel.kt.txt @@ -39,6 +39,9 @@ open class KTopLevel { @ObjCName("renamedField_") var renamedField: Int = 0 + @JvmField + internal var nonPublicField_pp_nativekttypes_nativekt: Int = 0 + @ObjCName("renamedMethod") open fun renamedMethod(): Int { return 0 @@ -95,6 +98,8 @@ open class KTopLevel { return o } + internal open fun nonPublicMethod_pp_nativekttypes_nativekt() {} + @ObjCName("J2ktNativekttypesNativektKTopLevelCompanion", exact = true) companion object { @JvmField