Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.6-beta-1
    • Fix Version/s: 4.0
    • Component/s: None
    • Labels:
      None

      Description

      Please look a the attached file. I think it reveals a couple of problems with the Groovy syntax parser and Groovy's runtime behaviour.

      However, I don't know if the spec makes any restrictions on the placement of curly braces.

        Activity

        Alexander Veit created issue -
        Hide
        Jochen Theodorou added a comment -

        that

        		case 'return labelled closure': // compiles (should it?)
        
        			return
        
        			label: { // either unreachable or a 'labelled' closure
        
        				x ->
        
        				condition + ': was here'
        
        			}
        
        			break

        compiles is ok, it is still a closure, but the place it is defined is labeled... well.. something we do not need, but it is more complicated to forbid that.

        as for

        			{
        
        				x ->
        
        				println condition + ': was here'
        
        			}.call(condition)
        
        			break

        I am not sure why this does not compile... probably missing whitespace eating...

        None of these issues are special to switch-case, they should happen like this anywhere in the code.

        Show
        Jochen Theodorou added a comment - that case ' return labelled closure': // compiles (should it?) return label: { // either unreachable or a 'labelled' closure x -> condition + ': was here' } break compiles is ok, it is still a closure, but the place it is defined is labeled... well.. something we do not need, but it is more complicated to forbid that. as for { x -> println condition + ': was here' }.call(condition) break I am not sure why this does not compile... probably missing whitespace eating... None of these issues are special to switch-case, they should happen like this anywhere in the code.
        Jochen Theodorou made changes -
        Field Original Value New Value
        Assignee Jochen Theodorou [ blackdrag ]
        Fix Version/s 1.6-beta-2 [ 14261 ]
        Fix Version/s 1.5.7 [ 14242 ]
        Guillaume Delcroix made changes -
        Fix Version/s 1.5.7 [ 14242 ]
        Fix Version/s 1.6-beta-2 [ 14261 ]
        Fix Version/s 1.5.8 [ 14630 ]
        Guillaume Delcroix made changes -
        Fix Version/s 1.6.2 [ 15151 ]
        Fix Version/s 1.5.8 [ 14630 ]
        Guillaume Delcroix made changes -
        Fix Version/s 1.6.3 [ 15251 ]
        Fix Version/s 1.6.2 [ 15151 ]
        Guillaume Delcroix made changes -
        Fix Version/s 1.7-beta-1 [ 14014 ]
        Fix Version/s 1.6.3 [ 15251 ]
        Guillaume Delcroix made changes -
        Fix Version/s 1.7-beta-x [ 15538 ]
        Fix Version/s 1.7-beta-1 [ 14014 ]
        Jochen Theodorou made changes -
        Issue Type Bug [ 1 ] Sub-task [ 7 ]
        Parent GROOVY-4683 [ 122027 ]
        Jochen Theodorou made changes -
        Issue Type Sub-task [ 7 ] Bug [ 1 ]
        Parent GROOVY-4683 [ 122027 ]
        Jochen Theodorou made changes -
        Fix Version/s 1.7.x [ 15538 ]
        Fix Version/s 1.8.x [ 15750 ]
        Jochen Theodorou made changes -
        Fix Version/s 1.8.x [ 15750 ]
        Fix Version/s 4.0 [ 18928 ]
        Hide
        Jochen Theodorou added a comment -

        setting 4.0 as version for the grammar change

        Show
        Jochen Theodorou added a comment - setting 4.0 as version for the grammar change
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
        Mark Thomas made changes -
        Workflow jira [ 12731954 ] Default workflow, editable Closed status [ 12743798 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
        Mark Thomas made changes -
        Workflow jira [ 12969895 ] Default workflow, editable Closed status [ 12977648 ]
        Jochen Theodorou made changes -
        Assignee Jochen Theodorou [ blackdrag ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Alexander Veit
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development