Analysis API: separate constant values from annotation values

This commit is contained in:
Ilya Kirillov
2021-11-23 20:44:39 +01:00
parent 47c1da2845
commit f722a54c78
53 changed files with 302 additions and 415 deletions
@@ -824,6 +824,9 @@ class HtmlFirDump internal constructor(private var linkResolver: FirLinkResolver
+value.toString()
+">"
}
ConstantValueKind.Error -> {
+"ERROR_CONSTANT"
}
}
}
@@ -290,6 +290,7 @@ private fun ConstantValueKind<*>.toIrConstKind(): IrConstKind<*> = when (this) {
ConstantValueKind.Float -> IrConstKind.Float
ConstantValueKind.Double -> IrConstKind.Double
ConstantValueKind.IntegerLiteral, ConstantValueKind.UnsignedIntegerLiteral -> throw IllegalArgumentException()
ConstantValueKind.Error -> throw IllegalArgumentException()
}
@@ -128,5 +128,6 @@ fun ConstantValueKind<*>.expectedConeType(session: FirSession): ConeKotlinType {
ConstantValueKind.IntegerLiteral -> constructLiteralType(StandardClassIds.Int)
ConstantValueKind.UnsignedIntegerLiteral -> constructLiteralType(StandardClassIds.UInt)
ConstantValueKind.Error -> error("Unexpected error ConstantValueKind")
}
}