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

diagnose-api-breaking-changes false positive when switching to opaque parameter from equivalent generic function #68797

Open
dnadoba opened this issue Sep 27, 2023 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels

Comments

@dnadoba
Copy link
Contributor

dnadoba commented Sep 27, 2023

Going from a generic function like this:

public struct Foo { 
    public init<Numbers: Sequence>(_ numbers: Numbers) where Numbers.Element == Int {}
}

to an equivalent function but using opaque parameters like this

public struct Foo {
    public init(_ numbers: some Sequence<Int>) {}
}

will result in a false positive by diagnose-api-breaking-changes:

1 breaking change detected in MyLibrary:
  💔 API breakage: constructor Foo.init(_:) has generic signature change from <Numbers where Numbers : Swift.Sequence, Numbers.Element == Swift.Int> to 

Note that the output is also missing the new generic signature.

Tested with:

% swift --version                                  
swift-driver version: 1.87.1 Apple Swift version 5.9 (swiftlang-5.9.0.128.106 clang-1500.0.40.1)
Target: arm64-apple-macosx14.0

and also with Swift 5.8.1 on Ubuntu.

Reproduce

Either use the code snipped from above our downloads the attached Swift Package (MyLibrary.zip) and run:

swift package diagnose-api-breaking-changes 1.0.0
@dnadoba dnadoba added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels labels Sep 27, 2023
@dnadoba
Copy link
Contributor Author

dnadoba commented Sep 27, 2023

rdar://116109255

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. triage needed This issue needs more specific labels
Projects
None yet
Development

No branches or pull requests

1 participant