summaryrefslogtreecommitdiffstats
path: root/testsuite/tests/typing-objects/pr5619_bad.ml.reference
blob: 48777229ce53e6541365c026569878c67a7cd02a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

#                 class type foo_t = object method foo : string end
type 'a name = Foo : foo_t name | Int : int name
#                   class foo :
  object method cast : foo_t name -> < foo : string > method foo : string end
#                   Characters 22-184:
  ..object(self)
      method foo = "foo"
      method cast: type a. a name -> a =
        function
            Foo -> (self :> foo_t)
          | _ -> ((raise Exit) : a)
    end
Error: The class type
         object method cast : 'a name -> 'a method foo : string end
       is not matched by the class type foo_t
       The public method cast cannot be hidden
#