Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- scala
- Welcome to Scala version 2.11.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_25).
- Type in expressions to have them evaluated.
- Type :help for more information.
- scala> implicit val x = 1 // show
- object $read extends scala.AnyRef {
- def <init>() = {
- super.<init>;
- ()
- };
- object $iw extends scala.AnyRef {
- def <init>() = {
- super.<init>;
- ()
- };
- object $iw extends scala.AnyRef {
- def <init>() = {
- super.<init>;
- ()
- };
- implicit val x = 1
- }
- }
- }
- x: Int = 1
- scala> val x = 2 // show
- object $read extends scala.AnyRef {
- def <init>() = {
- super.<init>;
- ()
- };
- object $iw extends scala.AnyRef {
- def <init>() = {
- super.<init>;
- ()
- };
- import $line3.$read.$iw.$iw.x;
- object $iw extends scala.AnyRef {
- def <init>() = {
- super.<init>;
- ()
- };
- val x = 2
- }
- }
- }
- x: Int = 2
- scala> implicitly[Int] // show
- object $read extends scala.AnyRef {
- def <init>() = {
- super.<init>;
- ()
- };
- object $iw extends scala.AnyRef {
- def <init>() = {
- super.<init>;
- ()
- };
- import $line3.$read.$iw.$iw.x;
- object $iw extends scala.AnyRef {
- def <init>() = {
- super.<init>;
- ()
- };
- val res0 = implicitly[Int]
- }
- }
- }
- res0: Int = 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement