-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New pattern instrumenter; avoids as-patterns
- Loading branch information
Showing
11 changed files
with
509 additions
and
188 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
Or-pattern instrumentation does not prevent row type generalization. | ||
|
||
$ bash ../test.sh <<'EOF' | ||
> type t = [ `A | `B ] | ||
> module M : | ||
> sig | ||
> val f : [< t ] -> unit | ||
> end = | ||
> struct | ||
> let f = function | ||
> | `A | `B -> () | ||
> end | ||
> EOF | ||
type t = [ `A | `B ] | ||
module M : sig | ||
val f : [< t ] -> unit | ||
end = struct | ||
let f = function | ||
| (`A | `B) as ___bisect_matched_value___ -> | ||
(match[@ocaml.warning "-4-8-9-11-26-27-28-33"] | ||
___bisect_matched_value___ | ||
with | ||
| `A -> | ||
___bisect_visit___ 0; | ||
() | ||
| `B -> | ||
___bisect_visit___ 1; | ||
() | ||
| _ -> ()); | ||
() | ||
end | ||
$ dune build ./test.bc --instrument-with bisect_ppx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
GADT. See https://github.com/aantron/bisect_ppx/issues/325. | ||
|
||
$ bash ../test.sh <<'EOF' | ||
> type _ t = A : unit t | B : bool t | ||
> let f : type a. a t -> unit = fun x -> | ||
> match x with | ||
> | A | B -> () | ||
> EOF | ||
type _ t = A : unit t | B : bool t | ||
let f : type a. a t -> unit = | ||
fun x -> | ||
___bisect_visit___ 2; | ||
match x with | ||
| ___bisect_matched_value___ -> ( | ||
match ___bisect_matched_value___ with | ||
| A | B -> | ||
(match[@ocaml.warning "-4-8-9-11-26-27-28-33"] | ||
___bisect_matched_value___ | ||
with | ||
| A -> | ||
___bisect_visit___ 0; | ||
() | ||
| B -> | ||
___bisect_visit___ 1; | ||
() | ||
| _ -> ()); | ||
()) | ||
$ dune build ./test.bc --instrument-with bisect_ppx | ||
With function. | ||
$ bash ../test.sh <<'EOF' | ||
> type _ t = A : unit t | B : bool t | ||
> let f : type a. a t -> unit = function | ||
> | A | B -> () | ||
> EOF | ||
type _ t = A : unit t | B : bool t | ||
let f : type a. a t -> unit = | ||
fun ___bisect_matched_value___ -> | ||
match ___bisect_matched_value___ with | ||
| A | B -> | ||
(match[@ocaml.warning "-4-8-9-11-26-27-28-33"] | ||
___bisect_matched_value___ | ||
with | ||
| A -> | ||
___bisect_visit___ 0; | ||
() | ||
| B -> | ||
___bisect_visit___ 1; | ||
() | ||
| _ -> ()); | ||
() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.