Uploaded image for project: 'Scala Programming Language'
  1. Scala Programming Language
  2. SI-10060

NumericRange.max returns unexpected value on empty ranges

    Details

      Description

       

      scala> Range.Long.inclusive(111, 999, -1).max
      res28: Long = 111

       

      I expect `Range.Long.max` to throw java.util.NoSuchElementException to be consistent with `Range.Long.min` and `Range.max` instead of returning a wrong value.

      More examples here https://gist.github.com/tabdulradi/b3ff116032f2eb16aedf077d8e5f8427

        Attachments

          Activity

            People

            • Assignee:
              tabdulradi Tamer Mohammed Abdulradi
              Reporter:
              tabdulradi Tamer Mohammed Abdulradi
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: