Le prolbem est que je voudrais que cette fonction retourne la valeur de l'option (sous la forme de Option [None]) ou Option [quelque chose], mais elle ne renvoie qu'une unité. Qu'est-ce que je rate?Scala retournant la valeur de l'option
def intersection(another: Interval){
var test: Option[Interval] = None
if (this.isLaterThan(another) || another.isLaterThan(this)){
test
}
else {
val a = this.start.later(another.start)
val b = this.end.earlier(another.end)
test=Some(new Interval(a, b))
test
}