You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
scala> (newArray[Unit](5))(0) == ()
<console>:10:warning: comparing values of types Unit and Unit using `==' will always yield true
(newArray[Unit](5))(0) == ()
^
res16:Boolean=false
scala> (newArray[Unit](5))(0) ==null
<console>:10:warning: comparing values of types Unit and Null using `==' will always yield false
(newArray[Unit](5))(0) ==null
^
res17:Boolean=true
scala> {vala=Array.fill(5)(()); a(0) == ()}
<console>:11:warning: comparing values of types Unit and Unit using `==' will always yield true
{vala=Array.fill(5)(()); a(0) == ()}
^
res18:Boolean=true
=== What is the expected behavior? ===
There shouldn't be a difference between the first and the third example (assignment prior to comparison).
The compiler warning shouldn't contradict the actual result
Looking for () in an Array[Unit] should return true, not false
Looking for null in an Array[Unit] should return false, not true
=== What do you see instead? ===
Weirdness.
=== Additional information ===
This is probably related #4510.
=== What versions of the following are you using? ===
Scala: 2.10.0.r24908-b20110508020204
The text was updated successfully, but these errors were encountered:
=== What steps will reproduce the problem? ===
=== What is the expected behavior? ===
There shouldn't be a difference between the first and the third example (assignment prior to comparison).
The compiler warning shouldn't contradict the actual result
Looking for () in an Array[Unit] should return true, not false
Looking for null in an Array[Unit] should return false, not true
=== What do you see instead? ===
Weirdness.
=== Additional information ===
This is probably related #4510.
=== What versions of the following are you using? ===
The text was updated successfully, but these errors were encountered: