Closed
Description
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])
}
}
}
Metadata
Metadata
Assignees
Labels
No labels