FIR IDE: pass candidate super types for AMBIGUOUS_SUPER

This way the IDE quickfix do not need to do resolution again to figure
out what super type to offer in the quickfix.
This commit is contained in:
Tianyu Geng
2021-10-12 16:21:48 -07:00
committed by Ilya Kirillov
parent 7c3706dd3f
commit bdc71a3281
11 changed files with 33 additions and 18 deletions
@@ -6,6 +6,7 @@
package org.jetbrains.kotlin.fir.diagnostics
import org.jetbrains.kotlin.fir.FirSourceElement
import org.jetbrains.kotlin.fir.types.ConeKotlinType
class ConeSimpleDiagnostic(override val reason: String, val kind: DiagnosticKind = DiagnosticKind.Other) : ConeDiagnostic
@@ -23,6 +24,11 @@ class ConeUnderscoreUsageWithoutBackticks(source: FirSourceElement) : ConeDiagno
override val reason: String get() = "Names _, __, ___, ... can be used only in back-ticks (`_`, `__`, `___`, ...)"
}
class ConeAmbiguousSuper(val candidateTypes: List<ConeKotlinType>) : ConeDiagnostic {
override val reason: String
get() = "Ambiguous supertype"
}
enum class DiagnosticKind {
Syntax,
ExpressionExpected,
@@ -49,7 +55,6 @@ enum class DiagnosticKind {
MissingStdlibClass,
NotASupertype,
SuperNotAvailable,
AmbiguousSuper,
LoopInSupertype,
RecursiveTypealiasExpansion,