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

Type Checking Bypassed in Default Constructor

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-beta-10
    • 1.0-JSR-1
    • None
    • None
    • Win XP - Jdk 1.5

    Description

      I am getting some inconsistencies with type checking. Why does this code throw an exception:

      p = new Person()
      p.name="Dave Ford"
      p.age="eee"

      But this code doesn't:

      p = new Person(name:"Dave Ford",age:"ee")

      Here is the class I'm using:

      class Person {
      String name
      Integer age
      }

      Attachments

        Activity

          People

            phkim Kim, Pilho
            dford@smart-soft.com Dave Ford
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: