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

Adding "return" automatically in nested switch statements

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.9-beta-1, 2.4.0-rc-1
    • 2.5.15, 3.0.8, 4.0.0-alpha-3
    • Compiler
    • None

    Description

      The following does not work. See: http://markmail.org/message/ekm45sghpzh227ga

      assert foo('x1', 'y1') == 'r1'
      def foo(x, y) {
          switch(x) {
              case 'x1':
                  switch(y) {
                      case 'y1':
                          'r1';
                          break;
                      case 'y2':
                          'r2';
                          break;
                  }
          }
      }
      

      Attachments

        Activity

          People

            emilles Eric Milles
            roshandawrani Roshan Dawrani
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: