Skip to content
This repository has been archived by the owner on Feb 20, 2019. It is now read-only.

Add pickler and unpickler for Nothing #433

Merged
merged 1 commit into from
Jun 1, 2016

Conversation

jvican
Copy link
Member

@jvican jvican commented Jun 1, 2016

  • Add picklers for Nothing, pickle cannot be actually called. Reuse
    FastTypeTag[Nothing], which was already defined. Include the
    picklers in Defaults.
  • Add error in case the unpickle method is called.
  • Remove annoying println in test NullBinaryTest.

 * Add picklers for Nothing, `pickle` cannot be actually called. Reuse
  `FastTypeTag[Nothing]`, which was already defined. Include the
  picklers in `Defaults`.

* Add error in case the `unpickle` method is called.

* Remove annoying println in test `NullBinaryTest`.
@@ -178,4 +178,8 @@ object PicklingErrors {
final case class Wrapper(e: Throwable, msg: String, delimiter: String = "\n")
extends BasePicklingException(s"$msg$delimiter${e.getMessage}", Some(e))

/** Exception thrown when one tries to unpickle on a Unpickler[Nothing]. */
case object NothingIsNotUnpicklable extends PicklingRuntimeException(
s"You called `unpickle` on `Unpickler[Nothing]`, but it cannot be unpickled")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we're throwing an exception, so you know we returned nothing :)

@jsuereth
Copy link
Contributor

jsuereth commented Jun 1, 2016

So besides the fact I think we should try to statically catch piclking nothign and issue an error, this looks good.

@jsuereth jsuereth merged commit dfecf1c into scala:0.11.x Jun 1, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants