caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* virtual instance variables
@ 2007-06-28 13:34 Jeremy Yallop
  2007-06-28 13:47 ` [Caml-list] " Jon Harrop
  2007-06-28 14:48 ` Jacques Garrigue
  0 siblings, 2 replies; 5+ messages in thread
From: Jeremy Yallop @ 2007-06-28 13:34 UTC (permalink / raw)
  To: Caml List

Should this be considered a bug?

    # (object val virtual c : float method m = c end) # m;;
    Segmentation fault


^ permalink raw reply	[flat|nested] 5+ messages in thread
* virtual instance variables
@ 2007-05-18 18:50 micha
  0 siblings, 0 replies; 5+ messages in thread
From: micha @ 2007-05-18 18:50 UTC (permalink / raw)
  To: caml-list


entering in the toplevel: 

class virtual c = object val virtual d : int end;;

then:

class d = object inherit c val d = 9 end;;

gives me: Exception: Not_found.
What is not found?  (compiling works)

if I define:
 class virtual c = object val d = 0 end;;
 class d = object inherit c val d = 9 end;;

gives the warning:
Warning V: the instance variable d is overriden.
The behaviour changed in ocaml 3.10 (previous behaviour was hiding.)

I thought that  without the virtual declaration the behaviour is the
same as before?

cheers,
 Michael





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-06-28 14:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-28 13:34 virtual instance variables Jeremy Yallop
2007-06-28 13:47 ` [Caml-list] " Jon Harrop
2007-06-28 13:48   ` Vincent Hanquez
2007-06-28 14:48 ` Jacques Garrigue
  -- strict thread matches above, loose matches on Subject: below --
2007-05-18 18:50 micha

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).