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

Compiler warnings: using 'class' keyword for protocol inheritance is deprecated; use 'AnyObject' instead #247

Closed
bobergj opened this issue May 31, 2021 · 3 comments

Comments

@bobergj
Copy link

bobergj commented May 31, 2021

Is this a support request?
No

Describe the bug

Compiler warnings: "warning: using 'class' keyword for protocol inheritance is deprecated; use 'AnyObject' instead" when linking the LaunchDarkly Swift package.

To reproduce

  1. Add LaunchDarkly swift package to Xcode project
  2. import LaunchDarkly somewhere in app target
  3. Build the app the app target

Expected behavior
No compiler warnings from LaunchDarkly that pollute our build log

Logs

<censored>/SourcePackages/checkouts/ios-client-sdk/LaunchDarkly/LaunchDarkly/Networking/DarklyService.swift:15:35: warning: using 'class' keyword for protocol inheritance is deprecated; use 'AnyObject' instead

<censored>/checkouts/ios-client-sdk/LaunchDarkly/LaunchDarkly/Networking/DarklyService.swift:22:33: warning: using 'class' keyword for protocol inheritance is deprecated; use 'AnyObject' instead

SDK version
5.3.2, but the issues occur in the latest code as well:
https://github.com/launchdarkly/ios-client-sdk/blob/v5/LaunchDarkly/LaunchDarkly/Networking/DarklyService.swift#L15
https://github.com/launchdarkly/ios-client-sdk/blob/v5/LaunchDarkly/LaunchDarkly/Networking/DarklyService.swift#L22

Language version, developer tools
Xcode Version 12.5 (12E262)

OS/platform
macOS 11.2.3 (20D91)

Additional context
N/A

@bwoskow-ld
Copy link
Member

Hi @bobergj,

Thanks for letting us know about this. We haven't yet seen these warnings ourselves and are thinking that this deprecation check may have been introduced in Xcode 12.5.

I have noted this issue on our backlog and we will address it in an upcoming SDK release.

Cheers,
@bwoskow-ld

Filed internally as 110317.

@bobergj
Copy link
Author

bobergj commented Jun 2, 2021

are thinking that this deprecation check may have been introduced in Xcode 12.5.

Yes, this deprecation warning is introduced in Swift 5.4 which shipped in Xcode 12.5

gwhelanLD added a commit that referenced this issue Jun 18, 2021
## [5.4.2] - 2021-06-17
### Fixed
- Update `Package.swift` to use SwiftPM tools version 5.2. This prevents test dependencies from being included transitively. (Thanks, [@escakot](#234)!)
- Update `Quick` test dependency to 3.1.2 to avoid build warnings and adopt security fixes. ([#243](#243))
- Use `AnyObject` over `class` in protocol inheritance to avoid compiler warnings. ([#247](#247))
- Improve CI to test against multiple supported Xcode and Swift language versions.
- Restored test suite compatibility with Xcode 11.4 and Swift 5.2.
@gwhelanLD
Copy link
Contributor

Hi @bobergj,

We've included a fix for this issue in the 5.4.2 release. Thanks for reporting it!

Thanks,
@gwhelanLD

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

No branches or pull requests

3 participants