[Analysis API FIR] fix constant evaluation for incomplete call when compiler produces IntegerLiteralType

^KTIJ-21531 fixed
This commit is contained in:
Ilya Kirillov
2022-09-28 19:12:28 +02:00
parent b72dbb7819
commit 4ae1cb74dd
14 changed files with 227 additions and 5 deletions
@@ -0,0 +1,4 @@
fun main(args: Array<String>) {
for (i in <expr>1</expr>..) {}
}
@@ -0,0 +1,9 @@
expression: 1
CONSTANT_EXPRESSION_EVALUATION
constant: 1
constantValueKind: Int
CONSTANT_LIKE_EXPRESSION_EVALUATION
constantLike: 1
constantLikeValueKind: Int
@@ -0,0 +1,2 @@
const val c = <expr>1</expr> +
@@ -0,0 +1,9 @@
expression: 1
CONSTANT_EXPRESSION_EVALUATION
constant: 1
constantValueKind: Int
CONSTANT_LIKE_EXPRESSION_EVALUATION
constantLike: 1
constantLikeValueKind: Int
@@ -0,0 +1,2 @@
const val c = <expr>2147483648</expr> +
@@ -0,0 +1,9 @@
expression: 2147483648
CONSTANT_EXPRESSION_EVALUATION
constant: 2147483648
constantValueKind: Long
CONSTANT_LIKE_EXPRESSION_EVALUATION
constantLike: 2147483648
constantLikeValueKind: Long
@@ -0,0 +1,9 @@
expression: 4294967296u
CONSTANT_EXPRESSION_EVALUATION
constant: error("Type cannot be resolved. Please make sure you have the required dependencies for unsigned types in the classpath")
constantValueKind: Error
CONSTANT_LIKE_EXPRESSION_EVALUATION
constantLike: error("Type cannot be resolved. Please make sure you have the required dependencies for unsigned types in the classpath")
constantLikeValueKind: Error
@@ -0,0 +1,2 @@
const val c = <expr>4294967296u</expr> +
@@ -0,0 +1,9 @@
expression: 4294967296u
CONSTANT_EXPRESSION_EVALUATION
constant: 4294967296uL
constantValueKind: ULong
CONSTANT_LIKE_EXPRESSION_EVALUATION
constantLike: 4294967296uL
constantLikeValueKind: ULong