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

java.lang.ClassFormatError: Illegal class name on runtime cast array to trait

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.5
    • 2.4.6
    • None
    • None

    Description

      trait SimpleTrait {
      }
      
      def arr = ["one", 'two'] as String[];
      
      arr as SimpleTrait
      

      Produce:

      java.lang.ClassFormatError: Illegal class name "String;2_groovyProxy" in class file String;2_groovyProxy
      	at ConsoleScript1.run(ConsoleScript1:6)
      

      Possibly related to GROOVY-7650.

      Attachments

        Activity

          People

            Unassigned Unassigned
            hubbitus Pavel Alexeev
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: