Skip to content

Fix unused variable 'moduleClass' in RCTTurboModuleManager.mm#57221

Closed
sammy-SC wants to merge 1 commit into
react:mainfrom
sammy-SC:export-D108605640
Closed

Fix unused variable 'moduleClass' in RCTTurboModuleManager.mm#57221
sammy-SC wants to merge 1 commit into
react:mainfrom
sammy-SC:export-D108605640

Conversation

@sammy-SC

Copy link
Copy Markdown
Contributor

Summary:
Pika 27 (LLVM 21 / Swift 6.4) flags Class moduleClass = [module class]; as an unused variable (-Werror,-Wunused-variable) in RCTTurboModuleManager.mm. Its only reference is inside an RCTLogError call, which compiles to a no-op in release builds, leaving the variable unused.

This inlines [module class] directly into the RCTLogError call and removes the local declaration. The expression is now elided together with the log macro in release builds, eliminating the dangling unused variable. Debug logging behavior is identical.

No #pragma diagnostic suppression is used, per the task requirements.

Session trajectory link

Reviewed By: javache

Differential Revision: D108605640

Summary:
Pika 27 (LLVM 21 / Swift 6.4) flags `Class moduleClass = [module class];` as an unused variable (`-Werror,-Wunused-variable`) in `RCTTurboModuleManager.mm`. Its only reference is inside an `RCTLogError` call, which compiles to a no-op in release builds, leaving the variable unused.

This inlines `[module class]` directly into the `RCTLogError` call and removes the local declaration. The expression is now elided together with the log macro in release builds, eliminating the dangling unused variable. Debug logging behavior is identical.

No `#pragma` diagnostic suppression is used, per the task requirements.

[Session trajectory link](https://www.internalfb.com/intern/devai/devmate/inspector/?id=36a6fdd8-65cb-4fd8-bbc5-6d4afa5245dd)

Reviewed By: javache

Differential Revision: D108605640
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 16, 2026
@meta-codesync

meta-codesync Bot commented Jun 16, 2026

Copy link
Copy Markdown

@sammy-SC has exported this pull request. If you are a Meta employee, you can view the originating Diff in D108605640.

@meta-codesync meta-codesync Bot closed this in 25f6810 Jun 16, 2026
@meta-codesync meta-codesync Bot added the Merged This PR has been merged. label Jun 16, 2026
@meta-codesync

meta-codesync Bot commented Jun 16, 2026

Copy link
Copy Markdown

This pull request has been merged in 25f6810.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant