Source

ocaml / testsuite / tests / typing-gadts / pr5689.ml.reference


#               type inkind = [ `Link | `Nonlink ]
type _ inline_t =
    Text : string -> [< inkind > `Nonlink ] inline_t
  | Bold : 'a inline_t list -> 'a inline_t
  | Link : string -> [< inkind > `Link ] inline_t
  | Mref : string *
      [ `Nonlink ] inline_t list -> [< inkind > `Link ] inline_t
#                 val uppercase : 'a inline_t list -> 'a inline_t list = <fun>
#             type ast_t =
    Ast_Text of string
  | Ast_Bold of ast_t list
  | Ast_Link of string
  | Ast_Mref of string * ast_t list
#                         val inlineseq_from_astseq : ast_t list -> inkind inline_t list = <fun>
#           type _ linkp = Nonlink : [ `Nonlink ] linkp | Maylink : inkind linkp
#                           val inlineseq_from_astseq : ast_t list -> inkind inline_t list = <fun>
#       type _ linkp2 = Kind : 'a linkp -> ([< inkind ] as 'a) linkp2
#                         Characters 272-279:
      | (Kind Maylink, Ast_Link lnk)    -> Link lnk
              ^^^^^^^
Error: This pattern matches values of type inkind linkp
       but a pattern was expected which matches values of type
         ([< inkind ] as 'a) linkp
       Type inkind = [ `Link | `Nonlink ] is not compatible with type
         'a = [< `Link | `Nonlink ] 
       Types for tag `Nonlink are incompatible
#