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

java.lang.IncompatibleClassChangeError thrown with Interface containing variable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7-beta-2
    • Fix Version/s: 1.6.6, 1.7-rc-1
    • Component/s: Compiler
    • Labels:
      None

      Description

      First reported in http://jira.codehaus.org/browse/GROOVY-3823, opening a new Jira, as advised.

      With:

      interface II {
        Integer i
        Integer 2i = i * 2
      }
      

      Currently (1.7b2), one gets:

      groovy> interface II {
      groovy>   Integer i
      groovy>   Integer i2 = i * 2
      groovy> }
      groovy> println II.i
      groovy> println II.i2
      

      Exception thrown

      java.lang.IncompatibleClassChangeError: Found interface II, but class was expected
      
      	at II.<clinit>(ConsoleScript0:3)
      
      	at ConsoleScript0.class$(ConsoleScript0)
      
      	at ConsoleScript0.$get$$class$II(ConsoleScript0)
      
      	at ConsoleScript0.run(ConsoleScript0:6)
      

        Attachments

        1. v16x_3830.txt
          6 kB
          Roshan Dawrani
        2. v16x_3830_v2.txt
          7 kB
          Roshan Dawrani

          Issue Links

            Activity

              People

              • Assignee:
                roshandawrani Roshan Dawrani
                Reporter:
                alpheratz alpheratz
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: