d2d42fd4c7
I think just about every type can be used as a block result now. There's quite a proliferation of tests here, but they all test slightly different things and some are split out to remain XFAILed. The tests of generic vectors are still XFAILed because generic aliased boxes still don't work in general.
27 lines
453 B
Rust
27 lines
453 B
Rust
// xfail-boot
|
|
// xfail-stage0
|
|
// -*- rust -*-
|
|
|
|
type compare[T] = fn(&T t1, &T t2) -> bool;
|
|
|
|
fn test_generic[T](&T expected, &compare[T] eq) {
|
|
let T actual = alt (true) {
|
|
case (true) {
|
|
expected
|
|
}
|
|
};
|
|
check (eq(expected, actual));
|
|
}
|
|
|
|
fn test_vec() {
|
|
fn compare_vec(vec[int] v1, vec[int] v2) -> bool {
|
|
ret v1 == v2;
|
|
}
|
|
auto eq = bind compare_vec(_, _);
|
|
test_generic[vec[int]](vec(1, 2, 3), eq);
|
|
}
|
|
|
|
fn main() {
|
|
test_vec();
|
|
}
|