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

Throw exception when assign a class with an expression

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0-JSR-6
    • Fix Version/s: 1.5
    • Component/s: None
    • Labels:
      None
    • Environment:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: