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

Unnecessary castToType when boxed type subclasses or implements the target type

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.8.4, 2.0-beta-1
    • None
    • None

    Description

      With the following code :

      int method() { 1 }
      void test() {
       int i = method()
       println i
      }
      test()
      

      The compiler produces an uncessary castToType() call to convert a boxed int (aka Integer) to Object.

      Attachments

        Activity

          People

            melix Cédric Champeau
            melix Cédric Champeau
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: