28 Dec
2007
28 Dec
'07
4:41 p.m.
Isaac wrote:
I wonder whether it would be safe for the compiler to infer simply by the default methods mentioning each other in a cycle. It might miss some cases when (probably involving laziness) the default methods actually terminate and form an intended set of implemention, and warn when it shouldn't... which is bad, but does that ever happen?
"mentioning each other in a cycle" is too imprecise unfortunately at least for two reasons: a) we could face a well-designed mutual recursion. b) we could face co-induction. The ultimate solution is to extend type signatures by termination requirements and to have a termination checker enforcing them. For instance, Andreas Abel has done groundbreaking work on termination checking. Cheers, Ralf