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

Throw exception when assign a class with an expression

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0-JSR-6
    • 1.5
    • None
    • None
    • Groovy 1.0-JSR-6, Sun JDK 1.5.0_06, WinXP Prof

    Description

      Groovy should throw exception in following condition

      A class (not instance) "Foo" already exists. If user try to assign the class with any experssion like below, Groovy should throw Exception. This excpetion make users know they can't assign any expression to an existing class

      class Foo {
      static def p()

      { println "foo"}

      }

      Foo = "bar" //should throws Exception to prevent any further execution

      println Foo // variable "Foo" still link to the class Foo not the String "bar"

      Attachments

        Activity

          People

            paulk Paul King
            ddmanlin Dave Lin
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: