Advertisement
Guest User

Untitled

a guest
Jan 29th, 2015
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. scala> val x = null
  2. x: Null = null
  3.  
  4. scala> val y: AnyVal = x
  5. <console>:8: error: type mismatch;
  6. found : Null
  7. required: AnyVal
  8. Note that implicit conversions are not applicable because they are ambiguous:
  9. both method RichException in object Predef of type (self: Throwable)RichException
  10. and method augmentString in object Predef of type (x: String)scala.collection.immutable.StringOps
  11. are possible conversion functions from Null to AnyVal
  12. val y: AnyVal = x
  13. ^
  14.  
  15. scala> val n = ???
  16. scala.NotImplementedError: an implementation is missing
  17. at scala.Predef$.$qmark$qmark$qmark(Predef.scala:225)
  18. ... 40 elided
  19.  
  20. scala> def n = ???
  21. n: Nothing
  22.  
  23. scala> def y: AnyVal = n
  24. y: AnyVal
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement