From 99d47da014b2cc9bb3d33e6a738f1f96c00cf980 Mon Sep 17 00:00:00 2001 From: Ivan Kylchik Date: Wed, 5 Apr 2023 15:24:12 +0200 Subject: [PATCH] Drop a part of compileTimeConstants.kt that is not serializable in K2 Basically `val a = 10; val b = a + 20` will not be serialized for `b` property because `a` is not constant --- .../builtinsSerializer/compileTimeConstants.kt | 8 -------- .../builtinsSerializer/compileTimeConstants.txt | 4 ---- 2 files changed, 12 deletions(-) diff --git a/native/native.tests/testData/klibContents/builtinsSerializer/compileTimeConstants.kt b/native/native.tests/testData/klibContents/builtinsSerializer/compileTimeConstants.kt index db59de2e6a6..4dddcf815ef 100644 --- a/native/native.tests/testData/klibContents/builtinsSerializer/compileTimeConstants.kt +++ b/native/native.tests/testData/klibContents/builtinsSerializer/compileTimeConstants.kt @@ -1,5 +1,3 @@ -// MUTED_WHEN: K2 -// `val b = a + 20` will not be serialized in K2 package test enum class Weapon { @@ -20,9 +18,6 @@ val doubleConst: Double = 3.0 val enumConst: Weapon? = Weapon.ROCK val arrayConst: Any = byteArrayOf(1,2) -val a = 10 -val b = a + 20 - class Class { val byteConst: Byte = 10 val shortConst: Short = 20 @@ -35,7 +30,4 @@ class Class { val doubleConst: Double = 3.0 val enumConst: Weapon? = Weapon.ROCK val arrayConst: Any = byteArrayOf(1,2) - val a = 10 - val b = a + 20 } - diff --git a/native/native.tests/testData/klibContents/builtinsSerializer/compileTimeConstants.txt b/native/native.tests/testData/klibContents/builtinsSerializer/compileTimeConstants.txt index f2b3abb1629..3fb503bb240 100644 --- a/native/native.tests/testData/klibContents/builtinsSerializer/compileTimeConstants.txt +++ b/native/native.tests/testData/klibContents/builtinsSerializer/compileTimeConstants.txt @@ -1,7 +1,5 @@ class Class constructor() { - val a: Int = 10 val arrayConst: Any = {1.toByte(), 2.toByte()} - val b: Int = 30 val booleanConst: Boolean = true val byteConst: Byte = 10.toByte() val charConst: Char = \u0041 ('A') @@ -18,9 +16,7 @@ enum entry PAPER enum entry SCISSORS } - val a: Int = 10 val arrayConst: Any = {1.toByte(), 2.toByte()} - val b: Int = 30 val booleanConst: Boolean = true val byteConst: Byte = 10.toByte() val charConst: Char = \u0041 ('A')