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

    Details

    • Type: Sub-task
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.0-RC-1
    • Fix Version/s: None
    • Component/s: groovy-runtime
    • Labels:
      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

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

              Dates

              • Created:
                Updated: