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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4.5
    • Fix Version/s: 2.4.6
    • Component/s: None
    • Labels:
      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

            • Assignee:
              Unassigned
              Reporter:
              hubbitus Pavel
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: