import class Range from range; import fn { iterator, next, is_consumed } from range; fn sum(r: Range) -> Int { let res: Int = 0; for i in *r { res = res + i; } return *res; } let r: Range = Range(0, 0, 10); iterator(*r); next(r); is_consumed(r); if sum(Range(0, 0, 101)) != 5050 { panic("Invalid result"); }