Value classes: Allow nested inline classes
This commit is contained in:
+1
-1
@@ -704,7 +704,7 @@ public class DefaultErrorMessages {
|
||||
MAP.put(NON_PRIVATE_CONSTRUCTOR_IN_ENUM, "Constructor must be private in enum class");
|
||||
MAP.put(NON_PRIVATE_CONSTRUCTOR_IN_SEALED, "Constructor must be private in sealed class");
|
||||
|
||||
MAP.put(INLINE_CLASS_NOT_TOP_LEVEL, "Inline classes are only allowed on top level");
|
||||
MAP.put(INLINE_CLASS_NOT_TOP_LEVEL, "Inline classes cannot be local or inner");
|
||||
MAP.put(INLINE_CLASS_NOT_FINAL, "Inline classes can be only final");
|
||||
MAP.put(ABSENCE_OF_PRIMARY_CONSTRUCTOR_FOR_INLINE_CLASS, "Primary constructor is required for inline class");
|
||||
MAP.put(INLINE_CLASS_CONSTRUCTOR_WRONG_PARAMETERS_SIZE, "Inline class must have exactly one primary constructor parameter");
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ object InlineClassDeclarationChecker : DeclarationChecker {
|
||||
require(inlineOrValueKeyword != null) { "Declaration of inline class must have 'inline' keyword" }
|
||||
|
||||
val trace = context.trace
|
||||
if (!DescriptorUtils.isTopLevelDeclaration(descriptor)) {
|
||||
if (descriptor.isInner || DescriptorUtils.isLocal(descriptor)) {
|
||||
trace.report(Errors.INLINE_CLASS_NOT_TOP_LEVEL.on(inlineOrValueKeyword))
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user