| 1 | module module_with_deprecated_structs |
| 2 | |
| 3 | pub struct Xyz { |
| 4 | pub mut: |
| 5 | a int |
| 6 | b int @[deprecated] |
| 7 | c int @[deprecated: 'c use Xyz.a instead'; deprecated_after: '2021-03-01'] |
| 8 | d int @[deprecated: 'd use Xyz.a instead'; deprecated_after: '2999-03-01'] |
| 9 | } |
| 10 | |
| 11 | @[deprecated: 'use New instead'] |
| 12 | @[deprecated_after: '2021-03-01'] |
| 13 | pub struct Old {} |
| 14 | |
| 15 | @[deprecated: 'use Future instead'] |
| 16 | @[deprecated_after: '2999-03-01'] |
| 17 | pub struct Present {} |
| 18 | |
| 19 | fn some_internal_function() { |
| 20 | mut x := Xyz{} // initialisation; no error |
| 21 | mut o := Old{} |
| 22 | mut p := Present{} |
| 23 | |
| 24 | // reads: |
| 25 | dump(x.a) // no error |
| 26 | dump(x.b) // no error internally |
| 27 | dump(x.c) // no error internally |
| 28 | dump(x.d) // no error internally |
| 29 | dump(o) // no error internally |
| 30 | dump(p) // no error internally |
| 31 | |
| 32 | // writes: |
| 33 | x.a = 1 // no error |
| 34 | x.b = 1 // no error internally |
| 35 | x.c = 1 // no error internally |
| 36 | x.d = 1 // no error internally |
| 37 | } |
| 38 | |