Fix enum interpretation in case when primary constructor is missing

This commit is contained in:
Ivan Kylchik
2021-06-23 16:58:29 +03:00
committed by TeamCityServer
parent 668bb4fd71
commit 96cc74a752
3 changed files with 32 additions and 8 deletions
+15
View File
@@ -24,3 +24,18 @@ const val b3 = Color.RED.<!EVALUATED: `0xFF0000`!>getColorAsString()<!>
const val c1 = Color.BLACK.<!EVALUATED: `0`!>getColorAsInt()<!>
const val c2 = Color.RED.<!EVALUATED: `16711680`!>getColorAsInt()<!>
@CompileTimeCalculation
enum class EnumWithoutPrimary {
X(), Y(10);
val someProp: Int
constructor() : this(0) {}
constructor(value: Int) {
someProp = value
}
}
const val d1 = EnumWithoutPrimary.X.<!EVALUATED: `0`!>someProp<!>
const val d2 = EnumWithoutPrimary.Y.<!EVALUATED: `10`!>someProp<!>