Groovy
  1. Groovy
  2. GROOVY-5150

Switch to a primitive representation of constants

    Details

      Description

      Currently, constants such as
      public static final int type = 32
      are not internally represented as primitives.
      This leads to oddities such as a constant being unusable in switch statements.
      Since recent versions of the compile now know primitives, it would be nice if the internal representation was changed.

        Issue Links

          Activity

          Fat Zopilot created issue -
          Hide
          Jochen Theodorou added a comment -

          for clarification.... the 32 is a primitive int, but the init is done in cinit, while the bytecode supports the value being set directly for primitives. Only if the value is set directly, it is supported in a java switch before java7.

          Show
          Jochen Theodorou added a comment - for clarification.... the 32 is a primitive int, but the init is done in cinit, while the bytecode supports the value being set directly for primitives. Only if the value is set directly, it is supported in a java switch before java7.
          Cédric Champeau made changes -
          Field Original Value New Value
          Resolution Fixed [ 1 ]
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Cedric Champeau [ melix ]
          Fix Version/s 2.0-beta-2 [ 18072 ]
          Fix Version/s 1.8.5 [ 18071 ]
          Paul King made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Paul King made changes -
          Link This issue is related to GROOVY-5292 [ GROOVY-5292 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
          Mark Thomas made changes -
          Workflow jira [ 12734074 ] Default workflow, editable Closed status [ 12745742 ]
          Mark Thomas made changes -
          Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
          Mark Thomas made changes -
          Workflow jira [ 12971469 ] Default workflow, editable Closed status [ 12979261 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Resolved Resolved
          1d 18h 39m 1 Cédric Champeau 30/Nov/11 13:18
          Resolved Resolved Closed Closed
          23d 13h 49m 1 Paul King 24/Dec/11 03:08

            People

            • Assignee:
              Cédric Champeau
              Reporter:
              Fat Zopilot
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development