You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Timofey Ananyev (Jira)" <ji...@apache.org> on 2022/02/16 17:09:00 UTC

[jira] [Created] (GROOVY-10496) Wrong IntRange.by(...) behaviour for left-open ranges

Timofey Ananyev created GROOVY-10496:
----------------------------------------

             Summary: Wrong IntRange.by(...) behaviour for left-open ranges
                 Key: GROOVY-10496
                 URL: https://issues.apache.org/jira/browse/GROOVY-10496
             Project: Groovy
          Issue Type: Bug
    Affects Versions: 4.0.0
            Reporter: Timofey Ananyev


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}}.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)