Wrong abi test fix

This commit is contained in:
Michael Bogdanov
2015-08-31 12:42:58 +03:00
parent 939f28f293
commit 84649e4b26
11 changed files with 9 additions and 4 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
compiler/testData/cli/jvm/wrongAbiVersionLib/bin/ClassWithWrongAbiVersion.class: error: class 'ClassWithWrongAbiVersion' was compiled with an incompatible version of Kotlin. Its ABI version is -1, expected ABI version is $ABI_VERSION$
compiler/testData/cli/jvm/wrongAbiVersionLib/bin/wrong/WrongPackage.class: error: class 'wrong/WrongPackage' was compiled with an incompatible version of Kotlin. Its ABI version is -1, expected ABI version is $ABI_VERSION$
compiler/testData/cli/jvm/wrongAbiVersionLib/bin/wrong/Wrong_packageKt.class: error: class 'wrong/Wrong_packageKt' was compiled with an incompatible version of Kotlin. Its ABI version is -1, expected ABI version is $ABI_VERSION$
compiler/testData/cli/jvm/wrongAbiVersion.kt:4:3: error: unresolved reference: bar
bar()
^
@@ -0,0 +1 @@
wrong->wrong/Wrong_packageKt
@@ -70,7 +70,7 @@ public final class DeserializedDescriptorResolver {
@Nullable
public JetScope createKotlinPackageScope(@NotNull PackageFragmentDescriptor descriptor, @NotNull KotlinJvmBinaryClass kotlinClass) {
//TODO add assertion from readData(kotlinClass, CLASS);
String[] data = kotlinClass.getClassHeader().getAnnotationData();
String[] data = readData(kotlinClass, KotlinClassHeader.Kind.FILE_FACADE);
if (data != null) {
//all classes are included in java scope
PackageData packageData = JvmProtoBufUtil.readPackageDataFrom(data);
@@ -92,8 +92,12 @@ public final class DeserializedDescriptorResolver {
List<JetScope> list = new ArrayList<JetScope>();
for (KotlinJvmBinaryClass callable : packageParts) {
JetScope scope = createKotlinPackageScope(descriptor, callable);
assert scope != null : "Can't create scope for " + callable;
list.add(scope);
if (scope != null) {
list.add(scope);
}
}
if (list.isEmpty()) {
return JetScope.Empty.INSTANCE$;
}
return new DeserializedNewPackageMemberScope(descriptor, list);
}