"trait" -> "interface"
This commit is contained in:
@@ -172,7 +172,7 @@ class Converter private(
|
||||
return when {
|
||||
psiClass.isInterface() -> {
|
||||
val classBody = ClassBodyConverter(psiClass, this, isOpenClass = false, isObject = false).convertBody()
|
||||
Trait(name, annotations, modifiers, typeParameters, extendsTypes, implementsTypes, classBody)
|
||||
Interface(name, annotations, modifiers, typeParameters, extendsTypes, implementsTypes, classBody)
|
||||
}
|
||||
|
||||
psiClass.isEnum() -> {
|
||||
|
||||
@@ -18,7 +18,7 @@ package org.jetbrains.kotlin.j2k.ast
|
||||
|
||||
import org.jetbrains.kotlin.j2k.CodeBuilder
|
||||
|
||||
class AnonymousClassBody(body: ClassBody, val extendsTrait: Boolean)
|
||||
class AnonymousClassBody(body: ClassBody, val extendsInterface: Boolean)
|
||||
: Class(Identifier.Empty, Annotations.Empty, Modifiers.Empty, TypeParameterList.Empty, listOf(), null, listOf(), body) {
|
||||
override fun generateCode(builder: CodeBuilder) {
|
||||
body.append(builder)
|
||||
|
||||
@@ -33,12 +33,12 @@ class Function(
|
||||
val typeParameterList: TypeParameterList,
|
||||
parameterList: ParameterList,
|
||||
body: DeferredElement<Block>?,
|
||||
val isInTrait: Boolean
|
||||
val isInInterface: Boolean
|
||||
) : FunctionLike(annotations, modifiers, parameterList, body) {
|
||||
|
||||
private fun presentationModifiers(): Modifiers {
|
||||
var modifiers = this.modifiers
|
||||
if (isInTrait) {
|
||||
if (isInInterface) {
|
||||
modifiers = modifiers.without(Modifier.ABSTRACT)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.j2k.ast
|
||||
|
||||
class Trait(
|
||||
class Interface(
|
||||
name: Identifier,
|
||||
annotations: Annotations,
|
||||
modifiers: Modifiers,
|
||||
@@ -38,7 +38,7 @@ class NewClassExpression(
|
||||
builder.append(name)
|
||||
}
|
||||
|
||||
if (anonymousClass == null || !anonymousClass.extendsTrait) {
|
||||
if (anonymousClass == null || !anonymousClass.extendsInterface) {
|
||||
builder.append("(").append(arguments, ", ").append(")")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user