Renamed KtScope to MemberScope
This commit is contained in:
+2
-2
@@ -29,14 +29,14 @@ import org.jetbrains.kotlin.load.java.sources.JavaSourceElement
|
||||
import org.jetbrains.kotlin.load.java.structure.JavaClass
|
||||
import org.jetbrains.kotlin.load.java.structure.JavaMethod
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.resolve.scopes.KtScope
|
||||
import org.jetbrains.kotlin.resolve.scopes.MemberScope
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.types.TypeUtils
|
||||
import org.jetbrains.kotlin.types.checker.KotlinTypeChecker
|
||||
import java.util.*
|
||||
|
||||
public object SamConversionResolverImpl : SamConversionResolver {
|
||||
override fun resolveSamConstructor(name: Name, scope: KtScope, location: LookupLocation): SamConstructorDescriptor? {
|
||||
override fun resolveSamConstructor(name: Name, scope: MemberScope, location: LookupLocation): SamConstructorDescriptor? {
|
||||
val classifier = scope.getClassifier(name, location) as? LazyJavaClassDescriptor ?: return null
|
||||
if (classifier.getFunctionTypeForSamInterface() == null) return null
|
||||
return SingleAbstractMethodUtils.createSamConstructorFunction(scope.getContainingDeclaration(), classifier)
|
||||
|
||||
+8
-8
@@ -33,7 +33,7 @@ import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
import org.jetbrains.kotlin.resolve.jvm.JvmClassName
|
||||
import org.jetbrains.kotlin.resolve.scopes.ChainedScope
|
||||
import org.jetbrains.kotlin.resolve.scopes.KtScope
|
||||
import org.jetbrains.kotlin.resolve.scopes.MemberScope
|
||||
import org.jetbrains.kotlin.serialization.PackageData
|
||||
import org.jetbrains.kotlin.serialization.ProtoBuf
|
||||
import org.jetbrains.kotlin.serialization.deserialization.DeserializationComponents
|
||||
@@ -97,9 +97,9 @@ public class IncrementalPackageFragmentProvider(
|
||||
public val target: TargetId
|
||||
get() = this@IncrementalPackageFragmentProvider.target
|
||||
|
||||
val memberScope: NotNullLazyValue<KtScope> = storageManager.createLazyValue {
|
||||
val memberScope: NotNullLazyValue<MemberScope> = storageManager.createLazyValue {
|
||||
if (fqName !in fqNamesToLoad) {
|
||||
KtScope.empty(this)
|
||||
MemberScope.empty(this)
|
||||
}
|
||||
else {
|
||||
val moduleMapping = incrementalCache.getModuleMappingData()?.let { ModuleMapping.create(it) }
|
||||
@@ -128,7 +128,7 @@ public class IncrementalPackageFragmentProvider(
|
||||
}
|
||||
|
||||
if (scopes.isEmpty()) {
|
||||
KtScope.empty(this)
|
||||
MemberScope.empty(this)
|
||||
}
|
||||
else {
|
||||
ChainedScope(this, "Member scope for incremental compilation: union of package parts data", *scopes.toTypedArray())
|
||||
@@ -142,7 +142,7 @@ public class IncrementalPackageFragmentProvider(
|
||||
return IncrementalMultifileClassPackageFragment(multifileClassFqName, partsNames)
|
||||
}
|
||||
|
||||
override fun getMemberScope(): KtScope = memberScope()
|
||||
override fun getMemberScope(): MemberScope = memberScope()
|
||||
|
||||
public inner class IncrementalMultifileClassPackageFragment(
|
||||
val multifileClassFqName: FqName,
|
||||
@@ -151,16 +151,16 @@ public class IncrementalPackageFragmentProvider(
|
||||
val memberScope = storageManager.createLazyValue {
|
||||
val partsData = partsNames.map { incrementalCache.getPackagePartData(it) }.filterNotNull()
|
||||
if (partsData.isEmpty())
|
||||
KtScope.empty(this)
|
||||
MemberScope.empty(this)
|
||||
else {
|
||||
val scopes = partsData.map { IncrementalPackageScope(JvmProtoBufUtil.readPackageDataFrom(it.data, it.strings)) }
|
||||
ChainedScope(this,
|
||||
"Member scope for incremental compilation: union of multifile class parts data for $multifileClassFqName",
|
||||
*scopes.toTypedArray<KtScope>())
|
||||
*scopes.toTypedArray<MemberScope>())
|
||||
}
|
||||
}
|
||||
|
||||
override fun getMemberScope(): KtScope = memberScope()
|
||||
override fun getMemberScope(): MemberScope = memberScope()
|
||||
}
|
||||
|
||||
private inner class IncrementalPackageScope(val packageData: PackageData) : DeserializedPackageMemberScope(
|
||||
|
||||
+2
-2
@@ -24,7 +24,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.kotlin.descriptors.ClassifierDescriptor;
|
||||
import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor;
|
||||
import org.jetbrains.kotlin.renderer.DescriptorRenderer;
|
||||
import org.jetbrains.kotlin.resolve.scopes.KtScope;
|
||||
import org.jetbrains.kotlin.resolve.scopes.MemberScope;
|
||||
import org.jetbrains.kotlin.types.KotlinType;
|
||||
import org.jetbrains.kotlin.types.KotlinTypeImpl;
|
||||
import org.jetbrains.kotlin.types.TypeProjectionImpl;
|
||||
@@ -67,7 +67,7 @@ class PropagationHeuristics {
|
||||
arrayTypeFromSuper.getConstructor(),
|
||||
arrayTypeFromSuper.isMarkedNullable(),
|
||||
Arrays.asList(new TypeProjectionImpl(Variance.OUT_VARIANCE, elementTypeInSuper)),
|
||||
KtScope.Companion.empty(elementType.getMemberScope().getContainingDeclaration()));
|
||||
MemberScope.Companion.empty(elementType.getMemberScope().getContainingDeclaration()));
|
||||
|
||||
data.reportError("Return type is not a subtype of overridden method. " +
|
||||
"To fix it, add annotation with Kotlin signature to super method with type "
|
||||
|
||||
+2
-2
@@ -45,7 +45,7 @@ import org.jetbrains.kotlin.resolve.jvm.JavaResolverUtils;
|
||||
import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodSignature;
|
||||
import org.jetbrains.kotlin.resolve.jvm.jvmSignature.KotlinToJvmSignatureMapper;
|
||||
import org.jetbrains.kotlin.resolve.jvm.jvmSignature.KotlinToJvmSignatureMapperKt;
|
||||
import org.jetbrains.kotlin.resolve.scopes.KtScope;
|
||||
import org.jetbrains.kotlin.resolve.scopes.MemberScope;
|
||||
import org.jetbrains.kotlin.types.*;
|
||||
|
||||
import java.util.*;
|
||||
@@ -401,7 +401,7 @@ public class SignaturesPropagationData {
|
||||
boolean resultNullable = typeMustBeNullable(autoType, typesFromSuper, howThisTypeIsUsed);
|
||||
ClassifierDescriptor resultClassifier = modifyTypeClassifier(autoType, typesFromSuper);
|
||||
List<TypeProjection> resultArguments = getTypeArgsOfType(autoType, resultClassifier, typesFromSuper);
|
||||
KtScope resultScope;
|
||||
MemberScope resultScope;
|
||||
if (resultClassifier instanceof ClassDescriptor) {
|
||||
resultScope = ((ClassDescriptor) resultClassifier).getMemberScope(resultArguments);
|
||||
}
|
||||
|
||||
+2
-2
@@ -34,7 +34,7 @@ import org.jetbrains.kotlin.resolve.DescriptorUtils;
|
||||
import org.jetbrains.kotlin.resolve.TypeResolver;
|
||||
import org.jetbrains.kotlin.resolve.jvm.JavaDescriptorResolverKt;
|
||||
import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatform;
|
||||
import org.jetbrains.kotlin.resolve.scopes.KtScope;
|
||||
import org.jetbrains.kotlin.resolve.scopes.MemberScope;
|
||||
import org.jetbrains.kotlin.types.*;
|
||||
|
||||
import java.util.*;
|
||||
@@ -148,7 +148,7 @@ public class TypeTransformingVisitor extends KtVisitor<KotlinType, Void> {
|
||||
altArguments.add(getAltArgument(type, typeConstructor, i, arguments.get(i)));
|
||||
}
|
||||
|
||||
KtScope memberScope;
|
||||
MemberScope memberScope;
|
||||
if (typeConstructorClassifier instanceof TypeParameterDescriptor) {
|
||||
memberScope = typeConstructorClassifier.getDefaultType().getMemberScope();
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.jetbrains.kotlin.resolve.ImportPath
|
||||
import org.jetbrains.kotlin.resolve.PlatformConfigurator
|
||||
import org.jetbrains.kotlin.resolve.TargetPlatform
|
||||
import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter
|
||||
import org.jetbrains.kotlin.resolve.scopes.KtScope
|
||||
import org.jetbrains.kotlin.resolve.scopes.MemberScope
|
||||
import java.util.*
|
||||
|
||||
public object JvmPlatform : TargetPlatform("JVM") {
|
||||
@@ -50,8 +50,8 @@ private val DEFAULT_IMPORTS_FOR_JVM = ArrayList<ImportPath>().apply {
|
||||
add(ImportPath("kotlin.jvm.*"))
|
||||
add(ImportPath("kotlin.io.*"))
|
||||
|
||||
fun addAllClassifiersFromScope(scope: KtScope) {
|
||||
for (descriptor in scope.getDescriptors(DescriptorKindFilter.CLASSIFIERS, KtScope.ALL_NAME_FILTER)) {
|
||||
fun addAllClassifiersFromScope(scope: MemberScope) {
|
||||
for (descriptor in scope.getDescriptors(DescriptorKindFilter.CLASSIFIERS, MemberScope.ALL_NAME_FILTER)) {
|
||||
add(ImportPath(DescriptorUtils.getFqNameSafe(descriptor), false))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user