Removed KtScope.Empty and created util function emptyScope

This commit is contained in:
Stanislav Erokhin
2015-11-03 21:51:36 +03:00
parent 4e891a3f98
commit a90ca14033
18 changed files with 44 additions and 48 deletions
@@ -27,7 +27,7 @@ public class MutablePackageFragmentDescriptor extends PackageFragmentDescriptorI
public MutablePackageFragmentDescriptor(@NotNull ModuleDescriptor module, @NotNull FqName fqName) {
super(module, fqName);
scope = new SimpleKtScope(this, "Members of " + fqName + " in " + module);
scope = KtScope.Companion.empty(module);
}
@NotNull
@@ -165,7 +165,7 @@ public class ConstraintSystemImpl : ConstraintSystem {
val TypeParameterDescriptor.correspondingType: KotlinType
get() = cachedTypeForVariable.getOrPut(this) {
KotlinTypeImpl.create(Annotations.EMPTY, this.getTypeConstructor(), false, listOf(), KtScope.Empty)
KotlinTypeImpl.create(Annotations.EMPTY, this.getTypeConstructor(), false, listOf(), KtScope.empty(this))
}
fun KotlinType.isProper() = !TypeUtils.containsSpecialType(this) {
@@ -573,7 +573,7 @@ public fun createTypeSubstitutor(conversion: (TypeParameterDescriptor) -> TypePa
if (descriptor !is TypeParameterDescriptor) return null
val typeParameterDescriptor = conversion(descriptor) ?: return null
val type = KotlinTypeImpl.create(Annotations.EMPTY, typeParameterDescriptor.getTypeConstructor(), false, listOf(), KtScope.Empty)
val type = KotlinTypeImpl.create(Annotations.EMPTY, typeParameterDescriptor.getTypeConstructor(), false, listOf(), KtScope.empty(typeParameterDescriptor))
return TypeProjectionImpl(type)
}
})
@@ -104,7 +104,7 @@ class ClassifierQualifier(
override val scope: KtScope get() {
if (classifier !is ClassDescriptor) {
return KtScope.Empty
return KtScope.empty(classifier)
}
val scopes = ArrayList<KtScope>(3)
@@ -125,7 +125,7 @@ class ClassifierQualifier(
override fun getNestedClassesAndPackageMembersScope(): KtScope {
if (classifier !is ClassDescriptor) {
return KtScope.Empty
return KtScope.empty(classifier)
}
val scopes = ArrayList<KtScope>(2)