work around javac bug, fix tests
This commit is contained in:
@@ -550,9 +550,6 @@ public class JetTypeMapper {
|
||||
signatureVisitor.writeClassBound();
|
||||
|
||||
for (JetType jetType : typeParameterDescriptor.getUpperBounds()) {
|
||||
if (jetType.equals(JetStandardClasses.getNullableAnyType())) {
|
||||
continue;
|
||||
}
|
||||
if (jetType.getConstructor().getDeclarationDescriptor() instanceof ClassDescriptor) {
|
||||
if (!CodegenUtil.isInterface(jetType)) {
|
||||
mapType(jetType, signatureVisitor);
|
||||
@@ -561,7 +558,10 @@ public class JetTypeMapper {
|
||||
}
|
||||
}
|
||||
|
||||
// "extends Object" seems to be not optional according to ClassFileFormat-Java5.pdf
|
||||
// "extends Object" is optional according to ClassFileFormat-Java5.pdf
|
||||
// but javac complaints to signature:
|
||||
// <P:>Ljava/lang/Object;
|
||||
// TODO: avoid writing java/lang/Object if interface list is not empty
|
||||
}
|
||||
signatureVisitor.writeClassBoundEnd();
|
||||
|
||||
|
||||
+21
-1
@@ -252,6 +252,23 @@ public class JavaDescriptorResolver {
|
||||
throw new IllegalStateException("PsiTypeParameter '" + name + "' is not found");
|
||||
}
|
||||
|
||||
|
||||
// cache
|
||||
protected ClassDescriptor javaLangObject;
|
||||
|
||||
@NotNull
|
||||
private ClassDescriptor getJavaLangObject() {
|
||||
if (javaLangObject == null) {
|
||||
javaLangObject = resolveClass("java.lang.Object");
|
||||
}
|
||||
return javaLangObject;
|
||||
}
|
||||
|
||||
private boolean isJavaLangObject(JetType type) {
|
||||
return type.getConstructor().getDeclarationDescriptor() == getJavaLangObject();
|
||||
}
|
||||
|
||||
|
||||
private abstract class JetSignatureTypeParameterVisitor extends JetSignatureExceptionsAdapter {
|
||||
|
||||
private final DeclarationDescriptor containingDeclaration;
|
||||
@@ -272,12 +289,15 @@ public class JavaDescriptorResolver {
|
||||
|
||||
List<JetType> upperBounds = new ArrayList<JetType>();
|
||||
List<JetType> lowerBounds = new ArrayList<JetType>();
|
||||
|
||||
|
||||
@Override
|
||||
public JetSignatureVisitor visitClassBound() {
|
||||
return new JetTypeJetSignatureReader(JavaDescriptorResolver.this, semanticServices.getJetSemanticServices().getStandardLibrary()) {
|
||||
@Override
|
||||
protected void done(@NotNull JetType jetType) {
|
||||
if (isJavaLangObject(jetType)) {
|
||||
return;
|
||||
}
|
||||
upperBounds.add(jetType);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user