mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix OSS build error in JavaModuleWrapper (#50905)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/50905 Subtle compiler differences cause this to fail, but we can just `Class<*>` here instead. Changelog: [Internal] Reviewed By: cortinico, rshest Differential Revision: D73593304 fbshipit-source-id: ea3996fc0641ae5d12a6923bd78645e21232afe7
This commit is contained in:
committed by
Facebook GitHub Bot
parent
49ea9d80b8
commit
ac8b01fb6f
+3
-4
@@ -60,14 +60,13 @@ internal class JavaModuleWrapper(
|
||||
private fun findMethods() {
|
||||
Systrace.beginSection(TRACE_TAG_REACT, "findMethods")
|
||||
|
||||
var classForMethods: Class<out NativeModule> = moduleHolder.module.javaClass
|
||||
var classForMethods: Class<*> = moduleHolder.module.javaClass
|
||||
val superClass = classForMethods.superclass
|
||||
if (TurboModule::class.java.isAssignableFrom(superClass)) {
|
||||
if (superClass != null && TurboModule::class.java.isAssignableFrom(superClass)) {
|
||||
// For java module that is based on generated flow-type spec, inspect the
|
||||
// spec abstract class instead, which is the super class of the given Java
|
||||
// module.
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
classForMethods = superClass as Class<out NativeModule>
|
||||
classForMethods = superClass
|
||||
}
|
||||
|
||||
val targetMethods = classForMethods.declaredMethods
|
||||
|
||||
Reference in New Issue
Block a user