Uploaded image for project: 'Swift'
  1. Swift
  2. SR-12113

Sequence.max(), .max(by:), .min(), .min(by:) should document ambiguity resolution

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: Standard Library
    • Labels:
      None

      Description

      When a sequence contains multiple maximum or minimum elements, the methods max(), max(by:), min(), and min(by:) seem to prefer returning the earlier element, but this isn't documented. I'd like to feel secure in relying on this behavior, so it would be great to have this reflected in the method documentation. Or if the standard library doesn't want to guarantee this then it should explicitly call that out.

        Attachments

          Activity

            People

            Assignee:
            nnnnnnnn Nate Cook
            Reporter:
            lily Lily Ballard
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: