[FIR] Implement extension for providing additional type attributes

This commit is contained in:
Dmitriy Novozhilov
2021-09-30 14:34:51 +03:00
committed by TeamCityServer
parent 32709151c3
commit 38877ba842
19 changed files with 374 additions and 25 deletions
@@ -89,6 +89,11 @@ object CompilerConeAttributes {
UnsafeVariance.ANNOTATION_CLASS_ID to UnsafeVariance
)
val classIdByCompilerAttribute: Map<ConeAttribute<*>, ClassId> = compilerAttributeByClassId.entries.associateBy(
keySelector = { it.value },
valueTransform = { it.key }
)
val compilerAttributeByFqName: Map<FqName, ConeAttribute<*>> = compilerAttributeByClassId.mapKeys { it.key.asSingleFqName() }
}
@@ -25,7 +25,7 @@ abstract class ConeAttribute<T : ConeAttribute<T>> : AnnotationMarker {
*
* This function must be symmetrical: a.add(b) == b.add(a)
*/
abstract fun add(other: @UnsafeVariance T?): T
abstract fun add(other: @UnsafeVariance T?): T?
abstract fun isSubtypeOf(other: @UnsafeVariance T?): Boolean
abstract override fun toString(): String