2011-08-30 16:21:00 -07:00
|
|
|
// Tests that the typechecker checks constraints
|
2011-12-28 13:41:31 -08:00
|
|
|
// error-pattern:mismatched types: expected `uint` but found `u8`
|
2011-08-30 16:21:00 -07:00
|
|
|
use std;
|
2011-12-13 16:25:51 -08:00
|
|
|
import uint;
|
2011-08-30 16:21:00 -07:00
|
|
|
|
2011-09-02 15:34:58 -07:00
|
|
|
fn enum_chars(start: u8, end: u8) : uint::le(start, end) -> [char] {
|
2011-08-30 16:21:00 -07:00
|
|
|
let i = start;
|
|
|
|
let r = [];
|
2011-09-02 15:34:58 -07:00
|
|
|
while i <= end { r += [i as char]; i += 1u as u8; }
|
2011-08-30 16:21:00 -07:00
|
|
|
ret r;
|
|
|
|
}
|
|
|
|
|
2011-12-22 17:53:53 -08:00
|
|
|
fn main() { log(debug, enum_chars('a' as u8, 'z' as u8)); }
|