@@ -547,6 +547,35 @@ class Java2SwiftTests: XCTestCase {
547547 ]
548548 )
549549 }
550+
551+ func testCovariantInJavaNotInSwiftOverride3( ) throws {
552+ try assertTranslatedClass (
553+ NIOByteBuffer . self,
554+ swiftTypeName: " NIOByteBuffer " ,
555+ asClass: true ,
556+ translatedClasses: [
557+ " java.lang.Object " : ( " JavaObject " , " JavaKit " ) ,
558+ " java.lang.Class " : ( " JavaClass " , " JavaKit " ) ,
559+ " java.nio.Buffer " : ( " NIOBuffer " , " JavaKitNIO " ) ,
560+ " java.nio.ByteBuffer " : ( " NIOByteBuffer " , " JavaKitNIO " ) ,
561+ ] ,
562+ expectedChunks: [
563+ " import JavaKitNIO " ,
564+ """
565+ @JavaClass( " java.nio.ByteBuffer " )
566+ open class NIOByteBuffer: NIOBuffer {
567+ """ ,
568+ """
569+ @JavaMethod
570+ open func array() -> [Int8]
571+ """ ,
572+ """
573+ @JavaMethod
574+ open override func arrayOffset() -> Int32
575+ """ ,
576+ ]
577+ )
578+ }
550579}
551580
552581@JavaClass ( " java.lang.ClassLoader " )
@@ -597,6 +626,16 @@ public struct Executable {
597626public struct TypeVariable < D: AnyJavaObject > {
598627}
599628
629+ @JavaClass ( " java.nio.Buffer " )
630+ open class NIOBuffer : JavaObject {
631+
632+ }
633+
634+ @JavaClass ( " java.nio.ByteBuffer " )
635+ open class NIOByteBuffer : NIOBuffer {
636+
637+ }
638+
600639/// Translate a Java class and assert that the translated output contains
601640/// each of the expected "chunks" of text.
602641func assertTranslatedClass< JavaClassType: AnyJavaObject > (
0 commit comments