Light classes: test extending Number and CharSequence

This commit is contained in:
Pavel V. Talanov
2017-05-15 19:57:12 +03:00
parent 1c5e7c4726
commit f750d08350
3 changed files with 91 additions and 0 deletions
@@ -0,0 +1,38 @@
public final class Container {
public Container() { /* compiled code */ }
public static final class MyString implements java.lang.CharSequence {
public int getLength() { /* compiled code */ }
@org.jetbrains.annotations.NotNull
public error.NonExistentClass chars() { /* compiled code */ }
@org.jetbrains.annotations.NotNull
public error.NonExistentClass codePoints() { /* compiled code */ }
public char get(int index) { /* compiled code */ }
@org.jetbrains.annotations.NotNull
public java.lang.CharSequence subSequence(int startIndex, int endIndex) { /* compiled code */ }
public MyString() { /* compiled code */ }
}
public static final class MyNumber extends java.lang.Number {
public byte toByte() { /* compiled code */ }
public char toChar() { /* compiled code */ }
public double toDouble() { /* compiled code */ }
public float toFloat() { /* compiled code */ }
public int toInt() { /* compiled code */ }
public long toLong() { /* compiled code */ }
public short toShort() { /* compiled code */ }
public MyNumber() { /* compiled code */ }
}
}
@@ -0,0 +1,47 @@
// p1.Container
package p1
class Container {
class MyString : CharSequence {
override val length: Int
get() = 0
override fun chars(): IntStream = error("")
override fun codePoints(): IntStream = error("")
override fun get(index: Int): Char = 'c'
override fun subSequence(startIndex: Int, endIndex: Int): CharSequence = MyString()
}
class MyNumber : Number {
override fun toByte(): Byte {
TODO("not implemented")
}
override fun toChar(): Char {
TODO("not implemented")
}
override fun toDouble(): Double {
TODO("not implemented")
}
override fun toFloat(): Float {
TODO("not implemented")
}
override fun toInt(): Int {
TODO("not implemented")
}
override fun toLong(): Long {
TODO("not implemented")
}
override fun toShort(): Short {
TODO("not implemented")
}
}
}