2012-06-25 22:00:46 -05:00
|
|
|
impl extensions<T> for [const T]/~ {
|
2012-03-16 18:49:11 -05:00
|
|
|
fn foo() -> uint { vec::len(self) }
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2012-06-25 22:00:46 -05:00
|
|
|
let v = [const 0]/~;
|
2012-03-16 18:49:11 -05:00
|
|
|
assert v.foo() == 1u;
|
2012-06-25 22:00:46 -05:00
|
|
|
let v = [0]/~;
|
2012-03-16 18:49:11 -05:00
|
|
|
assert v.foo() == 1u;
|
2012-06-25 22:00:46 -05:00
|
|
|
let v = [mut 0]/~;
|
2012-03-16 18:49:11 -05:00
|
|
|
assert v.foo() == 1u;
|
|
|
|
}
|