We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0268cb7 commit c15871aCopy full SHA for c15871a
src/test/run-pass/standalone-method.rs
@@ -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
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