[JS IR] Roll making Char inline class back

- un/mute falling tests
This commit is contained in:
Roman Artemev
2019-11-20 17:19:41 +03:00
committed by romanart
parent b9ac1341ff
commit 987c6ab3ee
14 changed files with 18 additions and 5 deletions
@@ -1,4 +1,5 @@
// SKIP_MINIFICATION
// IGNORE_BACKEND: JS_IR
@JsName("foo")
@JsExport
fun foo(): Char = '1'
+1
View File
@@ -1,4 +1,5 @@
// EXPECTED_REACHABLE_NODES: 1293
// IGNORE_BACKEND: JS_IR
open class A {
fun foo(): Char = 'X'
}
@@ -1,4 +1,5 @@
// EXPECTED_REACHABLE_NODES: 1276
// IGNORE_BACKEND: JS_IR
class A(val x: Char)
fun typeOf(x: dynamic): String = js("typeof x")
@@ -1,4 +1,5 @@
// EXPECTED_REACHABLE_NODES: 1288
// IGNORE_BACKEND: JS_IR
interface I {
val a: Char
}
@@ -1,4 +1,5 @@
// EXPECTED_REACHABLE_NODES: 1292
// IGNORE_BACKEND: JS_IR
abstract class A<out T> {
abstract fun foo(): T
}
@@ -1,4 +1,5 @@
// EXPECTED_REACHABLE_NODES: 1282
// IGNORE_BACKEND: JS_IR
fun box(): String {
val a = 'Q'.foo()
if (a != "number") return "fail1: $a"
@@ -1,4 +1,5 @@
// EXPECTED_REACHABLE_NODES: 1283
// IGNORE_BACKEND: JS_IR
// CHECK_NOT_CALLED_IN_SCOPE: function=toBoxedChar scope=box$lambda
// CHECK_CALLED_IN_SCOPE: function=unboxChar scope=box$lambda
// CHECK_CALLED_IN_SCOPE: function=toBoxedChar scope=box
@@ -1,4 +1,5 @@
// EXPECTED_REACHABLE_NODES: 1289
// IGNORE_BACKEND: JS_IR
open class A {
val foo: Char
get() = 'X'
@@ -1,4 +1,5 @@
// EXPECTED_REACHABLE_NODES: 1283
// IGNORE_BACKEND: JS_IR
fun foo(x: Any): String {
return when (x) {
is Char -> "char: ${x.toInt()}"
@@ -1,6 +1,5 @@
// EXPECTED_REACHABLE_NODES: 1290
// LANGUAGE_VERSION: 1.1
// IGNORE_BACKEND: JS_IR
import kotlin.reflect.KClass
fun box(): String {
@@ -1,4 +1,5 @@
// EXPECTED_REACHABLE_NODES: 1293
// IGNORE_BACKEND: JS_IR
package foo
@@ -1,4 +1,5 @@
// EXPECTED_REACHABLE_NODES: 1281
// IGNORE_BACKEND: JS_IR
fun box(): String {
val a = CharArray(1)
val aType = jsTypeOf(a.asDynamic()[0])
+5 -3
View File
@@ -9,9 +9,11 @@ package kotlin
* Represents a 16-bit Unicode character.
* On the JVM, non-nullable values of this type are represented as values of the primitive type `char`.
*/
@Suppress("NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS")
public inline class Char internal constructor (val value: Int) : Comparable<Char> {
// TODO: KT-35100
//@Suppress("NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS")
//public inline class Char internal constructor (val value: Int) : Comparable<Char> {
public data class Char internal constructor(val value: Int) : Comparable<Char> {
/**
* Compares this value with the specified value for order.
* Returns zero if this value is equal to the specified other value, a negative number if it's less than other,
+2 -1
View File
@@ -33,7 +33,8 @@ internal fun booleanArray(size: Int): BooleanArray = withType("BooleanArray", fi
internal fun booleanArrayOf(arr: Array<Boolean>): BooleanArray = withType("BooleanArray", arr.asDynamic().slice()).unsafeCast<BooleanArray>()
internal fun charArray(size: Int): CharArray = withType("CharArray", fillArrayVal(Array<Int>(size), 0)).unsafeCast<CharArray>()
//internal fun charArray(size: Int): CharArray = withType("CharArray", fillArrayVal(Array<Int>(size), 0)).unsafeCast<CharArray>()
internal fun charArray(size: Int): CharArray = withType("CharArray", fillArrayVal(Array<Char>(size), Char(0))).unsafeCast<CharArray>()
internal fun charArrayOf(arr: Array<Char>): CharArray = withType("CharArray", arr.asDynamic().slice()).unsafeCast<CharArray>()