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

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

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.0.0-alpha-1, 2.5.0-beta-2, 2.4.13, 2.6.0-alpha-2
    • Fix Version/s: None
    • Component/s: Static Type Checker
    • Labels:
      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

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

              Dates

              • Created:
                Updated: