summary refs log tree commit diff
path: root/src/test/auxiliary/issue2378a.rs
blob: b34ba63404ca253846c8c2a238532435d4b41cdc (plain)
1
2
3
4
5
6
7
8
9
10
enum maybe<T> { just(T), nothing }

impl methods<T:copy> for maybe<T> {
    fn ~[](idx: uint) -> T {
        match self {
          just(t) { t }
          nothing { fail; }
        }
    }
}