Enum class kinds supported. Assertion for no return type made explicit

This commit is contained in:
Andrey Breslav
2012-06-25 17:48:56 +02:00
parent dea6c452a0
commit a76e7f6d56
@@ -246,6 +246,12 @@ public class NamespaceComparator {
case ANNOTATION_CLASS: case ANNOTATION_CLASS:
sb.append("annotation class"); sb.append("annotation class");
break; break;
case ENUM_CLASS:
sb.append("enum class");
break;
case ENUM_ENTRY:
sb.append("enum entry");
break;
default: default:
throw new IllegalStateException("unknown class kind: " + kind); throw new IllegalStateException("unknown class kind: " + kind);
} }
@@ -295,7 +301,13 @@ public class NamespaceComparator {
sb.append("("); sb.append("(");
new TypeSerializer(sb).serializeCommaSeparated(fun.getValueParameters()); new TypeSerializer(sb).serializeCommaSeparated(fun.getValueParameters());
sb.append("): "); sb.append("): ");
new TypeSerializer(sb).serialize(fun.getReturnType()); JetType returnType = fun.getReturnType();
if (returnType == null) {
throw new IllegalStateException("No return type for " + fun);
}
else {
new TypeSerializer(sb).serialize(returnType);
}
} }
public void serialize(ExtensionReceiver extensionReceiver) { public void serialize(ExtensionReceiver extensionReceiver) {