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

Numbers as properties in command expressions

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8-rc-3
    • Fix Version/s: 2.6.0-alpha-1
    • Component/s: parser
    • Labels:
      None

      Description

      It is allowed not to surround numbers with quotes in command expressions if they are used as properties.
      Is it bug or feature?

      def get123() {2}
      def foo(i) {this}
      
      def a = foo(2).'123'
      def b = foo 2   123
      
      println a
      println b
      

      But if you rename get123() to get123a() the line will throw an exception.

      def b = foo 2   123a
      

        Attachments

          Activity

            People

            • Assignee:
              daniel_sun Daniel Sun
              Reporter:
              mxm-groovy Maxim Medvedev
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: