mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2025-01-10 08:54:11 -08:00
Fix Enum.getDeclaringClass
This commit is contained in:
parent
f61567dfde
commit
a22eb43bde
|
@ -57,7 +57,8 @@ public abstract class TEnum<E extends TEnum<E>> extends TObject implements TComp
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public final TClass<E> getDeclaringClass() {
|
public final TClass<E> getDeclaringClass() {
|
||||||
return (TClass<E>) (Object) getClass();
|
Class<E> result = (Class<E>) getClass();
|
||||||
|
return (TClass<E>) (Object) (result.getSuperclass().equals(Enum.class) ? result : result.getSuperclass());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue
Block a user