| 1 |
Trivial. |
| 2 |
|
| 3 |
$ bash ../test.sh <<'EOF' |
| 4 |
> class foo = |
| 5 |
> object |
| 6 |
> end |
| 7 |
> EOF |
| 8 |
class foo = object end |
| 9 |
|
| 10 |
|
| 11 |
Parameters are preserved. |
| 12 |
|
| 13 |
$ bash ../test.sh <<'EOF' |
| 14 |
> class foo_1 () = |
| 15 |
> object |
| 16 |
> end |
| 17 |
> class foo_2 ~l:_ = |
| 18 |
> object |
| 19 |
> end |
| 20 |
> class foo_3 ?l:_ () = |
| 21 |
> object |
| 22 |
> end |
| 23 |
> EOF |
| 24 |
class foo_1 () = object end |
| 25 |
|
| 26 |
class foo_2 ~l:_ = object end |
| 27 |
|
| 28 |
class foo_3 ?l:_ () = object end |
| 29 |
|
| 30 |
|
| 31 |
Default values are instrumented, and instrumented recursively. |
| 32 |
|
| 33 |
$ bash ../test.sh <<'EOF' |
| 34 |
> [@@@ocaml.warning "-27"] |
| 35 |
> class foo ?(l = fun () -> ()) () = |
| 36 |
> object |
| 37 |
> end |
| 38 |
> EOF |
| 39 |
[@@@ocaml.warning "-27"] |
| 40 |
|
| 41 |
class foo |
| 42 |
?(l = |
| 43 |
___bisect_visit___ 1; |
| 44 |
fun () -> |
| 45 |
___bisect_visit___ 0; |
| 46 |
()) () = object end |
| 47 |
|
| 48 |
|
| 49 |
Nested expressions and initializers instrumented. |
| 50 |
|
| 51 |
$ bash ../test.sh <<'EOF' |
| 52 |
> class foo = |
| 53 |
> let () = print_endline "bar" in |
| 54 |
> object |
| 55 |
> initializer print_endline "baz" |
| 56 |
> end |
| 57 |
> EOF |
| 58 |
class foo = |
| 59 |
let () = ___bisect_post_visit___ 0 (print_endline "bar") in |
| 60 |
object |
| 61 |
initializer |
| 62 |
___bisect_visit___ 2; |
| 63 |
___bisect_post_visit___ 1 (print_endline "baz") |
| 64 |
end |