[FIR] Partial implementation of DEPRECATION(_ERROR) diagnostics
No support for inheritance deprecations and deprecations in qualifier's parts
This commit is contained in:
committed by
teamcityserver
parent
9fad55d551
commit
de3f31cf78
+1
@@ -1,3 +1,4 @@
|
||||
|
||||
RAW_FIR:
|
||||
FILE: classMembers.kt
|
||||
public? final? [RAW_FIR] class A : R|kotlin/Any| {
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
|
||||
RAW_FIR:
|
||||
FILE: propertyWithGetter.kt
|
||||
public? final? [RAW_FIR] fun resolveMe(): R|kotlin/Unit| {
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
|
||||
RAW_FIR:
|
||||
FILE: propertyWithGetterAndSetter.kt
|
||||
public? final? [RAW_FIR] fun resolveMe(): R|kotlin/Unit| {
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
|
||||
RAW_FIR:
|
||||
FILE: propertyWithInitializer.kt
|
||||
public? final? [RAW_FIR] fun resolveMe(): R|kotlin/Unit| {
|
||||
|
||||
Vendored
+1
@@ -1,3 +1,4 @@
|
||||
|
||||
RAW_FIR:
|
||||
FILE: secondaryConstructor.kt
|
||||
public? final? [RAW_FIR] fun resolveMe(): R|kotlin/Unit| {
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
|
||||
RAW_FIR:
|
||||
FILE: superTypes.kt
|
||||
public? open [RAW_FIR] class A : R|kotlin/Any| {
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
|
||||
RAW_FIR:
|
||||
FILE: superTypesLoop.kt
|
||||
public? open [RAW_FIR] class resolveMe : C {
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
|
||||
RAW_FIR:
|
||||
FILE: topLevelFunctions.kt
|
||||
public? final? [RAW_FIR] fun resolveMe(): R|kotlin/Unit| {
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
|
||||
RAW_FIR:
|
||||
FILE: topLevelFunctionsWithExpressionBodyAndExplicitType.kt
|
||||
public? final? [RAW_FIR] fun resolveMe(): R|kotlin/Unit| {
|
||||
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
|
||||
RAW_FIR:
|
||||
FILE: topLevelFunctionsWithImplicitType.kt
|
||||
public? final? [RAW_FIR] fun resolveMe(): R|kotlin/Unit| {
|
||||
|
||||
+16
@@ -278,6 +278,22 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.DEPRECATION_ERROR) { firDiagnostic ->
|
||||
DeprecationErrorImpl(
|
||||
firSymbolBuilder.buildSymbol(firDiagnostic.a.fir as FirDeclaration),
|
||||
firDiagnostic.b,
|
||||
firDiagnostic as FirPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.DEPRECATION) { firDiagnostic ->
|
||||
DeprecationImpl(
|
||||
firSymbolBuilder.buildSymbol(firDiagnostic.a.fir as FirDeclaration),
|
||||
firDiagnostic.b,
|
||||
firDiagnostic as FirPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.CREATING_AN_INSTANCE_OF_ABSTRACT_CLASS) { firDiagnostic ->
|
||||
CreatingAnInstanceOfAbstractClassImpl(
|
||||
firDiagnostic as FirPsiDiagnostic,
|
||||
|
||||
+12
@@ -217,6 +217,18 @@ sealed class KtFirDiagnostic<PSI: PsiElement> : KtDiagnosticWithPsi<PSI> {
|
||||
override val diagnosticClass get() = NoThis::class
|
||||
}
|
||||
|
||||
abstract class DeprecationError : KtFirDiagnostic<PsiElement>() {
|
||||
override val diagnosticClass get() = DeprecationError::class
|
||||
abstract val reference: KtSymbol
|
||||
abstract val message: String
|
||||
}
|
||||
|
||||
abstract class Deprecation : KtFirDiagnostic<PsiElement>() {
|
||||
override val diagnosticClass get() = Deprecation::class
|
||||
abstract val reference: KtSymbol
|
||||
abstract val message: String
|
||||
}
|
||||
|
||||
abstract class CreatingAnInstanceOfAbstractClass : KtFirDiagnostic<KtExpression>() {
|
||||
override val diagnosticClass get() = CreatingAnInstanceOfAbstractClass::class
|
||||
}
|
||||
|
||||
+18
@@ -323,6 +323,24 @@ internal class NoThisImpl(
|
||||
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
|
||||
}
|
||||
|
||||
internal class DeprecationErrorImpl(
|
||||
override val reference: KtSymbol,
|
||||
override val message: String,
|
||||
firDiagnostic: FirPsiDiagnostic,
|
||||
override val token: ValidityToken,
|
||||
) : KtFirDiagnostic.DeprecationError(), KtAbstractFirDiagnostic<PsiElement> {
|
||||
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
|
||||
}
|
||||
|
||||
internal class DeprecationImpl(
|
||||
override val reference: KtSymbol,
|
||||
override val message: String,
|
||||
firDiagnostic: FirPsiDiagnostic,
|
||||
override val token: ValidityToken,
|
||||
) : KtFirDiagnostic.Deprecation(), KtAbstractFirDiagnostic<PsiElement> {
|
||||
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
|
||||
}
|
||||
|
||||
internal class CreatingAnInstanceOfAbstractClassImpl(
|
||||
firDiagnostic: FirPsiDiagnostic,
|
||||
override val token: ValidityToken,
|
||||
|
||||
Reference in New Issue
Block a user