removing static type assertions work in progress
This commit is contained in:
@@ -28,7 +28,7 @@ class PairTest {
|
||||
assertNotEquals(Pair(2, "a"), p)
|
||||
assertNotEquals(Pair(1, "b"), p)
|
||||
assertTrue(!p.equals(null))
|
||||
assertNotEquals("", (p : Any))
|
||||
assertNotEquals("", (p as Any))
|
||||
}
|
||||
|
||||
@test fun pairHashCode() {
|
||||
@@ -78,7 +78,7 @@ class TripleTest {
|
||||
assertNotEquals(Triple(1, "b", 0.07), t)
|
||||
assertNotEquals(Triple(1, "a", 0.1), t)
|
||||
assertTrue(!t.equals(null))
|
||||
assertNotEquals("", (t : Any))
|
||||
assertNotEquals("", (t as Any))
|
||||
}
|
||||
|
||||
@test fun tripleHashCode() {
|
||||
|
||||
@@ -282,7 +282,7 @@ class ArraysTest {
|
||||
expect(0) { arrayOf("cat", "dog", "bird").indexOf("cat") }
|
||||
expect(1) { arrayOf("cat", "dog", "bird").indexOf("dog") }
|
||||
expect(2) { arrayOf("cat", "dog", "bird").indexOf("bird") }
|
||||
expect(0) { arrayOf(null, "dog", null).indexOf(null : String?)}
|
||||
expect(0) { arrayOf(null, "dog", null).indexOf(null as String?)}
|
||||
|
||||
expect(-1) { arrayOf("cat", "dog", "bird").indexOfFirst { it.contains("p") } }
|
||||
expect(0) { arrayOf("cat", "dog", "bird").indexOfFirst { it.startsWith('c') } }
|
||||
@@ -299,7 +299,7 @@ class ArraysTest {
|
||||
expect(-1) { arrayOf("cat", "dog", "bird").lastIndexOf("mouse") }
|
||||
expect(0) { arrayOf("cat", "dog", "bird").lastIndexOf("cat") }
|
||||
expect(1) { arrayOf("cat", "dog", "bird").lastIndexOf("dog") }
|
||||
expect(2) { arrayOf(null, "dog", null).lastIndexOf(null : String?)}
|
||||
expect(2) { arrayOf(null, "dog", null).lastIndexOf(null as String?)}
|
||||
expect(3) { arrayOf("cat", "dog", "bird", "dog").lastIndexOf("dog") }
|
||||
|
||||
expect(-1) { arrayOf("cat", "dog", "bird").indexOfLast { it.contains("p") } }
|
||||
|
||||
@@ -12,7 +12,7 @@ fun specialJS(): List<GenericFunction> {
|
||||
body(ArraysOfObjects) {
|
||||
"""
|
||||
val al = ArrayList<T>()
|
||||
(al: dynamic).array = this // black dynamic magic
|
||||
al.asDynamic().array = this // black dynamic magic
|
||||
return al
|
||||
"""
|
||||
}
|
||||
@@ -46,7 +46,7 @@ fun specialJS(): List<GenericFunction> {
|
||||
returns("SELF")
|
||||
returns(ArraysOfObjects) { "Array<T>" }
|
||||
body {
|
||||
"return (this: dynamic).slice(fromIndex, toIndex)"
|
||||
"return this.asDynamic().slice(fromIndex, toIndex)"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ fun specialJS(): List<GenericFunction> {
|
||||
returns("SELF")
|
||||
returns(ArraysOfObjects) { "Array<T>" }
|
||||
body {
|
||||
"return (this: dynamic).slice(0)"
|
||||
"return this.asDynamic().slice(0)"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ fun specialJS(): List<GenericFunction> {
|
||||
doc { "Returns an array containing all elements of the original array and then the given [element]." }
|
||||
body() {
|
||||
"""
|
||||
return (this: dynamic).concat(arrayOf(element))
|
||||
return this.asDynamic().concat(arrayOf(element))
|
||||
"""
|
||||
}
|
||||
}
|
||||
@@ -126,7 +126,7 @@ fun specialJS(): List<GenericFunction> {
|
||||
returns(ArraysOfObjects) { "Array<T>" }
|
||||
body {
|
||||
"""
|
||||
return (this: dynamic).concat(array)
|
||||
return this.asDynamic().concat(array)
|
||||
"""
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user