Add jvm diagnostic tests to check report of exceptions from interpreter

This commit is contained in:
Ivan Kylchik
2021-11-22 23:32:43 +03:00
parent 20d8e6607d
commit 1431d4b356
8 changed files with 78 additions and 37 deletions
@@ -34,6 +34,8 @@ object JvmBackendErrors {
val SCRIPT_CAPTURING_ENUM by error1<PsiElement, String>()
val SCRIPT_CAPTURING_ENUM_ENTRY by error1<PsiElement, String>()
val EXCEPTION_IN_CONST_VAL_INITIALIZER by error1<PsiElement, String>()
init {
RootDiagnosticRendererFactory.registerFactory(KtDefaultJvmErrorMessages)
}
@@ -73,5 +75,7 @@ object KtDefaultJvmErrorMessages : BaseDiagnosticRendererFactory() {
map.put(JvmBackendErrors.SCRIPT_CAPTURING_INTERFACE, "Interface {0} captures the script class instance. Try to use class instead", STRING)
map.put(JvmBackendErrors.SCRIPT_CAPTURING_ENUM, "Enum class {0} captures the script class instance. Try to use class or anonymous object instead", STRING)
map.put(JvmBackendErrors.SCRIPT_CAPTURING_ENUM_ENTRY, "Enum entry {0} captures the script class instance. Try to use class or anonymous object instead", STRING)
map.put(JvmBackendErrors.EXCEPTION_IN_CONST_VAL_INITIALIZER, "An exception occur while evaluating const value initializer: {0}", STRING)
}
}