File tree Expand file tree Collapse file tree 2 files changed +40
-1
lines changed Expand file tree Collapse file tree 2 files changed +40
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
- refs/heads/master: 0cbcf9274933af28998c2141e82f30246e380dc3
2
+ refs/heads/master: 867e9fb03099274229a4fd7031541d7e1f9b0dc9
Original file line number Diff line number Diff line change
1
+ // xfail-boot
2
+ fn main ( ) {
3
+
4
+ obj foo ( mutable int i) {
5
+ fn inc_by ( int incr ) -> int {
6
+ i += incr;
7
+ ret i;
8
+ }
9
+
10
+ fn inc_by_5 ( ) -> int {
11
+ ret self . inc_by ( 5 ) ;
12
+ }
13
+
14
+ // A test case showing that issue #324 is resolved. (It used to
15
+ // be that commenting out this (unused!) function produced a
16
+ // type error.)
17
+ // fn wrapper(int incr) -> int {
18
+ // ret self.inc_by(incr);
19
+ // }
20
+
21
+ fn get ( ) -> int {
22
+ ret i;
23
+ }
24
+ }
25
+
26
+ let int res;
27
+ auto o = foo ( 5 ) ;
28
+
29
+ res = o. get ( ) ;
30
+ assert ( res == 5 ) ;
31
+
32
+ res = o. inc_by ( 3 ) ;
33
+ assert ( res == 8 ) ;
34
+
35
+ res = o. get ( ) ;
36
+ assert ( res == 8 ) ;
37
+
38
+ }
39
+
You can’t perform that action at this time.
0 commit comments