518dc52f85
This changes the indexing syntax from .() to [], the vector syntax from ~[] to [] and the extension syntax from #fmt() to #fmt[]
18 lines
365 B
Rust
18 lines
365 B
Rust
|
|
|
|
fn main() {
|
|
// Testcase for issue #59.
|
|
|
|
obj simple(x: int, y: int) {
|
|
fn sum() -> int { ret x + y; }
|
|
}
|
|
let obj0 = simple(1, 2);
|
|
let ctor0 = bind simple(1, _);
|
|
let ctor1 = bind simple(_, 2);
|
|
let obj1 = ctor0(2);
|
|
let obj2 = ctor1(1);
|
|
assert (obj0.sum() == 3);
|
|
assert (obj1.sum() == 3);
|
|
assert (obj2.sum() == 3);
|
|
}
|