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:
Mikhail Zarechenskiy
2018-07-06 01:41:13 +03:00
parent 8c075bc622
commit 0c6757a8b0
13 changed files with 487 additions and 169 deletions
@@ -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"
}