Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-2503 MOP 2.0 design inflluencing issues
  3. GROOVY-1603

positional parameters in constructors behaves like a default constructor

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.0-RC-1
    • None
    • groovy-runtime
    • None

    Description

      class Foo {
      String s
      Foo(s)

      { assert s == null this.s = s }

      }
      def foo = new Foo() // shouldn't call Foo(s) with null!
      assert foo
      assert !foo.s

      See http://www.nabble.com/always-default-constructor--tf2834900.html for more details.

      Attachments

        Activity

          People

            Unassigned Unassigned
            berndschiffer Bernd Schiffer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: