Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unreachable code warnings when all reconnectable swift routes have compat wrappers #347

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

julianlocke
Copy link
Contributor

Background compatible routes get generated reconnection wrapper types. If they're in the allow list for Objective-C compatibility generation as well, an additional Objective-C wrapper type will be generated. If we generate an Objective C compatibility wrapper for each Swift one, a switch statement used to map from one to the other will contain an unreachable default statement. Since each layer is generated in separate (and potentially parallel) code generation passes, it's difficult make the generation logic smart enough to know whether to include the default. This change eliminates the warning by generating a different control flow that accommodates both situations naturally.

Checklist

General Contributing

  • Have you read the Code of Conduct and signed the CLA?

Is This a Code Change?

  • Non-code related change (markdown/git settings etc)
  • Code Change
  • Example/Test Code Change

Validation

  • Have you ran tox?
  • Do the tests pass?

Copy link

codecov bot commented Aug 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (fix-route-name-collisions@87ec270). Learn more about missing BASE report.

Additional details and impacted files
@@                     Coverage Diff                      @@
##             fix-route-name-collisions     #347   +/-   ##
============================================================
  Coverage                             ?   49.92%           
============================================================
  Files                                ?       37           
  Lines                                ?     8808           
  Branches                             ?     1887           
============================================================
  Hits                                 ?     4397           
  Misses                               ?     4094           
  Partials                             ?      317           
Flag Coverage Δ
unit 49.92% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Base automatically changed from fix-route-name-collisions to swifty-dropbox-beta August 27, 2024 17:34
@julianlocke julianlocke force-pushed the fix-unreachable-code branch from 018e3d6 to 2f6edd7 Compare August 27, 2024 17:36
@julianlocke julianlocke merged commit 54d2f72 into swifty-dropbox-beta Aug 27, 2024
6 of 10 checks passed
@julianlocke julianlocke deleted the fix-unreachable-code branch August 27, 2024 17:36
julianlocke added a commit that referenced this pull request Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants