[FIR] Report MISSING_CONSTRUCTOR_KEYWORD

^KT-59407 Fixed
This commit is contained in:
Nikolay Lunyak
2023-08-17 16:54:40 +03:00
committed by Space Team
parent f238ffa4bf
commit c33f1cda69
16 changed files with 59 additions and 29 deletions
@@ -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,