Skip to content

Commit

Permalink
[pigeon] Fully-qualify types in Equatable extension test (flutter#6946)
Browse files Browse the repository at this point in the history
Updating to Xcode 16 exposed a new compilation error: "extension declares a conformance of imported type 'DataWithEnum' to imported protocol 'Equatable'".  The [Swift Warning for Retroactive Conformances of External Types](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0364-retroactive-conformance-warning.md) proposal says:

> It does mean projects building with an older Swift will not have access to [the @retroactive] syntax, so as a source compatible fallback, a client can silence this warning by fully-qualifying all types in the extension. As an example, the above conformance can also be written as
> ```
> extension Foundation.Date: Swift.Identifiable {
>     // ...
> }
> ```
> This will allow projects that need to build with multiple versions of Swift, and which have valid reason to declare such conformances, to declare them without tying their project to a newer compiler build.

So change the test to fully-qualify the types.  This prevented the warning when I tried it in flutter/packages#6942.

Fixes flutter#150391
  • Loading branch information
jmagman authored Jun 18, 2024
1 parent 937038c commit cd73061
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/pigeon/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## NEXT

* [swift] Fully-qualifies types in Equatable extension test.

## 20.0.1

* [cpp] Fixes handling of null class arguments.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import Flutter
import UIKit

@UIApplicationMain
@main
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class MockEnumApi2Host: EnumApi2Host {
}
}

extension DataWithEnum: Equatable {
extension test_plugin.DataWithEnum: Swift.Equatable {
public static func == (lhs: DataWithEnum, rhs: DataWithEnum) -> Bool {
lhs.state == rhs.state
}
Expand Down

0 comments on commit cd73061

Please sign in to comment.