blob: a5ea5a75de3e3354e51cb89a16b3091d615a35f0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
impl extensions<T> for ~[const T] {
fn foo() -> uint { vec::len(self) }
}
fn main() {
let v = ~[const 0];
assert v.foo() == 1u;
let v = ~[0];
assert v.foo() == 1u;
let v = ~[mut 0];
assert v.foo() == 1u;
}
|