[FE1.0, FIR] Support secondary constructors for Value Classes
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com> #KT-1179
This commit is contained in:
committed by
Space Team
parent
8c3fa6f09f
commit
6107caa8e2
+7
-5
@@ -263,11 +263,13 @@ class ReservedMembersAndConstructsForInlineClass : DeclarationChecker {
|
||||
}
|
||||
|
||||
is ConstructorDescriptor -> {
|
||||
val secondaryConstructor = declaration as? KtSecondaryConstructor ?: return
|
||||
val bodyExpression = secondaryConstructor.bodyExpression
|
||||
if (secondaryConstructor.hasBlockBody() && bodyExpression is KtBlockExpression) {
|
||||
val lBrace = bodyExpression.lBrace ?: return
|
||||
context.trace.report(Errors.SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_VALUE_CLASS.on(lBrace))
|
||||
if (!context.languageVersionSettings.supportsFeature(LanguageFeature.ValueClassesSecondaryConstructorWithBody)) {
|
||||
val secondaryConstructor = declaration as? KtSecondaryConstructor ?: return
|
||||
val bodyExpression = secondaryConstructor.bodyExpression
|
||||
if (secondaryConstructor.hasBlockBody() && bodyExpression is KtBlockExpression) {
|
||||
val lBrace = bodyExpression.lBrace ?: return
|
||||
context.trace.report(Errors.SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_VALUE_CLASS.on(lBrace))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user