[Injection] Annotate default services with @DefaultImplementation

This commit is contained in:
Dmitry Savvinov
2019-05-14 19:02:43 +03:00
parent d80eba31be
commit b631e89ea7
17 changed files with 56 additions and 84 deletions
@@ -6,20 +6,22 @@
package org.jetbrains.kotlin.builtins;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.container.DefaultImplementation;
import org.jetbrains.kotlin.descriptors.ClassDescriptor;
import java.util.Collection;
import java.util.Collections;
@DefaultImplementation(impl = PlatformToKotlinClassMap.Default.class)
public interface PlatformToKotlinClassMap {
PlatformToKotlinClassMap EMPTY = new PlatformToKotlinClassMap() {
@NotNull
Collection<ClassDescriptor> mapPlatformClass(@NotNull ClassDescriptor classDescriptor);
class Default implements PlatformToKotlinClassMap {
@NotNull
@Override
public Collection<ClassDescriptor> mapPlatformClass(@NotNull ClassDescriptor classDescriptor) {
return Collections.emptyList();
}
};
@NotNull
Collection<ClassDescriptor> mapPlatformClass(@NotNull ClassDescriptor classDescriptor);
}
}
@@ -16,6 +16,7 @@
package org.jetbrains.kotlin.resolve.scopes
import org.jetbrains.kotlin.container.DefaultImplementation
import org.jetbrains.kotlin.descriptors.ConstructorDescriptor
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
@@ -95,6 +96,7 @@ interface SyntheticScope {
}
}
@DefaultImplementation(impl = SyntheticScopes.Empty::class)
interface SyntheticScopes {
val scopes: Collection<SyntheticScope>
@@ -17,18 +17,20 @@
package org.jetbrains.kotlin.types
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
import org.jetbrains.kotlin.container.DefaultImplementation
import org.jetbrains.kotlin.descriptors.annotations.Annotations
import org.jetbrains.kotlin.renderer.DescriptorRenderer
import org.jetbrains.kotlin.renderer.DescriptorRendererOptions
import org.jetbrains.kotlin.types.model.DynamicTypeMarker
import org.jetbrains.kotlin.types.typeUtil.builtIns
@DefaultImplementation(impl = DynamicTypesSettings::class)
open class DynamicTypesSettings {
open val dynamicTypesAllowed: Boolean
get() = false
}
class DynamicTypesAllowed: DynamicTypesSettings() {
class DynamicTypesAllowed : DynamicTypesSettings() {
override val dynamicTypesAllowed: Boolean
get() = true
}