Introduce PackagePartSource to store part class name in deserialized descriptors

Not used at the moment, will be in the following commits
This commit is contained in:
Alexander Udalov
2015-12-18 23:14:53 +03:00
parent f4c5289cfc
commit 03606c13aa
14 changed files with 92 additions and 34 deletions
@@ -23,6 +23,7 @@ import org.jetbrains.kotlin.descriptors.ClassDescriptor;
import org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor;
import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader;
import org.jetbrains.kotlin.name.Name;
import org.jetbrains.kotlin.resolve.jvm.JvmClassName;
import org.jetbrains.kotlin.resolve.scopes.ChainedMemberScope;
import org.jetbrains.kotlin.resolve.scopes.MemberScope;
import org.jetbrains.kotlin.serialization.ClassData;
@@ -79,8 +80,9 @@ public final class DeserializedDescriptorResolver {
String[] strings = kotlinClass.getClassHeader().getStrings();
assert strings != null : "String table not found in " + kotlinClass;
PackageData packageData = JvmProtoBufUtil.readPackageDataFrom(data, strings);
JvmPackagePartSource source = new JvmPackagePartSource(JvmClassName.byClassId(kotlinClass.getClassId()));
return new DeserializedPackageMemberScope(
descriptor, packageData.getPackageProto(), packageData.getNameResolver(), components,
descriptor, packageData.getPackageProto(), packageData.getNameResolver(), source, components,
new Function0<Collection<Name>>() {
@Override
public Collection<Name> invoke() {
@@ -0,0 +1,22 @@
/*
* Copyright 2010-2015 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.load.kotlin
import org.jetbrains.kotlin.resolve.jvm.JvmClassName
import org.jetbrains.kotlin.serialization.deserialization.descriptors.PackagePartSource
class JvmPackagePartSource(val className: JvmClassName) : PackagePartSource