// error-pattern: overly deep expansion // issue 2258 iface to_opt { fn to_option() -> option; } impl of to_opt for uint { fn to_option() -> option { some(self) } } impl of to_opt for option { fn to_option() -> option> { some(self) } } fn function(counter: uint, t: T) { if counter > 0u { function(counter - 1u, t.to_option()); } } fn main() { function(22u, 22u); }