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

Groovy compiler allows local variables to be marked static

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.6.4, 1.7-beta-1
    • 1.6.5, 1.7-beta-2
    • None
    • None

    Description

      Groovy compiler does not complain when local variables are marked as static, as can be seen in the code below:

      Script1.groovy

              	static int x = 3
      

      Script2.groovy

              	def m() {
      	            static int x = 3
              	}
      

      Script3.groovy

              	class Test {
      	            def m() {
      	                static int x = 3
      	            }
              	}
      

      Issue reported on the mailing list in the following conversation: http://www.nabble.com/spread-code-to-multible-SourceFiles-td25500828.html

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: