Skip to content

Instantly share code, notes, and snippets.

@JoshRosen
JoshRosen / README.md
Last active August 29, 2015 14:08
Scala 2.11.1 SerialVersionUID behavior change

Confusing Scala serialization puzzle

This writeup describes a tricky Scala serialization issue that we ran into while porting Spark to Scala 2.11.

First, let's create a factory that builds anonymous functions:

class FunctionFactory extends Serializable {
  // This method returns a function whose $outer scope is this class.
  // Note that the function does not reference any variables in this scope,