This commit is contained in:
Valentin Kipyatkov
2015-10-25 12:03:29 +03:00
parent e1b8b21abb
commit 5f06f53bfd
45 changed files with 187 additions and 193 deletions
@@ -47,7 +47,7 @@ public class IterableTypesDetection(
private val cache = HashMap<FuzzyType, FuzzyType?>()
private val typesWithExtensionIterator: Collection<KotlinType> = scope
.collectAllFromMeAndParent { it.getDeclaredFunctions(iteratorName, NoLookupLocation.FROM_IDE) }
.collectAllFromMeAndParent { it.getContributedFunctions(iteratorName, NoLookupLocation.FROM_IDE) }
.map { it.extensionReceiverParameter }
.filterNotNull()
.map { it.type }
@@ -33,7 +33,7 @@ import org.jetbrains.kotlin.psi.psiUtil.siblings
import org.jetbrains.kotlin.resolve.descriptorUtil.isExtension
import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
import org.jetbrains.kotlin.resolve.scopes.LexicalScope
import org.jetbrains.kotlin.resolve.scopes.utils.getClassifier
import org.jetbrains.kotlin.resolve.scopes.utils.findClassifier
import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstanceOrNull
import java.util.*
@@ -100,7 +100,7 @@ public class NewDeclarationNameValidator(
getAllAccessibleVariables(name).any { !it.isExtension && it.isVisible() }
Target.FUNCTIONS_AND_CLASSES ->
getAllAccessibleFunctions(name).any { !it.isExtension && it.isVisible() } ||
getClassifier(name, NoLookupLocation.FROM_IDE)?.let { it.isVisible() } ?: false
findClassifier(name, NoLookupLocation.FROM_IDE)?.let { it.isVisible() } ?: false
}
}