Created
March 2, 2020 10:16
-
-
Save lrytz/61f6fe3fa98a1ee23815e6301ecc2c0a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ sandbox git:(2.13.x) ~/Applications/bin/scala-runners/scala -212x | |
Welcome to Scala 2.12.11-bin-d1e9ac0 (Java HotSpot(TM) 64-Bit GraalVM EE 19.2.1, Java 1.8.0_231). | |
Type in expressions for evaluation. Or try :help. | |
scala> case class K(var x: Int) | |
defined class K | |
scala> val k = K(1) | |
k: K = K(1) | |
scala> val m = collection.immutable.HashMap(k -> "hi") | |
m: scala.collection.immutable.HashMap[K,String] = Map(K(1) -> hi) | |
scala> val s = m.keySet | |
s: scala.collection.immutable.Set[K] = Set(K(1)) | |
scala> s.hashCode | |
res0: Int = 240826701 | |
scala> k.x = 10 | |
k.x: Int = 10 | |
scala> s.hashCode | |
res1: Int = 240826701 | |
scala> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment