New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
regression in result of null.## (when wrapped by a Value Class) #7396
Comments
Imported From: https://issues.scala-lang.org/browse/SI-7396?orig=1 |
@retronym said: I'm running tests now, so perhaps the reasons will dawn on me soon, but I would have thought we could just call https://github.com/retronym/scala/compare/ticket/7396 scala> class Foo(val a: Any) extends AnyVal
defined class Foo
scala> implicit class Foo(val a: Any) extends AnyVal
defined class Foo
scala> (null: Foo).##
res0: Int = 0 |
@retronym said:
|
@retronym said: scala> 1d.hashCode
res0: Int = 1072693248
scala> 1d.##
res1: Int = 1 |
@paulp said: The problem is that it isn't correct. hashCode has different behavior than ##. As you discovered. |
@retronym said (edited on May 29, 2013 12:46:47 PM UTC):
|
@dwijnand said: |
@dwijnand said: scala> 1d.hashCode
res0: Int = 1072693248
scala> 1d.##
res1: Int = 1
scala> class Foo(val x: Double) extends AnyVal
defined class Foo
scala> new Foo(1d).hashCode
res2: Int = 1072693248
scala> new Foo(1d).##
res3: Int = 1072693248 (Also, is it part of this ticket, or a separate issue?) |
Nevertheless this bug is completely breaking some methods in collection library.
Is it part of this ticket, or a separate issue? Is it possible to change SIP 15 specification something like:
|
As you can see in #4311, null.## is supposed to be 0 and not an NPE. And it is, right up until extension methods get involved.
The text was updated successfully, but these errors were encountered: