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

Strange ClassCastException when calling ToString in CompileStatic

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 3.0.7
    • None
    • groovy-jdk
    • None

    Description

      I have a class extending a base class implementing a toString() method. Making the code CompileStatic I get a ClassCassException. Without CompileStatic all is fine.

      String test = myClazz.toString() I get the ClassCastException with myClazz could not be cast to String. Debugging is also strange, I can't get to the base class implementation of toString.

      Interrestingly, the implizit call of toString() is functioning:

      String test = myClazz  All is fine. Debugging also, the toString method is called

       

      There seems a bug in CompileStatic. Something is scrambled.

      Attachments

        Activity

          People

            Unassigned Unassigned
            wagnermahd Marcel Wagner
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: