Add annotation processing in joinTypeParameters method

This commit is contained in:
Ivan Cilcic
2019-07-08 16:37:12 +03:00
committed by Mikhail Glukhikh
parent 8b1a63b54d
commit 840e627f1f
2 changed files with 6 additions and 13 deletions
@@ -121,11 +121,12 @@ object ConverterUtil {
} }
fun FirTypeParameterContainer.joinTypeParameters(typeConstraints: List<TypeConstraint>) { fun FirTypeParameterContainer.joinTypeParameters(typeConstraints: List<TypeConstraint>) {
typeConstraints.forEach { (identifier, type) -> typeConstraints.forEach { typeConstraint ->
this.typeParameters.forEach { typeParameter -> this.typeParameters.forEach { typeParameter ->
if (identifier == typeParameter.name.identifier) { if (typeConstraint.identifier == typeParameter.name.identifier) {
(typeParameter as FirTypeParameterImpl).bounds += type (typeParameter as FirTypeParameterImpl).bounds += typeConstraint.firTypeRef
typeParameter.annotations += type.annotations typeParameter.annotations += typeConstraint.firTypeRef.annotations
typeParameter.annotations += typeConstraint.annotations
} }
} }
} }
@@ -8,12 +8,4 @@ package org.jetbrains.kotlin.fir.lightTree.fir
import org.jetbrains.kotlin.fir.expressions.FirAnnotationCall import org.jetbrains.kotlin.fir.expressions.FirAnnotationCall
import org.jetbrains.kotlin.fir.types.FirTypeRef import org.jetbrains.kotlin.fir.types.FirTypeRef
class TypeConstraint(val annotations: List<FirAnnotationCall>, val identifier: String, val firTypeRef: FirTypeRef) { class TypeConstraint(val annotations: List<FirAnnotationCall>, val identifier: String, val firTypeRef: FirTypeRef)
operator fun component1(): String {
return identifier
}
operator fun component2(): FirTypeRef {
return firTypeRef
}
}