KT-59732 [FIR] Get rid of FirErrorImport node
It's no longer relevant, since it's not created anywhere
This commit is contained in:
committed by
Space Team
parent
d6d9402b66
commit
ad2c77b298
-1
@@ -44,7 +44,6 @@ object FirImportsChecker : FirFileChecker() {
|
|||||||
override fun check(declaration: FirFile, context: CheckerContext, reporter: DiagnosticReporter) {
|
override fun check(declaration: FirFile, context: CheckerContext, reporter: DiagnosticReporter) {
|
||||||
declaration.imports.forEach { import ->
|
declaration.imports.forEach { import ->
|
||||||
if (import.source?.kind?.shouldSkipErrorTypeReporting == true) return@forEach
|
if (import.source?.kind?.shouldSkipErrorTypeReporting == true) return@forEach
|
||||||
if (import is FirErrorImport) return@forEach
|
|
||||||
if (import.isAllUnder) {
|
if (import.isAllUnder) {
|
||||||
if (import is FirResolvedImport) {
|
if (import is FirResolvedImport) {
|
||||||
checkAllUnderFromObject(import, context, reporter)
|
checkAllUnderFromObject(import, context, reporter)
|
||||||
|
|||||||
-5
@@ -122,11 +122,6 @@ class ErrorNodeDiagnosticCollectorComponent(
|
|||||||
reportFirDiagnostic(errorResolvedQualifier.diagnostic, source, data)
|
reportFirDiagnostic(errorResolvedQualifier.diagnostic, source, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun visitErrorImport(errorImport: FirErrorImport, data: CheckerContext) {
|
|
||||||
val source = errorImport.source
|
|
||||||
reportFirDiagnostic(errorImport.diagnostic, source, data)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun visitErrorPrimaryConstructor(errorPrimaryConstructor: FirErrorPrimaryConstructor, data: CheckerContext) {
|
override fun visitErrorPrimaryConstructor(errorPrimaryConstructor: FirErrorPrimaryConstructor, data: CheckerContext) {
|
||||||
reportFirDiagnostic(errorPrimaryConstructor.diagnostic, errorPrimaryConstructor.source, data)
|
reportFirDiagnostic(errorPrimaryConstructor.diagnostic, errorPrimaryConstructor.source, data)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
|
||||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// This file was generated automatically. See compiler/fir/tree/tree-generator/Readme.md.
|
|
||||||
// DO NOT MODIFY IT MANUALLY.
|
|
||||||
|
|
||||||
package org.jetbrains.kotlin.fir.declarations
|
|
||||||
|
|
||||||
import org.jetbrains.kotlin.KtSourceElement
|
|
||||||
import org.jetbrains.kotlin.fir.FirElement
|
|
||||||
import org.jetbrains.kotlin.fir.diagnostics.ConeDiagnostic
|
|
||||||
import org.jetbrains.kotlin.fir.diagnostics.FirDiagnosticHolder
|
|
||||||
import org.jetbrains.kotlin.fir.visitors.FirTransformer
|
|
||||||
import org.jetbrains.kotlin.fir.visitors.FirVisitor
|
|
||||||
import org.jetbrains.kotlin.name.FqName
|
|
||||||
import org.jetbrains.kotlin.name.Name
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Generated from: [org.jetbrains.kotlin.fir.tree.generator.FirTreeBuilder.errorImport]
|
|
||||||
*/
|
|
||||||
abstract class FirErrorImport : FirImport(), FirDiagnosticHolder {
|
|
||||||
abstract override val source: KtSourceElement?
|
|
||||||
abstract override val importedFqName: FqName?
|
|
||||||
abstract override val isAllUnder: Boolean
|
|
||||||
abstract override val aliasName: Name?
|
|
||||||
abstract override val aliasSource: KtSourceElement?
|
|
||||||
abstract override val diagnostic: ConeDiagnostic
|
|
||||||
abstract val delegate: FirImport
|
|
||||||
|
|
||||||
override fun <R, D> accept(visitor: FirVisitor<R, D>, data: D): R =
|
|
||||||
visitor.visitErrorImport(this, data)
|
|
||||||
|
|
||||||
@Suppress("UNCHECKED_CAST")
|
|
||||||
override fun <E : FirElement, D> transform(transformer: FirTransformer<D>, data: D): E =
|
|
||||||
transformer.transformErrorImport(this, data) as E
|
|
||||||
}
|
|
||||||
-43
@@ -1,43 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
|
||||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// This file was generated automatically. See compiler/fir/tree/tree-generator/Readme.md.
|
|
||||||
// DO NOT MODIFY IT MANUALLY.
|
|
||||||
|
|
||||||
@file:Suppress("DuplicatedCode", "unused")
|
|
||||||
|
|
||||||
package org.jetbrains.kotlin.fir.declarations.builder
|
|
||||||
|
|
||||||
import kotlin.contracts.*
|
|
||||||
import org.jetbrains.kotlin.KtSourceElement
|
|
||||||
import org.jetbrains.kotlin.fir.builder.FirBuilderDsl
|
|
||||||
import org.jetbrains.kotlin.fir.declarations.FirErrorImport
|
|
||||||
import org.jetbrains.kotlin.fir.declarations.FirImport
|
|
||||||
import org.jetbrains.kotlin.fir.declarations.impl.FirErrorImportImpl
|
|
||||||
import org.jetbrains.kotlin.fir.diagnostics.ConeDiagnostic
|
|
||||||
|
|
||||||
@FirBuilderDsl
|
|
||||||
class FirErrorImportBuilder {
|
|
||||||
var aliasSource: KtSourceElement? = null
|
|
||||||
lateinit var diagnostic: ConeDiagnostic
|
|
||||||
lateinit var delegate: FirImport
|
|
||||||
|
|
||||||
fun build(): FirErrorImport {
|
|
||||||
return FirErrorImportImpl(
|
|
||||||
aliasSource,
|
|
||||||
diagnostic,
|
|
||||||
delegate,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@OptIn(ExperimentalContracts::class)
|
|
||||||
inline fun buildErrorImport(init: FirErrorImportBuilder.() -> Unit): FirErrorImport {
|
|
||||||
contract {
|
|
||||||
callsInPlace(init, InvocationKind.EXACTLY_ONCE)
|
|
||||||
}
|
|
||||||
return FirErrorImportBuilder().apply(init).build()
|
|
||||||
}
|
|
||||||
-44
@@ -1,44 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
|
||||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
|
||||||
*/
|
|
||||||
|
|
||||||
// This file was generated automatically. See compiler/fir/tree/tree-generator/Readme.md.
|
|
||||||
// DO NOT MODIFY IT MANUALLY.
|
|
||||||
|
|
||||||
@file:Suppress("DuplicatedCode", "unused")
|
|
||||||
|
|
||||||
package org.jetbrains.kotlin.fir.declarations.impl
|
|
||||||
|
|
||||||
import org.jetbrains.kotlin.KtSourceElement
|
|
||||||
import org.jetbrains.kotlin.fir.declarations.FirErrorImport
|
|
||||||
import org.jetbrains.kotlin.fir.declarations.FirImport
|
|
||||||
import org.jetbrains.kotlin.fir.diagnostics.ConeDiagnostic
|
|
||||||
import org.jetbrains.kotlin.fir.visitors.FirTransformer
|
|
||||||
import org.jetbrains.kotlin.fir.visitors.FirVisitor
|
|
||||||
import org.jetbrains.kotlin.name.FqName
|
|
||||||
import org.jetbrains.kotlin.name.Name
|
|
||||||
|
|
||||||
internal class FirErrorImportImpl(
|
|
||||||
override val aliasSource: KtSourceElement?,
|
|
||||||
override val diagnostic: ConeDiagnostic,
|
|
||||||
override var delegate: FirImport,
|
|
||||||
) : FirErrorImport() {
|
|
||||||
override val source: KtSourceElement?
|
|
||||||
get() = delegate.source
|
|
||||||
override val importedFqName: FqName?
|
|
||||||
get() = delegate.importedFqName
|
|
||||||
override val isAllUnder: Boolean
|
|
||||||
get() = delegate.isAllUnder
|
|
||||||
override val aliasName: Name?
|
|
||||||
get() = delegate.aliasName
|
|
||||||
|
|
||||||
override fun <R, D> acceptChildren(visitor: FirVisitor<R, D>, data: D) {
|
|
||||||
delegate.accept(visitor, data)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirErrorImportImpl {
|
|
||||||
delegate = delegate.transform(transformer, data)
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -451,14 +451,6 @@ abstract class FirTransformer<in D> : FirVisitor<FirElement, D>() {
|
|||||||
return transformResolvedImport(resolvedImport, data)
|
return transformResolvedImport(resolvedImport, data)
|
||||||
}
|
}
|
||||||
|
|
||||||
open fun transformErrorImport(errorImport: FirErrorImport, data: D): FirImport {
|
|
||||||
return transformElement(errorImport, data)
|
|
||||||
}
|
|
||||||
|
|
||||||
final override fun visitErrorImport(errorImport: FirErrorImport, data: D): FirImport {
|
|
||||||
return transformErrorImport(errorImport, data)
|
|
||||||
}
|
|
||||||
|
|
||||||
open fun transformLoop(loop: FirLoop, data: D): FirStatement {
|
open fun transformLoop(loop: FirLoop, data: D): FirStatement {
|
||||||
return transformElement(loop, data)
|
return transformElement(loop, data)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -182,9 +182,6 @@ abstract class FirVisitor<out R, in D> {
|
|||||||
open fun visitResolvedImport(resolvedImport: FirResolvedImport, data: D): R =
|
open fun visitResolvedImport(resolvedImport: FirResolvedImport, data: D): R =
|
||||||
visitElement(resolvedImport, data)
|
visitElement(resolvedImport, data)
|
||||||
|
|
||||||
open fun visitErrorImport(errorImport: FirErrorImport, data: D): R =
|
|
||||||
visitElement(errorImport, data)
|
|
||||||
|
|
||||||
open fun visitLoop(loop: FirLoop, data: D): R =
|
open fun visitLoop(loop: FirLoop, data: D): R =
|
||||||
visitElement(loop, data)
|
visitElement(loop, data)
|
||||||
|
|
||||||
|
|||||||
@@ -451,14 +451,6 @@ abstract class FirVisitorVoid : FirVisitor<Unit, Nothing?>() {
|
|||||||
visitElement(resolvedImport)
|
visitElement(resolvedImport)
|
||||||
}
|
}
|
||||||
|
|
||||||
final override fun visitErrorImport(errorImport: FirErrorImport, data: Nothing?) {
|
|
||||||
visitErrorImport(errorImport)
|
|
||||||
}
|
|
||||||
|
|
||||||
open fun visitErrorImport(errorImport: FirErrorImport) {
|
|
||||||
visitElement(errorImport)
|
|
||||||
}
|
|
||||||
|
|
||||||
final override fun visitLoop(loop: FirLoop, data: Nothing?) {
|
final override fun visitLoop(loop: FirLoop, data: Nothing?) {
|
||||||
visitLoop(loop)
|
visitLoop(loop)
|
||||||
}
|
}
|
||||||
|
|||||||
-1
@@ -79,7 +79,6 @@ object FirTreeBuilder : AbstractFirTreeBuilder() {
|
|||||||
|
|
||||||
val import by element(Declaration)
|
val import by element(Declaration)
|
||||||
val resolvedImport by element(Declaration, import)
|
val resolvedImport by element(Declaration, import)
|
||||||
val errorImport by element(Declaration, import, diagnosticHolder)
|
|
||||||
|
|
||||||
val loop by sealedElement(Expression, statement, targetElement)
|
val loop by sealedElement(Expression, statement, targetElement)
|
||||||
val errorLoop by element(Expression, loop, diagnosticHolder)
|
val errorLoop by element(Expression, loop, diagnosticHolder)
|
||||||
|
|||||||
-4
@@ -72,10 +72,6 @@ object ImplementationConfigurator : AbstractFirTreeImplementationConfigurator()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl(errorImport) {
|
|
||||||
delegateFields(listOf("aliasName", "importedFqName", "isAllUnder", "source"), "delegate")
|
|
||||||
}
|
|
||||||
|
|
||||||
fun ImplementationContext.commonAnnotationConfig() {
|
fun ImplementationContext.commonAnnotationConfig() {
|
||||||
defaultEmptyList("annotations")
|
defaultEmptyList("annotations")
|
||||||
default("coneTypeOrNull") {
|
default("coneTypeOrNull") {
|
||||||
|
|||||||
-4
@@ -530,10 +530,6 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
errorImport.configure {
|
|
||||||
+field("delegate", import)
|
|
||||||
}
|
|
||||||
|
|
||||||
annotation.configure {
|
annotation.configure {
|
||||||
+field("useSiteTarget", annotationUseSiteTargetType, nullable = true, withReplace = true)
|
+field("useSiteTarget", annotationUseSiteTargetType, nullable = true, withReplace = true)
|
||||||
+field("annotationTypeRef", typeRef, withReplace = true).withTransform()
|
+field("annotationTypeRef", typeRef, withReplace = true).withTransform()
|
||||||
|
|||||||
Reference in New Issue
Block a user