Skip to content

Commit 32e8b3d

Browse files
Googlercopybara-github
authored andcommitted
[J2KT] Fix problem with generic parameters with nullable bounds in J2ObjCCompat.h.
PiperOrigin-RevId: 863256465
1 parent b73a021 commit 32e8b3d

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

transpiler/java/com/google/j2cl/transpiler/backend/kotlin/J2ObjCCompatRenderer.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ internal class J2ObjCCompatRenderer(private val objCNamePrefix: String) {
560560
declaredObjCDependentSource(typeDescriptor)
561561
// TODO: Handle TypeVariable and Array
562562
else -> id
563-
}.runIf(typeDescriptor.isNullable) { toNullable() }
563+
}.runIf(typeDescriptor.canBeNull()) { toNullable() }
564564

565565
private fun primitiveObjCDependentSource(
566566
primitiveTypeDescriptor: PrimitiveTypeDescriptor

transpiler/javatests/com/google/j2cl/integration/java/j2ktiosinterop/J2ktObjCInteropTest.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,8 +588,7 @@ - (void)testPlatform {
588588
- (void)testNullability {
589589
J2ktiosinteropNullability_acceptNullableWithId_(nil);
590590
J2ktiosinteropNullability_acceptNullableWithNonNullBoundWithId_(nil);
591-
// TODO(b/460155951): Uncomment when fixed.
592-
// J2ktiosinteropNullability_acceptWithNullableBoundWithId_(nil);
591+
J2ktiosinteropNullability_acceptWithNullableBoundWithId_(nil);
593592
J2ktiosinteropNullability_acceptNullableWithNullableBoundWithId_(nil);
594593
}
595594

transpiler/javatests/com/google/j2cl/integration/java/j2ktiosinterop/J2ktSwiftInteropTest.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,7 @@ final class J2ktSwiftInteropTest: XCTestCase {
205205
func testNullability() {
206206
J2ktiosinteropNullability_acceptNullableWithId_(nil)
207207
J2ktiosinteropNullability_acceptNullableWithNonNullBoundWithId_(nil)
208-
// TODO(b/460155951): Uncomment when fixed.
209-
// J2ktiosinteropNullability_acceptWithNullableBoundWithId_(nil);
208+
J2ktiosinteropNullability_acceptWithNullableBoundWithId_(nil);
210209
J2ktiosinteropNullability_acceptNullableWithNullableBoundWithId_(nil)
211210
}
212211
}

0 commit comments

Comments
 (0)