fix comparable signature generation

fix todo by Alex Tkachman 2ec54436c5
This commit is contained in:
Stepan Koltsov
2012-01-03 21:15:26 +04:00
parent a7a1bd2102
commit 74e72fbbc6
2 changed files with 19 additions and 12 deletions
@@ -298,15 +298,6 @@ public class JetTypeMapper {
throw new IllegalStateException("should not compile an error type");
}
if (standardLibrary.getComparable().equals(descriptor)) {
if (jetType.getArguments().size() != 1) {
throw new UnsupportedOperationException("Comparable must have one type argument");
}
// todo signature
return JL_COMPARABLE_TYPE;
}
if (standardLibrary.getArray().equals(descriptor)) {
if (jetType.getArguments().size() != 1) {
throw new UnsupportedOperationException("arrays must have one type argument");
@@ -334,9 +325,19 @@ public class JetTypeMapper {
}
if (descriptor instanceof ClassDescriptor) {
String name = getFQName(descriptor);
Type asmType = Type.getObjectType(name + (kind == OwnerKind.TRAIT_IMPL ? JvmAbi.TRAIT_IMPL_SUFFIX : ""));
Type asmType;
if (standardLibrary.getComparable().equals(descriptor)) {
if (jetType.getArguments().size() != 1) {
throw new UnsupportedOperationException("Comparable must have one type argument");
}
asmType = JL_COMPARABLE_TYPE;
} else {
String name = getFQName(descriptor);
asmType = Type.getObjectType(name + (kind == OwnerKind.TRAIT_IMPL ? JvmAbi.TRAIT_IMPL_SUFFIX : ""));
}
if (signatureVisitor != null) {
signatureVisitor.writeClassBegin(asmType.getInternalName(), jetType.isNullable());
@@ -0,0 +1,6 @@
fun cc(): Comparable<java.lang.CharSequence>? = null
// method: namespace::cc
// jvm signature: ()Ljava/lang/Comparable;
// generic signature: ()Ljava/lang/Comparable<Ljava/lang/CharSequence;>;
// kotlin signature: ()?Ljava/lang/Comparable<Ljava/lang/CharSequence;>;