We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0855282 commit a348170Copy full SHA for a348170
docs/topics/jvm/java-to-kotlin-interop.md
@@ -518,7 +518,7 @@ Box<Derived> boxDerived(Derived value) { ... }
518
Base unboxBase(Box<Base> box) { ... }
519
```
520
521
-The problem is that in Kotlin you can write `unboxBase(boxDerived("s"))` but in Java that would be impossible
+The problem is that in Kotlin you can write `unboxBase(boxDerived(Derived()))` but in Java that would be impossible
522
because in Java the class `Box` is *invariant* in its parameter `T`, and thus `Box<Derived>` is not a subtype of `Box<Base>`.
523
To make this work in Java, you would have to define `unboxBase` as follows:
524
0 commit comments