Split CompileTimeConstant into two entities
1. ConstantValue * just holds some value and its type * implementations for concrete constants 2. CompileTimeConstant * is only produced by ConstantExpressionEvaluator * has additional flags (canBeUsedInAnnotation etc) * has two implementations TypedCompileTimeConstant containing a constant value and IntegerValueConstant which does not have exact type * can be converted to ConstantValue Adjustt usages to use ConstantValue if flags are not needed Add tests for some uncovered cases
This commit is contained in:
@@ -6,11 +6,17 @@ fun foo(): Boolean = true
|
||||
|
||||
val x = 1
|
||||
|
||||
// val prop1: null
|
||||
// val prop1: false
|
||||
val prop1 = MyEnum.A
|
||||
|
||||
// val prop2: null
|
||||
val prop2 = foo()
|
||||
|
||||
// val prop3: true
|
||||
val prop3 = "$x"
|
||||
val prop3 = "$x"
|
||||
|
||||
// val prop4: false
|
||||
val prop4 = intArrayOf(1, 2, 3)
|
||||
|
||||
// val prop5: true
|
||||
val prop5 = intArrayOf(1, 2, x, x)
|
||||
Reference in New Issue
Block a user