mozilla/rust — Issue #1733: Ill-typed base expression in index
Author: eholk
Created: 2012-02-02 06:19:18+00:00
State: open
Labels: bug

Below is a sample program. Without the `*@` on line 19, rustc complains, saying `error: internal compiler error Ill-typed base expression in index`.

```
use std;

iface vector {
fn [](i: uint) -> float;
fn len() -> uint;
}

impl vector_utils for vector {
fn print() {
std::io::print("[ ");
self.each() {|x|
std::io::print(float::to_str(x, 10u) + " ");
};
std::io::println("]");
}

fn each(f: fn(float)) {
uint::range(0u, self.len()) {|i|
f(*@self[i])
}
}
}
```