Merge pull request #8624 from yallop/pr7865-test

Add a non-regression test for #7865
master
Stephen Dolan 2019-05-01 16:06:54 +01:00 committed by GitHub
commit 2cdf149e32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

View File

@ -10,4 +10,5 @@ pr6123_bad.ml
pr6383.ml
pr6907_bad.ml
self_cannot_be_closed.ml
self_cannot_escape_pr7865.ml
Tests.ml

View File

@ -0,0 +1,21 @@
(* TEST
* expect
*)
class c =
object (o)
method foo = o
end;;
[%%expect {|
class c : object ('a) method foo : 'a end
|}]
class d =
object (o) inherit c
method bar = fun () ->
let o = List.fold_right (fun _ o -> o#foo) [] o in
let o = match () with () -> o in o
end;;
[%%expect {|
class d : object ('a) method bar : unit -> 'a method foo : 'a end
|}]