Version française
Home     About     Download     Resources     Contact us    
Browse thread
virtual instance variables
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: micha <micha-1@f...>
Subject: virtual instance variables

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