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

ShortTypeHandling.castToString() is applied even when @CompileStatic is present

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0.0-alpha-1, 2.5.0-beta-2, 2.4.13, 2.6.0-alpha-2
    • None
    • Static Type Checker
    • None

    Description

      Even when
      @CompileStatic is present on the class, ShortTypeHandling.castToString() is applied to RHS of the expression when LHS is of type String.

      I've attached a test class and the compilation result (compiled with groovyc 2.4.13. Versions 2.5.0-beta-2, 2.6.0-alpha-2, 3.0.0-alpha-1 yielded same results).

      Attachments

        1. Test.groovy
          0.2 kB
          Dmitry Zhikharev
        2. Test.class
          2 kB
          Dmitry Zhikharev

        Activity

          People

            Unassigned Unassigned
            jihor Dmitry Zhikharev
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: