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