Guest User

Untitled

a guest
Nov 19th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. trait MyWrapperBound {
  2. val message: String
  3. }
  4.  
  5. def wrap[T <: MyWrapperBound](message: String): T
  6.  
  7. def wrap[T <: MyWrapperBound](message: String)(implicit factory: String => T): T
  8.  
  9. case class SimpleBound(message: String) extends MyWrapperBound
  10.  
  11. object SimpleBound {
  12. implicit def factory(message: String): SimpleBound = SimpleBound(message)
  13. }
  14.  
  15. def wrap[T <: MyWrapperBound](message: String)(implicit factory: String => T): T = macro ...
Add Comment
Please, Sign In to add comment