Skip to content

Protocol and parameter mismatch in codeΒ #629

@heckj

Description

@heckj

Describe the issue

As the API has evolved, there's a slight mismatch between the parameter name in the protocol and what's used in some of the conforming types

Vapor version

4.119.2

Operating system and version

macOS 16.4

Swift version

Swift Package Manager - Swift 6.3.0

Steps to reproduce

  1. swift package add-dependency https://github.com/swiftlang/swift-docc-plugin --from 1.1.0
  2. swift package generate-documentation --target PostgresNIO

Outcome

No response

Additional notes

While I was making fixes to spelling and resolving DocC warnings (#628), a few couldn't be resolved due to a mismatch in protocol and conforming types. I wasn't sure which was a preferable solution, so opening this bug to inquire

The protocol PostgresDecodable and its PostgresRange conformance declare the parameter as from byteBuffer:, but all other conforming types (Bool, String, UUID, Int, Float, Double, Date, Data, ByteBuffer, Array, Decimal, ClosedRange, Range, RawRepresentable) use from buffer:. The doc comment now documents buffer, so the 2 remaining declarations generate warnings because their code doesn't match.

A suggested fix I found was to rename byteBuffer to buffer in these two locations:

  1. Sources/PostgresNIO/New/PostgresCodable.swift:85 β€” the protocol requirement
  2. Sources/PostgresNIO/New/Data/Range+PostgresCodable.swift:102 β€” the PostgresRange conformance (which also references byteBuffer throughout its method body)

Happy to propose a PR with the change, but wanted to ask before I did such a thing, potentially causing a fuss with other places I can't see, just to resolve from DocC warnings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions