Advertisement
Guest User

Untitled

a guest
May 28th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. case class Literal(message: String) extends AnyVal
  2.  
  3. object test {
  4.  
  5. val single = new Literal("Coffee")
  6.  
  7. def load = Map[String, Literal](
  8. ("playWithAFriend", Literal("""Jouer avec un(e) ami(e)""")),
  9. ("playWithTheMachine", Literal("""Jouer contre l'ordinateur""")))
  10. }
  11.  
  12. /*
  13. * Compiles to:
  14. *
  15. object test extends Object {
  16. private[this] val single: String = _;
  17. <stable> <accessor> def single(): String = test.this.single;
  18. def load(): scala.collection.immutable.Map = scala.Predef.Map().apply(scala.Predef.wrapRefArray(Array[Tuple2]{new Tuple2("playWithAFriend", new Literal("Jouer avec un(e) ami(e)")), new Tuple2("playWithTheMachine", new Literal("Jouer contre l\'ordinateur"))}.$asInstanceOf[Array[Object]]())).$asInstanceOf[scala.collection.immutable.Map]();
  19. def <init>(): test.type = {
  20. test.super.<init>();
  21. test.this.single = "Coffee";
  22. ()
  23. }
  24. }
  25. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement