Minor, drop some obsolete usages of TRAIT in compiler
This commit is contained in:
@@ -156,7 +156,7 @@ public class PropertyCodegen {
|
|||||||
|
|
||||||
boolean isDefaultAccessor = accessor == null || !accessor.hasBody();
|
boolean isDefaultAccessor = accessor == null || !accessor.hasBody();
|
||||||
|
|
||||||
// Don't generate accessors for trait properties with default accessors in TRAIT_IMPL
|
// Don't generate accessors for interface properties with default accessors in DefaultImpls
|
||||||
if (kind == OwnerKind.DEFAULT_IMPLS && isDefaultAccessor) return false;
|
if (kind == OwnerKind.DEFAULT_IMPLS && isDefaultAccessor) return false;
|
||||||
|
|
||||||
if (declaration == null) return true;
|
if (declaration == null) return true;
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public class ModifiersChecker {
|
|||||||
private enum InnerModifierCheckResult {
|
private enum InnerModifierCheckResult {
|
||||||
ALLOWED,
|
ALLOWED,
|
||||||
ILLEGAL_POSITION,
|
ILLEGAL_POSITION,
|
||||||
IN_TRAIT,
|
IN_INTERFACE,
|
||||||
IN_OBJECT,
|
IN_OBJECT,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,7 +78,7 @@ public class ModifiersChecker {
|
|||||||
if (!(containingDeclaration instanceof ClassDescriptor)) return InnerModifierCheckResult.ILLEGAL_POSITION;
|
if (!(containingDeclaration instanceof ClassDescriptor)) return InnerModifierCheckResult.ILLEGAL_POSITION;
|
||||||
|
|
||||||
if (DescriptorUtils.isInterface(containingDeclaration)) {
|
if (DescriptorUtils.isInterface(containingDeclaration)) {
|
||||||
return InnerModifierCheckResult.IN_TRAIT;
|
return InnerModifierCheckResult.IN_INTERFACE;
|
||||||
}
|
}
|
||||||
else if (DescriptorUtils.isObject(containingDeclaration)) {
|
else if (DescriptorUtils.isObject(containingDeclaration)) {
|
||||||
return InnerModifierCheckResult.IN_OBJECT;
|
return InnerModifierCheckResult.IN_OBJECT;
|
||||||
|
|||||||
@@ -17,7 +17,6 @@
|
|||||||
package org.jetbrains.kotlin.resolve.jvm;
|
package org.jetbrains.kotlin.resolve.jvm;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.kotlin.load.java.JvmAbi;
|
|
||||||
import org.jetbrains.kotlin.name.ClassId;
|
import org.jetbrains.kotlin.name.ClassId;
|
||||||
import org.jetbrains.kotlin.name.FqName;
|
import org.jetbrains.kotlin.name.FqName;
|
||||||
|
|
||||||
@@ -51,8 +50,6 @@ public class JvmClassName {
|
|||||||
return byFqNameWithoutInnerClasses(new FqName(fqName));
|
return byFqNameWithoutInnerClasses(new FqName(fqName));
|
||||||
}
|
}
|
||||||
|
|
||||||
private final static String TRAIT_IMPL_REPLACE_GUARD = "<trait_impl>";
|
|
||||||
|
|
||||||
// Internal name: kotlin/Map$Entry
|
// Internal name: kotlin/Map$Entry
|
||||||
// FqName: kotlin.Map.Entry
|
// FqName: kotlin.Map.Entry
|
||||||
|
|
||||||
@@ -69,12 +66,7 @@ public class JvmClassName {
|
|||||||
@NotNull
|
@NotNull
|
||||||
public FqName getFqNameForClassNameWithoutDollars() {
|
public FqName getFqNameForClassNameWithoutDollars() {
|
||||||
if (fqName == null) {
|
if (fqName == null) {
|
||||||
String fqName = internalName
|
this.fqName = new FqName(internalName.replace('$', '.').replace('/', '.'));
|
||||||
.replace(JvmAbi.DEFAULT_IMPLS_CLASS_NAME, TRAIT_IMPL_REPLACE_GUARD)
|
|
||||||
.replace('$', '.')
|
|
||||||
.replace('/', '.')
|
|
||||||
.replace(TRAIT_IMPL_REPLACE_GUARD, JvmAbi.DEFAULT_IMPLS_CLASS_NAME);
|
|
||||||
this.fqName = new FqName(fqName);
|
|
||||||
}
|
}
|
||||||
return fqName;
|
return fqName;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user