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

Static Typechecking of Comparison Operations (e. g. '<') Not Strict Enough

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.1
    • 2.0.6
    • Static Type Checker
    • None
    • Groovy 2.0.1, Java 6 VM (no indication of correction for 2.0.2 found)

    Description

      For classes implementing Comparable (e. g. String) calls to 'compareTo()' with single either directly or through operator like '<' are not detected as incorrect if the argument is on the wrong type (e. g. 'ab' < 1 is accepted).

      Note: Attached test source is modification of standard test delivered with Groovy 2.0.1

      Attachments

        1. STCnAryExpressionTest.groovy
          3 kB
          Frank Plassmeier

        Activity

          People

            melix Cédric Champeau
            fplass Frank Plassmeier
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: