Skip to content

Commit c15871a

Browse files
committed
Test case for issue #435.
1 parent 0268cb7 commit c15871a

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
//xfail-stage0
2+
//xfail-stage1
3+
//xfail-stage2
4+
//xfail-stage3
5+
6+
// Test case for issue #435.
7+
obj foo() {
8+
fn add5(n: int) -> int {
9+
ret n + 5;
10+
}
11+
}
12+
13+
fn add5(n: int) -> int {
14+
ret n + 5;
15+
}
16+
17+
fn main() {
18+
let fiveplusseven = bind add5(7);
19+
assert add5(7) == 12;
20+
assert fiveplusseven() == 12;
21+
22+
let my_foo = foo();
23+
let fiveplusseven_too = bind my_foo.add5(7);
24+
assert my_foo.add5(7) == 12;
25+
assert fiveplusseven_too() == 12;
26+
}
27+

0 commit comments

Comments
 (0)