Skip to content

Ill-typed base expression in index #1733

Closed
@eholk

Description

@eholk

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions