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

DocC cannot generate documentation for tuple containing multiple parameter packs. #999

Open
2 tasks done
JessyCatterwaul opened this issue Jul 26, 2024 · 0 comments
Open
2 tasks done
Labels
bug Something isn't working

Comments

@JessyCatterwaul
Copy link

JessyCatterwaul commented Jul 26, 2024

Description

Here is the simplest example I've been able to come up with:

public func function<each Element0, each Element1>(
  _: (repeat (each Element0, each Element1))
) { }

You need that for the following kinds of stuff:

/// A tuple of pairs built out of two underlying tuples.
///
/// - Note: Unlike `zip` for sequences, these two tuples are required to have the same count.
@_documentation(visibility: private) // DocC can't cope with this signature.
@inlinable public func zip<each Element0, each Element1>(
  _ element0: (repeat each Element0),
  _ element1: (repeat each Element1)
) -> (repeat (each Element0, each Element1)) {
  (repeat (each element0, each element1))
}
/// Equate tuples of tuples.
///
/// Tuples can't be considered `Equatable`,
/// so just using a version of `==` that compares parameters packs of `Equatables` is not adequate.
@_documentation(visibility: private) // DocC can't cope with this signature.
@inlinable public func == <each Element0: Equatable, each Element1: Equatable>(
  _ element0: (repeat (each Element0, each Element1)),
  _ element1: (repeat (each Element0, each Element1))
) -> Bool {
  for elements in repeat (each element0, each element1) {
    guard elements.0 == elements.1 else { return false }
  }
  return true
}

Checklist

  • If possible, I've reproduced the issue using the main branch of this package.
  • This issue hasn't been addressed in an existing GitHub issue.

Expected Behavior

I don't have to add @_documentation(visibility: private) to such code, and can document it! 📜

Actual behavior

Error: dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "symbols", intValue: nil), _JSONKey(stringValue: "Index 0", intValue: 0), CodingKeys(stringValue: "swiftGenerics", intValue: nil), CodingKeys(stringValue: "constraints", intValue: nil), _JSONKey(stringValue: "Index 0", intValue: 0), CodingKeys(stringValue: "kind", intValue: nil)], debugDescription: "Cannot initialize Kind from invalid String value sameShape", underlyingError: nil))
Command CompileDocumentation failed with a nonzero exit code

Steps To Reproduce

No response

Swift-DocC Version Information

Tip of main: 081ad56

Swift Compiler Version Information

swift-driver version: 1.112.3 Apple Swift version 6.0 (swiftlang-6.0.0.6.8 clang-1600.0.23.1)
@JessyCatterwaul JessyCatterwaul added the bug Something isn't working label Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant