Files
kotlin-fork/idea/testData/decompiler/stubBuilder/PrivateConstField/PrivateConstField.kt
T
Roman Golyshev ebfbc2f601 KT-43205 Ignore annotations in CallableClsStubBuilder when needed
Kotlin compiler can add `@Deprecated` annotations to the fields of
private companion objects, and if those annotations are not supposed to
be shown in decompiled code and used, the field is marked with
`HAS_ANNOTATIONS=false` flag (see KT-25009)

However, it was not taken into account in stubs building process, which
led to the 'Stubs vs PSI mismatch' exceptions

^KT-43205 Fixed

Also, restore the order of nested typealiases and classes (see KT-41859)

We didn't want to bump the version of the stubs when we fixed this
issue; now we have an opportunity to restore the order back to
match the `MemberComparator`

Also, some refactoring is done to underscore that
`createPackageDeclarationsStubs` is suitable only for packages, not
for any declarations container
2020-11-09 15:49:50 +00:00

16 lines
315 B
Kotlin
Vendored

package test
@Retention(AnnotationRetention.RUNTIME)
annotation class A
class PrivateConstField {
private companion object {
const val CONST: Int = 10
@A
const val CONST_WITH_ANNOTATION: Int = 10
val field: Int = 10
@A
val fieldWithAnnotation: Int = 10
}
}