caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Leo White <leo@lpw25.net>
To: caml-list@inria.fr
Subject: Re: [Caml-list] polymorphic methods
Date: Fri, 18 Dec 2015 05:07:44 -0500	[thread overview]
Message-ID: <1450433264.2682694.470896145.4144D923@webmail.messagingengine.com> (raw)
In-Reply-To: <5673CF72.4030808@tu-berlin.de>

Hi,

This probably constitutes a bug, seeing as the problem only occurs when using a type alias:

# class foo = object
    method f : 'a 'b. (< x: 'b; ..> as 'a) -> 'b = assert false
  end;;
    class foo : object method f : < x : 'b; .. > -> 'b end

# type ('a, 'b) f_arg = < x : 'b; .. > as 'a;;
type ('a, 'b) f_arg = 'a constraint 'a = < x : 'b; .. >

# class foo = object
    method f : 'a 'b. ('a, 'b) f_arg -> 'b = assert false
  end;;
    Characters 30-76:
      method f : 'a 'b. ('a, 'b) f_arg -> 'b = assert false
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: This expression has type 'a 'b. (< x : 'b; .. > as 'a, 'b) f_arg -> 'b
       but an expression was expected of type
         'c 'b. (< x : 'b; .. > as 'c, 'b) f_arg -> 'b
       The type variable 'd occurs inside 'd

Regards,

Leo

  reply	other threads:[~2015-12-18 10:07 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-18  9:18 Christoph Höger
2015-12-18 10:07 ` Leo White [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-03-12 23:07 Damien
2003-03-13  0:56 ` brogoff
2003-03-13  1:56 ` Jacques Garrigue
2003-03-13  9:04   ` Damien
2003-03-13  9:27     ` Jacques Garrigue
2003-03-13 14:49       ` Damien
2003-03-13  9:41     ` Olivier Andrieu
2002-08-23 15:46 [Caml-list] Polymorphic methods Frederic Tronel
2002-08-23 17:32 ` Fred Smith
2002-08-23 18:21 ` Remi VANICAT
2002-07-14 23:16 [Caml-list] polymorphic methods nadji
2002-07-15  1:05 ` Jacques Garrigue
2002-07-15  2:08   ` Brian Smith
2002-07-15 16:24   ` nadji
2001-11-19 15:29 [Caml-list] Polymorphic methods Alain Frisch
2001-11-20  0:29 ` Jacques Garrigue
2001-11-20  9:33   ` Alain Frisch
2001-11-20 20:55   ` Xavier Leroy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1450433264.2682694.470896145.4144D923@webmail.messagingengine.com \
    --to=leo@lpw25.net \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).