Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- scala> val x = null
- x: Null = null
- scala> val y: AnyVal = x
- <console>:8: error: type mismatch;
- found : Null
- required: AnyVal
- Note that implicit conversions are not applicable because they are ambiguous:
- both method RichException in object Predef of type (self: Throwable)RichException
- and method augmentString in object Predef of type (x: String)scala.collection.immutable.StringOps
- are possible conversion functions from Null to AnyVal
- val y: AnyVal = x
- ^
- scala> val n = ???
- scala.NotImplementedError: an implementation is missing
- at scala.Predef$.$qmark$qmark$qmark(Predef.scala:225)
- ... 40 elided
- scala> def n = ???
- n: Nothing
- scala> def y: AnyVal = n
- y: AnyVal
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement