Advertisement
Guest User

Untitled

a guest
May 27th, 2015
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. scala
  2. Welcome to Scala version 2.11.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_25).
  3. Type in expressions to have them evaluated.
  4. Type :help for more information.
  5.  
  6. scala> implicit val x = 1 // show
  7. object $read extends scala.AnyRef {
  8. def <init>() = {
  9. super.<init>;
  10. ()
  11. };
  12. object $iw extends scala.AnyRef {
  13. def <init>() = {
  14. super.<init>;
  15. ()
  16. };
  17. object $iw extends scala.AnyRef {
  18. def <init>() = {
  19. super.<init>;
  20. ()
  21. };
  22. implicit val x = 1
  23. }
  24. }
  25. }
  26. x: Int = 1
  27.  
  28. scala> val x = 2 // show
  29. object $read extends scala.AnyRef {
  30. def <init>() = {
  31. super.<init>;
  32. ()
  33. };
  34. object $iw extends scala.AnyRef {
  35. def <init>() = {
  36. super.<init>;
  37. ()
  38. };
  39. import $line3.$read.$iw.$iw.x;
  40. object $iw extends scala.AnyRef {
  41. def <init>() = {
  42. super.<init>;
  43. ()
  44. };
  45. val x = 2
  46. }
  47. }
  48. }
  49. x: Int = 2
  50.  
  51. scala> implicitly[Int] // show
  52. object $read extends scala.AnyRef {
  53. def <init>() = {
  54. super.<init>;
  55. ()
  56. };
  57. object $iw extends scala.AnyRef {
  58. def <init>() = {
  59. super.<init>;
  60. ()
  61. };
  62. import $line3.$read.$iw.$iw.x;
  63. object $iw extends scala.AnyRef {
  64. def <init>() = {
  65. super.<init>;
  66. ()
  67. };
  68. val res0 = implicitly[Int]
  69. }
  70. }
  71. }
  72. res0: Int = 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement