mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
Load special override as HIDDEN in case of signature clash
#KT-10151 Fixed
This commit is contained in:
27
compiler/testData/codegen/boxAgainstJava/specialBuiltins/CharBuffer.java
vendored
Normal file
27
compiler/testData/codegen/boxAgainstJava/specialBuiltins/CharBuffer.java
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
public abstract class CharBuffer implements CharSequence {
|
||||
public final int length() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public final char charAt(int index) {
|
||||
return 'K';
|
||||
}
|
||||
|
||||
// The key problem here is that `get` has the same signature as kotlin.CharSequence.get but completely different semantics
|
||||
public abstract char get(int index);
|
||||
public abstract CharBuffer subSequence(int start, int end);
|
||||
|
||||
public static CharBuffer impl() {
|
||||
return new CharBuffer() {
|
||||
@Override
|
||||
public char get(int index) {
|
||||
return 'O';
|
||||
}
|
||||
|
||||
@Override
|
||||
public CharBuffer subSequence(int start, int end) {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
5
compiler/testData/codegen/boxAgainstJava/specialBuiltins/CharBuffer.kt
vendored
Normal file
5
compiler/testData/codegen/boxAgainstJava/specialBuiltins/CharBuffer.kt
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
fun box(): String {
|
||||
val cb: CharBuffer = CharBuffer.impl()
|
||||
|
||||
return cb.get(0).toString() + (cb as CharSequence).get(1).toString()
|
||||
}
|
||||
Reference in New Issue
Block a user