Open
Description
Error: Cannot fully infer type for addError: [T, E](Result[T, E], E) => Result[T, E]
type Result[T, E] {
Success(value: T)
Failure(errors: List[E])
}
def addError[T, E](result: Result[T, E], e: E) =
result match {
case Success(value) => Failure([e]) // also error: Cannot infer type argument T, maybe consider annotating it?
case Failure(errors) => Failure(Cons(e, errors)) // also error: Cannot infer type argument T, maybe consider annotating it?
}
Reproducible both on the website and on v0.25.