Skip to content

regression in result of null.## (when wrapped by a Value Class) #7396

@scabug

Description

@scabug

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.


scala> null.##
res0: Int = 0

scala> (null: Predef.Ensuring[_]).##
java.lang.NullPointerException
	at scala.Predef$Ensuring$.hashCode$extension(Predef.scala:236)
	at scala.Predef$Ensuring.hashCode(Predef.scala:236)
	at scala.runtime.ScalaRunTime$.hash(ScalaRunTime.scala:214)
	at .<init>(<console>:7)
	at .<clinit>(<console>)
	at .<init>(<console>:7)
	at .<clinit>(<console>)
	at $print(<console>)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions