Fix project sources after latter changes

ResolveSession is inherited from two interfaces:
1. The one written in Java with 'getModuleDescriptor'
2. And the second one in Kotlin with property 'moduleDescriptor'

Now we treat such declarations from supertypes like they are just plain
property accessor overrides, and 'getModuleDescripton' and it's friends
becomes invisible via ResolveSession
This commit is contained in:
Denis Zharkov
2015-10-26 10:52:15 +03:00
parent 94803ce1c4
commit 95d12260c1
2 changed files with 8 additions and 8 deletions
@@ -66,7 +66,7 @@ public class IDELightClassGenerationSupport(private val project: Project) : Ligh
val file = sortedFiles.first()
val resolveSession = file.getResolutionFacade().getFrontendService(ResolveSession::class.java)
forceResolvePackageDeclarations(files, resolveSession)
return LightClassConstructionContext(resolveSession.bindingContext, resolveSession.getModuleDescriptor())
return LightClassConstructionContext(resolveSession.bindingContext, resolveSession.moduleDescriptor)
}
override fun getContextForClassOrObject(classOrObject: KtClassOrObject): LightClassConstructionContext {
@@ -311,7 +311,7 @@ public class ResolveElementCache(
if (Name.isValidIdentifier(ktElement.getReferencedName())) {
if (trace.getBindingContext()[BindingContext.REFERENCE_TARGET, ktElement] == null) {
val fqName = header.getFqName(ktElement)
val packageDescriptor = resolveSession.getModuleDescriptor().getPackage(fqName)
val packageDescriptor = resolveSession.moduleDescriptor.getPackage(fqName)
trace.record(BindingContext.REFERENCE_TARGET, ktElement, packageDescriptor)
}
}
@@ -409,7 +409,7 @@ public class ResolveElementCache(
private fun propertyAdditionalResolve(resolveSession: ResolveSession, property: KtProperty, file: KtFile, statementFilter: StatementFilter): BindingTrace {
val trace = createDelegatingTrace(property)
val propertyResolutionScope = resolveSession.getDeclarationScopeProvider().getResolutionScopeForDeclaration(property)
val propertyResolutionScope = resolveSession.declarationScopeProvider.getResolutionScopeForDeclaration(property)
val bodyResolver = createBodyResolver(resolveSession, trace, file, statementFilter)
val descriptor = resolveSession.resolveToDescriptor(property) as PropertyDescriptor
@@ -427,7 +427,7 @@ public class ResolveElementCache(
val bodyResolveContext = BodyResolveContextForLazy(TopDownAnalysisMode.LocalDeclarations, { declaration ->
assert(declaration.getParent() == property) { "Must be called only for property accessors, but called for $declaration" }
resolveSession.getDeclarationScopeProvider().getResolutionScopeForDeclaration(declaration)
resolveSession.declarationScopeProvider.getResolutionScopeForDeclaration(declaration)
})
bodyResolver.resolvePropertyAccessors(bodyResolveContext, property, descriptor)
@@ -444,7 +444,7 @@ public class ResolveElementCache(
private fun functionAdditionalResolve(resolveSession: ResolveSession, namedFunction: KtNamedFunction, file: KtFile, statementFilter: StatementFilter): BindingTrace {
val trace = createDelegatingTrace(namedFunction)
val scope = resolveSession.getDeclarationScopeProvider().getResolutionScopeForDeclaration(namedFunction)
val scope = resolveSession.declarationScopeProvider.getResolutionScopeForDeclaration(namedFunction)
val functionDescriptor = resolveSession.resolveToDescriptor(namedFunction) as FunctionDescriptor
ForceResolveUtil.forceResolveAllContents(functionDescriptor)
@@ -459,7 +459,7 @@ public class ResolveElementCache(
private fun secondaryConstructorAdditionalResolve(resolveSession: ResolveSession, constructor: KtSecondaryConstructor, file: KtFile, statementFilter: StatementFilter): BindingTrace {
val trace = createDelegatingTrace(constructor)
val scope = resolveSession.getDeclarationScopeProvider().getResolutionScopeForDeclaration(constructor)
val scope = resolveSession.declarationScopeProvider.getResolutionScopeForDeclaration(constructor)
val constructorDescriptor = resolveSession.resolveToDescriptor(constructor) as ConstructorDescriptor
ForceResolveUtil.forceResolveAllContents(constructorDescriptor)
@@ -473,7 +473,7 @@ public class ResolveElementCache(
private fun constructorAdditionalResolve(resolveSession: ResolveSession, klass: KtClass, file: KtFile): BindingTrace {
val trace = createDelegatingTrace(klass)
val scope = resolveSession.getDeclarationScopeProvider().getResolutionScopeForDeclaration(klass)
val scope = resolveSession.declarationScopeProvider.getResolutionScopeForDeclaration(klass)
val classDescriptor = resolveSession.resolveToDescriptor(klass) as ClassDescriptor
val constructorDescriptor = classDescriptor.getUnsubstitutedPrimaryConstructor()
@@ -514,7 +514,7 @@ public class ResolveElementCache(
statementFilter: StatementFilter
): BodyResolver {
val globalContext = SimpleGlobalContext(resolveSession.storageManager, resolveSession.getExceptionTracker())
val module = resolveSession.getModuleDescriptor()
val module = resolveSession.moduleDescriptor
return createContainerForBodyResolve(
globalContext.withProject(file.getProject()).withModule(module),
trace,