[FIR IDE] Add base support for FIR incomplete types resolve
This commit is contained in:
+1
-1
@@ -39,7 +39,7 @@ internal class FirErrorFunctionImpl(
|
||||
override val symbol: FirErrorFunctionSymbol,
|
||||
override val typeParameters: MutableList<FirTypeParameter>,
|
||||
) : FirErrorFunction() {
|
||||
override var returnTypeRef: FirTypeRef = FirErrorTypeRefImpl(null, diagnostic)
|
||||
override var returnTypeRef: FirTypeRef = FirErrorTypeRefImpl(null, null, diagnostic)
|
||||
override val receiverTypeRef: FirTypeRef? get() = null
|
||||
override var controlFlowGraphReference: FirControlFlowGraphReference? = null
|
||||
override val body: FirBlock? get() = null
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ internal class FirErrorPropertyImpl(
|
||||
override val typeParameters: MutableList<FirTypeParameter>,
|
||||
override val symbol: FirErrorPropertySymbol,
|
||||
) : FirErrorProperty() {
|
||||
override var returnTypeRef: FirTypeRef = FirErrorTypeRefImpl(null, diagnostic)
|
||||
override var returnTypeRef: FirTypeRef = FirErrorTypeRefImpl(null, null, diagnostic)
|
||||
override val receiverTypeRef: FirTypeRef? get() = null
|
||||
override val initializer: FirExpression? get() = null
|
||||
override val delegate: FirExpression? get() = null
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ internal class FirErrorExpressionImpl(
|
||||
override val source: FirSourceElement?,
|
||||
override val diagnostic: ConeDiagnostic,
|
||||
) : FirErrorExpression() {
|
||||
override var typeRef: FirTypeRef = FirErrorTypeRefImpl(source, ConeStubDiagnostic(diagnostic))
|
||||
override var typeRef: FirTypeRef = FirErrorTypeRefImpl(source, null, ConeStubDiagnostic(diagnostic))
|
||||
override val annotations: List<FirAnnotationCall> get() = emptyList()
|
||||
|
||||
override fun <R, D> acceptChildren(visitor: FirVisitor<R, D>, data: D) {
|
||||
|
||||
@@ -26,11 +26,13 @@ import org.jetbrains.kotlin.fir.visitors.*
|
||||
@FirBuilderDsl
|
||||
class FirErrorTypeRefBuilder : FirAnnotationContainerBuilder {
|
||||
override var source: FirSourceElement? = null
|
||||
var delegatedTypeRef: FirTypeRef? = null
|
||||
lateinit var diagnostic: ConeDiagnostic
|
||||
|
||||
override fun build(): FirErrorTypeRef {
|
||||
return FirErrorTypeRefImpl(
|
||||
source,
|
||||
delegatedTypeRef,
|
||||
diagnostic,
|
||||
)
|
||||
}
|
||||
@@ -55,6 +57,7 @@ inline fun buildErrorTypeRefCopy(original: FirErrorTypeRef, init: FirErrorTypeRe
|
||||
}
|
||||
val copyBuilder = FirErrorTypeRefBuilder()
|
||||
copyBuilder.source = original.source
|
||||
copyBuilder.delegatedTypeRef = original.delegatedTypeRef
|
||||
copyBuilder.diagnostic = original.diagnostic
|
||||
return copyBuilder.apply(init).build()
|
||||
}
|
||||
|
||||
@@ -21,18 +21,20 @@ import org.jetbrains.kotlin.fir.visitors.*
|
||||
|
||||
internal class FirErrorTypeRefImpl(
|
||||
override val source: FirSourceElement?,
|
||||
override var delegatedTypeRef: FirTypeRef?,
|
||||
override val diagnostic: ConeDiagnostic,
|
||||
) : FirErrorTypeRef() {
|
||||
override val annotations: MutableList<FirAnnotationCall> = mutableListOf()
|
||||
override val type: ConeKotlinType = ConeClassErrorType(diagnostic)
|
||||
override val delegatedTypeRef: FirTypeRef? get() = null
|
||||
|
||||
override fun <R, D> acceptChildren(visitor: FirVisitor<R, D>, data: D) {
|
||||
annotations.forEach { it.accept(visitor, data) }
|
||||
delegatedTypeRef?.accept(visitor, data)
|
||||
}
|
||||
|
||||
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirErrorTypeRefImpl {
|
||||
transformAnnotations(transformer, data)
|
||||
delegatedTypeRef = delegatedTypeRef?.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user