scalapuzzlers / scalapuzzlers.github.com

Github Pages behind scalapuzzlers.com
www.scalapuzzlers.com
161 stars 53 forks source link

Tweaking the code sample for 'A Case of Equality' #91

Closed demobox closed 10 years ago

demobox commented 10 years ago

Came across this while fixing the code sample to work with 2.11. I think the result is pretty puzzling, to be honest:

scala> println(cc1 == cc2)
In equals
true

scala> println(cc1.## == cc2.##)
true

scala> println(ccd1 == ccd2)
In equals
false

scala> println(ccd1.## == ccd2.##)
true
demobox commented 10 years ago

@nermin @dgruntz: Comments, thoughts, suggestions welcome!

demobox commented 10 years ago

PS: Please do not merge yet - will squash'n'rebase first.

nermin commented 10 years ago

Wish I saw this one earlier, since I already reviewed the puzzler and liked quite a lot the improvement, I see no problem with merging it.