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

          Hide
          blackdrag blackdrag 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
          blackdrag blackdrag 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
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Cedric Champeau [ melix ]
          Fix Version/s 2.0-beta-2 [ 18072 ]
          Fix Version/s 1.8.5 [ 18071 ]
          Resolution Fixed [ 1 ]
          Paul King made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Paul King made changes -
          Link This issue is related to GROOVY-5292 [ GROOVY-5292 ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved: