Code:
class Box<T> {
}
enum Result<T, U> {
case Success(Box<T>)
case Failure(Box<U>)
func then<V>(nextOperation: T -> Result<V, U>) -> Result<V, U> {
return .Success(Box<V>())
}
}
This code causes the compiler to crash with “Internal error: Object reference not set to an instance of object”.