summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Garrigue <garrigue@math.nagoya-u.ac.jp>2017-09-13 23:15:11 +0900
committerJacques Garrigue <garrigue@math.nagoya-u.ac.jp>2017-09-13 23:15:11 +0900
commit6719cda879d584c37abddf87eaec28fcc69313a2 (patch)
tree093f589541afdf26b126ba9459bf77203d719cb2
parent2546eaea7cf0c91286564d9d491671b9228d76c2 (diff)
downloadocaml-6719cda879d584c37abddf87eaec28fcc69313a2.tar.gz
Revert "Fix PR#7520 (#1328)" as it is not safe in presence of local opens.
This reverts commit 2546eaea7cf0c91286564d9d491671b9228d76c2.
-rw-r--r--Changes3
-rw-r--r--testsuite/tests/typing-gadts/pr7520.ml26
-rw-r--r--typing/parmatch.ml12
3 files changed, 0 insertions, 41 deletions
diff --git a/Changes b/Changes
index 50a4d2f42f..78aa6b2cbc 100644
--- a/Changes
+++ b/Changes
@@ -54,9 +54,6 @@ Working version
when using Flambda.
(Pierre Chambart, review by Mark Shinwell and Leo White)
-- MPR#7520, GPR#1328: Odd behaviour of refutation cases with polymorphic variant
- (Jacques Garrigue, report by Leo White)
-
- MPR#7531, GPR#1162: Erroneous code transformation at partial applications
(Mark Shinwell)
diff --git a/testsuite/tests/typing-gadts/pr7520.ml b/testsuite/tests/typing-gadts/pr7520.ml
deleted file mode 100644
index 6c7dd87d6a..0000000000
--- a/testsuite/tests/typing-gadts/pr7520.ml
+++ /dev/null
@@ -1,26 +0,0 @@
-type ('a, 'b) eq = Refl : ('a, 'a) eq
-type empty = (int, string) eq;;
-[%%expect{|
-type ('a, 'b) eq = Refl : ('a, 'a) eq
-type empty = (int, string) eq
-|}]
-
-let f = function `Foo (_ : empty) -> .;;
-[%%expect{|
-val f : [< `Foo of empty ] -> 'a = <fun>
-|}]
-
-let f : [< `Foo of empty] -> int = function `Foo (_ : empty) -> .;;
-[%%expect{|
-val f : [< `Foo of empty ] -> int = <fun>
-|}]
-
-let f : [`Foo of empty] -> int = function `Foo (_ : empty) -> .;;
-[%%expect{|
-val f : [ `Foo of empty ] -> int = <fun>
-|}]
-
-let f : [< `Foo of empty] -> int = function `Foo (_ : empty) -> . | _ -> .;;
-[%%expect{|
-val f : [ `Foo of empty ] -> int = <fun>
-|}]
diff --git a/typing/parmatch.ml b/typing/parmatch.ml
index ce82d76759..ec8cb6c00d 100644
--- a/typing/parmatch.ml
+++ b/typing/parmatch.ml
@@ -1719,18 +1719,6 @@ module Conv = struct
let constrs = Hashtbl.create 7 in
let labels = Hashtbl.create 7 in
let rec loop pat =
- match pat.pat_extra with (* cf PR#7520 *)
- (extra, _, _) :: extras ->
- let pat = {pat with pat_extra = extras} in
- begin match extra with
- Tpat_constraint ctyp ->
- let mapper = Untypeast.(default_mapper.typ default_mapper) in
- mkpat (Ppat_constraint (loop pat, mapper ctyp))
- | Tpat_open (_, lid, _) ->
- mkpat (Ppat_open (lid, loop pat))
- | _ -> loop pat
- end
- | [] ->
match pat.pat_desc with
Tpat_or (pa,pb,_) ->
mkpat (Ppat_or (loop pa, loop pb))