Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-10496

Wrong IntRange.by(...) behaviour for left-open ranges

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.0.0
    • 4.0.1
    • None
    • None

    Description

      Call by on IntRange results in loss of information about inclusion of the left border, because inclusiveLeft flag is not passed into NumberRange constructor.

      For example, 5 in (5<..20) gives false when 5 in (5<..20).by(2) gives true.

      While with NumberRange 5 in (5L<..20) and 5 in (5L<..20).by(2) both gives false.

      Also with @CompileStatic even 5 in (5<..20) gives true, because new parameter lost in RangeExpressionTransformer.

      Attachments

        Issue Links

          Activity

            People

              emilles Eric Milles
              TheWebKot Timofey Ananyev
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: