[FIR] Report MISSING_CONSTRUCTOR_KEYWORD
^KT-59407 Fixed
This commit is contained in:
committed by
Space Team
parent
f238ffa4bf
commit
c33f1cda69
+3
@@ -6,6 +6,7 @@
|
||||
package org.jetbrains.kotlin.fir.declarations.utils
|
||||
|
||||
import org.jetbrains.kotlin.fir.declarations.*
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirConstructorSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirNamedFunctionSymbol
|
||||
import org.jetbrains.kotlin.fir.types.ConeClassLikeType
|
||||
import org.jetbrains.kotlin.fir.types.coneTypeSafe
|
||||
@@ -68,3 +69,5 @@ val FirNamedFunctionSymbol.isMethodOfAny: Boolean
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
|
||||
val FirConstructorSymbol.isErrorPrimaryConstructor get() = fir is FirErrorPrimaryConstructor
|
||||
|
||||
@@ -83,6 +83,10 @@ object ConeNoConstructorError : ConeDiagnostic {
|
||||
override val reason: String get() = "This type does not have a constructor"
|
||||
}
|
||||
|
||||
object ConeMissingConstructorKeyword : ConeDiagnostic {
|
||||
override val reason: String get() = "Use the 'constructor' keyword after the modifiers of the primary constructor."
|
||||
}
|
||||
|
||||
enum class DiagnosticKind {
|
||||
ExpressionExpected,
|
||||
NotLoopLabel,
|
||||
|
||||
Reference in New Issue
Block a user