diff --git a/src/main/java/me/mrnavastar/r/R.java b/src/main/java/me/mrnavastar/r/R.java index ecc5956..ae546a3 100644 --- a/src/main/java/me/mrnavastar/r/R.java +++ b/src/main/java/me/mrnavastar/r/R.java @@ -87,8 +87,9 @@ public R call(String name, Object... args) { } public Class[] generics() { - if (clazz.getGenericSuperclass() instanceof ParameterizedType type) { - return Arrays.stream(type.getActualTypeArguments()).map(t -> { + Type generic = clazz.getGenericSuperclass(); + if (generic instanceof ParameterizedType) { + return Arrays.stream(((ParameterizedType) generic).getActualTypeArguments()).map(t -> { try { return Class.forName(t.getTypeName()); } catch (ClassNotFoundException e) {