Eric Milles created GROOVY-10722:
------------------------------------

             Summary: AIC via array-based (variadic) constructor null and array 
arguments
                 Key: GROOVY-10722
                 URL: https://issues.apache.org/jira/browse/GROOVY-10722
             Project: Groovy
          Issue Type: Bug
            Reporter: Eric Milles


Follow up from GROOVY-7370. Consider the following:
{code:groovy}
class C {
  C(String... args) {
    strings = args
  }
  public String[] strings
}
def x = new C(null) { }
assert x.strings == null
def y = new String[0]
def z = new C( y ) { }
assert z.strings.length == 0
{code}

7370 handles no arguments for array and more than one.  Passing null is 
supposed to set the array to null, not pass an array with one null element.  
Passing an array through an untyped variable is also a problem.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to