From edff5e977e76fab29eeb2c626df9b4cf5d8b6d29 Mon Sep 17 00:00:00 2001 From: Ruslan Shestopalyuk Date: Wed, 6 Sep 2023 06:27:43 -0700 Subject: [PATCH] Fix OSS Android build with enableWarningsAsErrors=true (#39311) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/39311 ## Changelog: [Internal] - Follow up to https://github.com/facebook/react-native/pull/39284 (D48960815), which landed and broke one of the build clauses on CircleCI tests (treating unused parameters as errors, even though they are expected to be unused). Reviewed By: hoxyq Differential Revision: D49010472 fbshipit-source-id: 469bf3a9923b85e465d4574e69e9372c16fbc125 --- .../react/uimanager/ReactPropForShadowNodeSpecTest.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/uimanager/ReactPropForShadowNodeSpecTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/uimanager/ReactPropForShadowNodeSpecTest.kt index 1812ccc7e0a..74ce703c4de 100644 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/uimanager/ReactPropForShadowNodeSpecTest.kt +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/uimanager/ReactPropForShadowNodeSpecTest.kt @@ -26,6 +26,7 @@ class ReactPropForShadowNodeSpecTest { fun testMethodWithWrongNumberOfParams() { BaseViewManager( object : ReactShadowNodeImpl() { + @Suppress("UNUSED_PARAMETER") @ReactProp(name = "prop") fun setterWithIncorrectNumberOfArgs(value: Boolean, anotherValue: Int) {} } @@ -47,7 +48,9 @@ class ReactPropForShadowNodeSpecTest { fun testUnsupportedValueType() { BaseViewManager( object : ReactShadowNodeImpl() { - @ReactProp(name = "prop") fun setterWithMap(value: Map<*, *>) {} + @Suppress("UNUSED_PARAMETER") + @ReactProp(name = "prop") + fun setterWithMap(value: Map<*, *>) {} } .javaClass) .nativeProps @@ -57,6 +60,7 @@ class ReactPropForShadowNodeSpecTest { fun testGroupInvalidNumberOfParams() { BaseViewManager( object : ReactShadowNodeImpl() { + @Suppress("UNUSED_PARAMETER") @ReactPropGroup(names = ["prop1", "prop2"]) fun setterWithTooManyParams(index: Int, value: Float, boolean: Boolean) {} } @@ -68,6 +72,7 @@ class ReactPropForShadowNodeSpecTest { fun testGroupTooFewParams() { BaseViewManager( object : ReactShadowNodeImpl() { + @Suppress("UNUSED_PARAMETER") @ReactPropGroup(names = ["props1", "prop2"]) fun setterWithTooFewParams(index: Int) {} } @@ -79,6 +84,7 @@ class ReactPropForShadowNodeSpecTest { fun testGroupNoIndexParam() { BaseViewManager( object : ReactShadowNodeImpl() { + @Suppress("UNUSED_PARAMETER") @ReactPropGroup(names = ["prop1", "prop2"]) fun setterWithNoIndexParam(value: Float, boolean: Boolean) {} }