[FE] Make DiagnosticFactory.name not null
This commit is contained in:
+2
-3
@@ -34,9 +34,8 @@ class DebugInfoDiagnosticFactory0 private constructor(
|
||||
return DebugInfoDiagnostic(expression, this)
|
||||
}
|
||||
|
||||
override var name: String?
|
||||
override val name: String
|
||||
get() = "DEBUG_INFO_$privateName"
|
||||
set(_) {}
|
||||
|
||||
companion object {
|
||||
val SMARTCAST = DebugInfoDiagnosticFactory0("SMARTCAST", Severity.INFO)
|
||||
@@ -51,4 +50,4 @@ class DebugInfoDiagnosticFactory0 private constructor(
|
||||
val MISSING_UNRESOLVED = DebugInfoDiagnosticFactory0("MISSING_UNRESOLVED")
|
||||
val DYNAMIC = DebugInfoDiagnosticFactory0("DYNAMIC", Severity.INFO)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-3
@@ -21,9 +21,8 @@ class DebugInfoDiagnosticFactory1 : DiagnosticFactory1<PsiElement, String>,
|
||||
DebugInfoDiagnosticFactory {
|
||||
private val privateName: String
|
||||
|
||||
override var name: String?
|
||||
override val name: String
|
||||
get() = "DEBUG_INFO_$privateName"
|
||||
set(_) {}
|
||||
|
||||
override val withExplicitDefinitionOnly: Boolean
|
||||
|
||||
@@ -85,4 +84,4 @@ class DebugInfoDiagnosticFactory1 : DiagnosticFactory1<PsiElement, String>,
|
||||
return DebugInfoDiagnosticFactory1(name, severity, withExplicitDefinitionOnly)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-2
@@ -10,9 +10,8 @@ import org.jetbrains.kotlin.diagnostics.DiagnosticFactory
|
||||
import org.jetbrains.kotlin.diagnostics.Severity
|
||||
|
||||
class SyntaxErrorDiagnosticFactory private constructor() : DiagnosticFactory<SyntaxErrorDiagnostic>(Severity.ERROR) {
|
||||
override var name: String?
|
||||
override val name: String
|
||||
get() = "SYNTAX"
|
||||
set(_) {}
|
||||
|
||||
companion object {
|
||||
val INSTANCE = SyntaxErrorDiagnosticFactory()
|
||||
|
||||
@@ -1199,7 +1199,7 @@ public interface Errors {
|
||||
Object value = field.get(null);
|
||||
if (value instanceof DiagnosticFactory) {
|
||||
DiagnosticFactory<?> factory = (DiagnosticFactory<?>)value;
|
||||
factory.setName(field.getName());
|
||||
factory.initializeName(field.getName());
|
||||
|
||||
factory.setDefaultRenderer((DiagnosticRenderer) diagnosticToRendererMap.get(factory));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user