-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "sealed" keyword to sealed interface signatures #3001
Conversation
private fun MemberDescriptor.modifier(): KotlinModifier { | ||
val isInterface = this is ClassDescriptor && this.kind == ClassKind.INTERFACE | ||
return if (isInterface) { | ||
when (modality) { | ||
// modifiers other than "sealed" are redundant for interfaces | ||
Modality.SEALED -> KotlinModifier.Sealed | ||
else -> KotlinModifier.Empty | ||
} | ||
} else { | ||
when (modality) { | ||
Modality.FINAL -> KotlinModifier.Final | ||
Modality.SEALED -> KotlinModifier.Sealed | ||
Modality.OPEN -> KotlinModifier.Open | ||
Modality.ABSTRACT -> KotlinModifier.Abstract | ||
else -> KotlinModifier.Empty | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This particular bit could certainly be improved, but it's going to be re-written to K2 anyway, and I'd like to minimize merge conflicts with the refactoring I'm doing in a neighbouring branch.
private fun PsiModifierListOwner.getModifier(): JavaModifier { | ||
val isInterface = this is PsiClass && this.isInterface | ||
if (isInterface) { | ||
return JavaModifier.Empty // all Java modifiers are redundant for interfaces |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpicking: The comment is a little confusing. Interfaces can have an access modifier.
This PR is too outdated, it's easier to re-implement it than trying to rebase and merge the conflicts. |
Fixes #2994