Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/buildLazyValueForMap.kt
T
2021-02-08 13:01:11 +03:00

24 lines
552 B
Kotlin
Vendored

// FIR_IDENTICAL
interface ClassId
interface JavaAnnotation {
val classId: ClassId?
}
interface JavaAnnotationOwner {
val annotations: Collection<JavaAnnotation>
}
interface MapBasedJavaAnnotationOwner : JavaAnnotationOwner {
val annotationsByFqNameHash: Map<Int?, JavaAnnotation>
}
fun JavaAnnotationOwner.buildLazyValueForMap() = lazy {
annotations.associateBy { it.classId?.hashCode() }
}
abstract class BinaryJavaMethodBase(): MapBasedJavaAnnotationOwner {
override val annotationsByFqNameHash by buildLazyValueForMap()
}