groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel.Sun" <realblue...@hotmail.com>
Subject Re: An issue about comparing arrays
Date Wed, 02 Nov 2016 23:51:32 GMT
IMO, we should compare their type first. If not same, the comparing result should be 'false'.

Cheers,
Daniel.Sun



在 "bo zhang [via Groovy]" <ml-node+s329449n5736458h56@n5.nabble.com>,2016年11月3日
06:53写道:

I'm afraid it's not a bug.

Actually, `def a=new int[2][]` means that a is an array of two null pointers with type "int
[]", and `def b=new int[2][][]` means that b is an array of two null pointers with type "int[][]",
it seems that they should be equal.

See https://github.com/groovy/groovy-core/blob/master/src/test/groovy/ArrayTest.groovy#L198

[http://groovy.329449.n5.nabble.com/attachment/5736458/0/QQ20161103-0%402x.png]
​

2016-10-30 18:50 GMT+08:00 Daniel.Sun <[hidden email]>:
Hi Jochen,

     I create JIRA issue
GROOVY-7983(https://issues.apache.org/jira/browse/GROOVY-7983) to track the
issue.

     BTW,  the code in the email should be corrected as follow:

def a = new int[2][]
def b = new int[2][][]
assert a == b // expect faling

Cheers,
Daniel.Sun



--
View this message in context: http://groovy.329449.n5.nabble.com/An-issue-about-comparing-arrays-tp5736379p5736398.html
Sent from the Groovy Dev mailing list archive at Nabble.com.



________________________________
If you reply to this email, your message will be added to the discussion below:
http://groovy.329449.n5.nabble.com/An-issue-about-comparing-arrays-tp5736379p5736458.html
To unsubscribe from An issue about comparing arrays, click here<http://groovy.329449.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5736379&code=cmVhbGJsdWVzdW5AaG90bWFpbC5jb218NTczNjM3OXwxMTQ2MjE4MjI1>.
NAML<http://groovy.329449.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>




--
View this message in context: http://groovy.329449.n5.nabble.com/An-issue-about-comparing-arrays-tp5736379p5736460.html
Sent from the Groovy Dev mailing list archive at Nabble.com.
Mime
View raw message