default -> companion: replace all mentions of default and default object
This commit is contained in:
+1
-1
@@ -81,7 +81,7 @@ public abstract class FileBasedKotlinClass implements KotlinJvmBinaryClass {
|
||||
@NotNull
|
||||
protected abstract byte[] getFileContents();
|
||||
|
||||
// TODO public to be accessible in default object of subclass, workaround for KT-3974
|
||||
// TODO public to be accessible in companion object of subclass, workaround for KT-3974
|
||||
@Nullable
|
||||
public static <T extends FileBasedKotlinClass> T create(
|
||||
@NotNull byte[] fileContents,
|
||||
|
||||
+5
-5
@@ -96,12 +96,12 @@ public class PlatformStaticAnnotationChecker : AnnotationChecker {
|
||||
diagnosticHolder: DiagnosticSink
|
||||
) {
|
||||
val container = descriptor.getContainingDeclaration()
|
||||
val insideObject = container != null && DescriptorUtils.isNonDefaultObject(container)
|
||||
val insideDefaultObjectInClass =
|
||||
container != null && DescriptorUtils.isDefaultObject(container) && DescriptorUtils.isClass(container.getContainingDeclaration())
|
||||
container != null && DescriptorUtils.isDefaultObject(container) && DescriptorUtils.isClass(container.getContainingDeclaration())
|
||||
val insideObject = container != null && DescriptorUtils.isNonCompanionObject(container)
|
||||
val insideCompanionObjectInClass =
|
||||
container != null && DescriptorUtils.isCompanionObject(container) && DescriptorUtils.isClass(container.getContainingDeclaration())
|
||||
container != null && DescriptorUtils.isCompanionObject(container) && DescriptorUtils.isClass(container.getContainingDeclaration())
|
||||
|
||||
if (!insideObject && !insideDefaultObjectInClass) {
|
||||
if (!insideObject && !insideCompanionObjectInClass) {
|
||||
diagnosticHolder.report(ErrorsJvm.PLATFORM_STATIC_NOT_IN_OBJECT.on(declaration));
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ public class NeedSyntheticChecker implements CallChecker {
|
||||
|
||||
//Necessary synthetic accessors in outer classes generated via old logic: CodegenContext.getAccessor
|
||||
//Generation of accessors in nested classes (to invoke from outer,
|
||||
// e.g.: from class to default object) controlled via NEED_SYNTHETIC_ACCESSOR slice
|
||||
// e.g.: from class to companion object) controlled via NEED_SYNTHETIC_ACCESSOR slice
|
||||
private boolean needSyntheticAccessor(JetScope invokationScope, CallableDescriptor targetDescriptor) {
|
||||
return targetDescriptor instanceof CallableMemberDescriptor &&
|
||||
Visibilities.isPrivate(targetDescriptor.getVisibility()) &&
|
||||
|
||||
+1
-1
@@ -45,7 +45,7 @@ public class DefaultErrorMessagesJvm implements DefaultErrorMessages.Extension {
|
||||
static {
|
||||
MAP.put(ErrorsJvm.CONFLICTING_JVM_DECLARATIONS, "Platform declaration clash: {0}", CONFLICTING_JVM_DECLARATIONS_DATA);
|
||||
MAP.put(ErrorsJvm.ACCIDENTAL_OVERRIDE, "Accidental override: {0}", CONFLICTING_JVM_DECLARATIONS_DATA);
|
||||
MAP.put(ErrorsJvm.PLATFORM_STATIC_NOT_IN_OBJECT, "Only functions in named objects and default objects of classes can be annotated with 'platformStatic'");
|
||||
MAP.put(ErrorsJvm.PLATFORM_STATIC_NOT_IN_OBJECT, "Only functions in named objects and companion objects of classes can be annotated with 'platformStatic'");
|
||||
MAP.put(ErrorsJvm.OVERRIDE_CANNOT_BE_STATIC, "Override member cannot be 'platformStatic' in object");
|
||||
MAP.put(ErrorsJvm.PLATFORM_STATIC_ILLEGAL_USAGE, "This declaration does not support ''platformStatic''", DescriptorRenderer.SHORT_NAMES_IN_TYPES);
|
||||
MAP.put(ErrorsJvm.NATIVE_DECLARATION_CANNOT_BE_ABSTRACT, "Native declaration can not be abstract");
|
||||
|
||||
Reference in New Issue
Block a user