PageRenderTime 6ms CodeModel.GetById 2ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/src/test/run-pass/generic-tag-values.rs

http://github.com/jruderman/rust
Rust | 19 lines | 14 code | 4 blank | 1 comment | 3 complexity | d4efcf1c3295002273e6555ad86a4c49 MD5 | raw file
 1
 2
 3
 4// -*- rust -*-
 5enum noption<T> { some(T), }
 6
 7fn main() {
 8    let nop: noption<int> = some::<int>(5);
 9    match nop { some::<int>(n) => { log(debug, n); assert (n == 5); } }
10    let nop2: noption<{x: int, y: int}> = some({x: 17, y: 42});
11    match nop2 {
12      some(t) => {
13        log(debug, t.x);
14        log(debug, t.y);
15        assert (t.x == 17);
16        assert (t.y == 42);
17      }
18    }
19}