Some people claim that scala can deal with recursive structural types if you use the -Yrecursion option for scalac. However, my minimalist example does not compile:
type Num = {
def +(n: Num): Num
}
Compilation output:
$ scalac -version
Scala compiler version 2.8.0.final -- Copyright 2002-2010, LAMP/EPFL
$ scalac -Yrecursion 100 Num.scala
Num.scala:3: error: recursive method + needs result type
def +(n: Num): Num
^
one error found
Has this changed? Should I compile an example?
source
share