Introduced LexicalScope for file top-level to obtain ownerDescriptor

This commit is contained in:
Valentin Kipyatkov
2015-10-26 15:18:58 +03:00
parent 7a33a16481
commit 4fcd35a5a9
8 changed files with 26 additions and 19 deletions
@@ -22,10 +22,7 @@ import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.utils.Printer
import org.jetbrains.kotlin.utils.addToStdlib.firstIsInstanceOrNull
public class ExplicitImportsScope(
private val descriptors: Collection<DeclarationDescriptor>,
override val ownerDescriptor: DeclarationDescriptor //TODO: temporary?
) : ImportingScope by ImportingScope.Empty {
public class ExplicitImportsScope(private val descriptors: Collection<DeclarationDescriptor>) : ImportingScope by ImportingScope.Empty {
override fun getContributedClassifier(name: Name, location: LookupLocation)
= descriptors.filter { it.getName() == name }.firstIsInstanceOrNull<ClassifierDescriptor>()