Fix some warnings in JS-specific stdlib sources
This commit is contained in:
@@ -5,7 +5,7 @@ public class IOException(message: String = "") : Exception() {}
|
||||
|
||||
@library
|
||||
public interface Closeable {
|
||||
public open fun close(): Unit
|
||||
public fun close(): Unit
|
||||
}
|
||||
|
||||
interface Serializable
|
||||
|
||||
@@ -16,10 +16,9 @@
|
||||
|
||||
package java.lang
|
||||
|
||||
|
||||
@library
|
||||
public interface Runnable {
|
||||
public open fun run(): Unit
|
||||
public fun run(): Unit
|
||||
}
|
||||
|
||||
public fun Runnable(action: () -> Unit): Runnable = object : Runnable {
|
||||
@@ -28,9 +27,9 @@ public fun Runnable(action: () -> Unit): Runnable = object : Runnable {
|
||||
|
||||
@library
|
||||
public interface Appendable {
|
||||
public open fun append(csq: CharSequence?): Appendable
|
||||
public open fun append(csq: CharSequence?, start: Int, end: Int): Appendable
|
||||
public open fun append(c: Char): Appendable
|
||||
public fun append(csq: CharSequence?): Appendable
|
||||
public fun append(csq: CharSequence?, start: Int, end: Int): Appendable
|
||||
public fun append(c: Char): Appendable
|
||||
}
|
||||
|
||||
@library
|
||||
|
||||
@@ -18,11 +18,11 @@ package java.util
|
||||
|
||||
@library
|
||||
public interface Comparator<T> {
|
||||
public fun compare(obj1: T, obj2: T): Int
|
||||
public fun compare(a: T, b: T): Int
|
||||
}
|
||||
|
||||
public inline fun <T> Comparator(crossinline comparison: (T, T) -> Int): Comparator<T> = object : Comparator<T> {
|
||||
override fun compare(obj1: T, obj2: T): Int = comparison(obj1, obj2)
|
||||
override fun compare(a: T, b: T): Int = comparison(a, b)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -499,7 +499,7 @@ public inline fun <T> Array<out T>.plusElement(element: T): Array<T> {
|
||||
*/
|
||||
@library("primitiveArraySort")
|
||||
public fun ByteArray.sort(): Unit {
|
||||
return noImpl
|
||||
noImpl
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -507,7 +507,7 @@ public fun ByteArray.sort(): Unit {
|
||||
*/
|
||||
@library("primitiveArraySort")
|
||||
public fun CharArray.sort(): Unit {
|
||||
return noImpl
|
||||
noImpl
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -515,7 +515,7 @@ public fun CharArray.sort(): Unit {
|
||||
*/
|
||||
@library("primitiveArraySort")
|
||||
public fun DoubleArray.sort(): Unit {
|
||||
return noImpl
|
||||
noImpl
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -523,7 +523,7 @@ public fun DoubleArray.sort(): Unit {
|
||||
*/
|
||||
@library("primitiveArraySort")
|
||||
public fun FloatArray.sort(): Unit {
|
||||
return noImpl
|
||||
noImpl
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -531,7 +531,7 @@ public fun FloatArray.sort(): Unit {
|
||||
*/
|
||||
@library("primitiveArraySort")
|
||||
public fun IntArray.sort(): Unit {
|
||||
return noImpl
|
||||
noImpl
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -539,7 +539,7 @@ public fun IntArray.sort(): Unit {
|
||||
*/
|
||||
@library("primitiveArraySort")
|
||||
public fun ShortArray.sort(): Unit {
|
||||
return noImpl
|
||||
noImpl
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -563,7 +563,7 @@ public fun LongArray.sort(): Unit {
|
||||
*/
|
||||
@native
|
||||
public fun <T> Array<out T>.sort(comparison: (T, T) -> Int): Unit {
|
||||
return noImpl
|
||||
noImpl
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -571,7 +571,7 @@ public fun <T> Array<out T>.sort(comparison: (T, T) -> Int): Unit {
|
||||
*/
|
||||
@native
|
||||
public fun ByteArray.sort(comparison: (Byte, Byte) -> Int): Unit {
|
||||
return noImpl
|
||||
noImpl
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -579,7 +579,7 @@ public fun ByteArray.sort(comparison: (Byte, Byte) -> Int): Unit {
|
||||
*/
|
||||
@native
|
||||
public fun CharArray.sort(comparison: (Char, Char) -> Int): Unit {
|
||||
return noImpl
|
||||
noImpl
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -587,7 +587,7 @@ public fun CharArray.sort(comparison: (Char, Char) -> Int): Unit {
|
||||
*/
|
||||
@native
|
||||
public fun DoubleArray.sort(comparison: (Double, Double) -> Int): Unit {
|
||||
return noImpl
|
||||
noImpl
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -595,7 +595,7 @@ public fun DoubleArray.sort(comparison: (Double, Double) -> Int): Unit {
|
||||
*/
|
||||
@native
|
||||
public fun FloatArray.sort(comparison: (Float, Float) -> Int): Unit {
|
||||
return noImpl
|
||||
noImpl
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -603,7 +603,7 @@ public fun FloatArray.sort(comparison: (Float, Float) -> Int): Unit {
|
||||
*/
|
||||
@native
|
||||
public fun IntArray.sort(comparison: (Int, Int) -> Int): Unit {
|
||||
return noImpl
|
||||
noImpl
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -611,7 +611,7 @@ public fun IntArray.sort(comparison: (Int, Int) -> Int): Unit {
|
||||
*/
|
||||
@native
|
||||
public fun LongArray.sort(comparison: (Long, Long) -> Int): Unit {
|
||||
return noImpl
|
||||
noImpl
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -619,7 +619,7 @@ public fun LongArray.sort(comparison: (Long, Long) -> Int): Unit {
|
||||
*/
|
||||
@native
|
||||
public fun ShortArray.sort(comparison: (Short, Short) -> Int): Unit {
|
||||
return noImpl
|
||||
noImpl
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -303,13 +303,13 @@ private class ReversedComparator<T>(public val comparator: Comparator<T>): Compa
|
||||
}
|
||||
|
||||
private object NaturalOrderComparator : Comparator<Comparable<Any>> {
|
||||
override fun compare(c1: Comparable<Any>, c2: Comparable<Any>): Int = c1.compareTo(c2)
|
||||
override fun compare(a: Comparable<Any>, b: Comparable<Any>): Int = a.compareTo(b)
|
||||
@Suppress("VIRTUAL_MEMBER_HIDDEN")
|
||||
fun reversed(): Comparator<Comparable<Any>> = ReverseOrderComparator
|
||||
}
|
||||
|
||||
private object ReverseOrderComparator: Comparator<Comparable<Any>> {
|
||||
override fun compare(c1: Comparable<Any>, c2: Comparable<Any>): Int = c2.compareTo(c1)
|
||||
override fun compare(a: Comparable<Any>, b: Comparable<Any>): Int = b.compareTo(a)
|
||||
@Suppress("VIRTUAL_MEMBER_HIDDEN")
|
||||
fun reversed(): Comparator<Comparable<Any>> = NaturalOrderComparator
|
||||
}
|
||||
|
||||
@@ -171,7 +171,7 @@ fun specialJS(): List<GenericFunction> {
|
||||
annotations("@native")
|
||||
returns("Unit")
|
||||
doc { "Sorts the array in-place according to the order specified by the given [comparison] function." }
|
||||
body { "return noImpl" }
|
||||
body { "noImpl" }
|
||||
}
|
||||
|
||||
templates add f("sortWith(comparator: Comparator<in T>)") {
|
||||
@@ -194,7 +194,7 @@ fun specialJS(): List<GenericFunction> {
|
||||
returns("Unit")
|
||||
doc { "Sorts the array in-place." }
|
||||
annotations("""@library("primitiveArraySort")""")
|
||||
body { "return noImpl" }
|
||||
body { "noImpl" }
|
||||
}
|
||||
|
||||
templates add f("sort()") {
|
||||
|
||||
Reference in New Issue
Block a user