Change diagnostic message and rename to NESTED_CLASS_DEPRECATED

This commit is contained in:
Dmitry Petrov
2017-09-08 13:01:52 +03:00
parent 66ece54b25
commit 4428798c61
9 changed files with 16 additions and 16 deletions
@@ -931,7 +931,7 @@ public interface Errors {
DiagnosticFactory1<PsiElement, ClassDescriptor> INACCESSIBLE_OUTER_CLASS_EXPRESSION = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1<KtClassOrObject, String> NESTED_CLASS_NOT_ALLOWED = DiagnosticFactory1.create(ERROR, DECLARATION_NAME);
DiagnosticFactory1<KtClassOrObject, String> NESTED_CLASS_NOT_ALLOWED_SINCE_1_3 = DiagnosticFactory1.create(WARNING, DECLARATION_NAME);
DiagnosticFactory1<KtClassOrObject, String> NESTED_CLASS_DEPRECATED = DiagnosticFactory1.create(WARNING, DECLARATION_NAME);
//Inline and inlinable parameters
DiagnosticFactory2<KtElement, DeclarationDescriptor, DeclarationDescriptor> NON_PUBLIC_CALL_FROM_PUBLIC_INLINE = DiagnosticFactory2.create(ERROR, CALL_ELEMENT);
@@ -424,7 +424,7 @@ public class DefaultErrorMessages {
MAP.put(INACCESSIBLE_OUTER_CLASS_EXPRESSION, "Expression is inaccessible from a nested class ''{0}''", NAME);
MAP.put(NESTED_CLASS_NOT_ALLOWED, "{0} is not allowed here", STRING);
MAP.put(NESTED_CLASS_NOT_ALLOWED_SINCE_1_3, "{0} will not be allowed here in Kotlin 1.3 and later, please migrate your code", STRING);
MAP.put(NESTED_CLASS_DEPRECATED, "{0} is deprecated here", STRING);
MAP.put(HAS_NEXT_MISSING, "hasNext() cannot be called on iterator() of type ''{0}''", RENDER_TYPE);
MAP.put(HAS_NEXT_FUNCTION_AMBIGUITY, "hasNext() is ambiguous for iterator() of type ''{0}''", RENDER_TYPE);
@@ -209,7 +209,7 @@ public class ModifiersChecker {
DiagnosticFactory1<KtClassOrObject, String> diagnostic =
languageVersionSettings.supportsFeature(LanguageFeature.NestedClassesInEnumEntryShouldBeInner)
? NESTED_CLASS_NOT_ALLOWED
: NESTED_CLASS_NOT_ALLOWED_SINCE_1_3;
: NESTED_CLASS_DEPRECATED;
trace.report(diagnostic.on(ktClassOrObject, kind.withCapitalFirstLetter));
return;
}