Support enums in ultra-light classes
There's no need to add "values"/"valueOf" methods for them (see com.intellij.psi.impl.compiled.StubBuildingVisitor#visitMethod that ignores them too) We already have tests that check enum entries/synthetic methods are properly resolved in Java: idea/testData/kotlinAndJavaChecker/javaAgainstKotlin/*Enum*
This commit is contained in:
@@ -1105,6 +1105,10 @@ public abstract class KotlinBuiltIns {
|
||||
return classFqNameEquals(descriptor, FQ_NAMES._enum);
|
||||
}
|
||||
|
||||
public static boolean isEnum(@NotNull KotlinType type) {
|
||||
return isConstructedFromGivenClassAndNotNullable(type, FQ_NAMES._enum);
|
||||
}
|
||||
|
||||
public static boolean isComparable(@NotNull ClassDescriptor descriptor) {
|
||||
return classFqNameEquals(descriptor, FQ_NAMES.comparable.toUnsafe());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user