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

Misleading error message when accessing non-static members from static functions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-beta-10
    • 1.0-JSR-2
    • None
    • None

    Description

      The following class:

      class test {
      Integer x = null

      static void main(String[] args)

      { // Can't access non-static class member is static funciton x = new Integer(5) }

      }

      Throws a NullPointerException, rather than something indicating that we're trying to access a non-static member in a static function. Or should it create a local variable?

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            mcspanky Martin C. Martin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: