[FE, IR] Check compatibility of annotations set on type usages in expect and actual declarations
This includes checking of annotatins set on: - value parameter types - type parameter bound types - extension functions receiver types - function return types - class super types Fix in `defaultParams_inheritanceByDelegation_positive.kt` is needed because of problem in resolution of implicit return types (KT-62064), which leads to crash in annotation checker, because it expects resolved return type. MR: KT-MR-12245 ^KT-60671 Fixed
This commit is contained in:
committed by
Space Team
parent
cb8529d65b
commit
423f4ca5f0
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.fir.types
|
||||
import org.jetbrains.kotlin.KtSourceElement
|
||||
import org.jetbrains.kotlin.fir.FirElement
|
||||
import org.jetbrains.kotlin.fir.expressions.FirAnnotation
|
||||
import org.jetbrains.kotlin.mpp.TypeRefMarker
|
||||
import org.jetbrains.kotlin.fir.visitors.*
|
||||
|
||||
/*
|
||||
@@ -15,7 +16,7 @@ import org.jetbrains.kotlin.fir.visitors.*
|
||||
* DO NOT MODIFY IT MANUALLY
|
||||
*/
|
||||
|
||||
abstract class FirResolvedTypeRef : FirTypeRef() {
|
||||
abstract class FirResolvedTypeRef : FirTypeRef(), TypeRefMarker {
|
||||
abstract override val source: KtSourceElement?
|
||||
abstract override val annotations: List<FirAnnotation>
|
||||
abstract val type: ConeKotlinType
|
||||
|
||||
+1
-1
@@ -707,7 +707,7 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
|
||||
resolvedTypeRef.configure {
|
||||
+field("type", coneKotlinTypeType)
|
||||
+field("delegatedTypeRef", typeRef, nullable = true)
|
||||
// TODO: add supertype in subsequent commits
|
||||
element.additionalSupertypeInterfaces.add(typeRefMarkerType)
|
||||
}
|
||||
|
||||
typeRefWithNullability.configure {
|
||||
|
||||
@@ -108,3 +108,5 @@ val firPropertySymbolType = type("fir.symbols.impl", "FirPropertySymbol")
|
||||
val errorTypeRefImplType = type("fir.types.impl", "FirErrorTypeRefImpl")
|
||||
|
||||
val annotationResolvePhaseType = generatedType("expressions", "FirAnnotationResolvePhase")
|
||||
|
||||
val typeRefMarkerType = type("mpp", "TypeRefMarker")
|
||||
|
||||
Reference in New Issue
Block a user