[FIR] Support IntegerLiteralTypes

This commit is contained in:
Dmitriy Novozhilov
2019-12-09 15:02:55 +03:00
parent 5577f0f8cb
commit b76c984b26
145 changed files with 1815 additions and 585 deletions
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun box() : String {
val s = "notA"
val id = when (s) {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
fun box(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
fun box(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun foo(x: Long, y: Int, z: Double, s: String) {}
fun box(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// DONT_RUN_GENERATED_CODE: JS
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// FULL_JDK
@@ -1,5 +1,5 @@
// !LANGUAGE: +ProperIeee754Comparisons +NewInference
// IGNORE_BACKEND_FIR: JVM_IR
// !LANGUAGE: +ProperIeee754Comparisons +NewInference
fun box(): String {
if (-0.0 < 0.0) return "Fail 1"
@@ -1,4 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
class A {
class B1
class B2(val x: Int)
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
class CInt(val value: Int)
val nCInt3: CInt? = CInt(3)
@@ -1,4 +1,5 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun box(): String {
if (1 >= 1.9) return "Fail #1"
if (1.compareTo(1.1) >= 0) return "Fail #2"
+1 -1
View File
@@ -1,4 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun f(x: Long, zzz: Long = 1): Long
{
return if (x <= 1) zzz
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun foo(x: Int) = x
fun bar(x: Comparable<Int>) = if (x is Int) foo(x) else 0
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun box(): String {
lateinit var ok: String
run {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
lateinit var ok: String
fun box(): String {
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
fun abs(x: Int) = if (x < 0) -x else x
fun abs(x: Long) = if (x < 0) -x else x
+1
View File
@@ -1,3 +1,4 @@
// IGNORE_BACKEND_FIR: JVM_IR
// IGNORE_BACKEND: JS_IR
// TODO: muted automatically, investigate should it be ran for JS or not
// IGNORE_BACKEND: JS, NATIVE
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// WITH_RUNTIME
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// WITH_RUNTIME
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// WITH_RUNTIME
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// WITH_RUNTIME
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
// TARGET_BACKEND: JVM
// WITH_RUNTIME
-1
View File
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_FIR: JVM_IR
class LongR {
operator fun contains(l : Long): Boolean = l == 5.toLong()
}