Write is_unsigned flag into metadata for an annotation arguments
Instead of adding new kind of types, we'll use flag to disambiguate usual types from unsigned ones, this approach has two advantages: - less changes in the metadata format - it allows naturally extend format for unsigned arrays, which will be supported later #KT-25310 Fixed #KT-25273 Fixed
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
// WITH_UNSIGNED
|
||||
|
||||
// FILE: A.kt
|
||||
|
||||
@kotlin.annotation.Target(AnnotationTarget.TYPE, AnnotationTarget.FUNCTION)
|
||||
annotation class Anno(val u: UInt)
|
||||
|
||||
object ForTest {
|
||||
@Anno(0u)
|
||||
fun f(a: @Anno(43u) String) {}
|
||||
}
|
||||
|
||||
// FILE: B.kt
|
||||
|
||||
|
||||
fun box(): String {
|
||||
val result = (ForTest::f.annotations.first() as Anno).u // force annotation deserialization
|
||||
if (result != 0u) return "Fail"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user