<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2006/02/6c745cdabcb81f4abee3ab4848327146"
  from="sejourne_kevin &lt;sejourne_kevin@y...&gt;"
  author="sejourne_kevin"
  date="2006-02-25T10:50:24"
  subject="multiple inheritance, bug or feature ?"
  prev="2006/02/35909e63a1ddf0522135e5b5f5be1f6a"
  next="2006/02/a79bf343e1e5f2454ac8e10feb96fd3c"
  next-in-thread="2006/02/af2129d76d17706f124c464488b55ccb"
  prev-thread="2006/02/87492d48b7b7425a57ea516b1a7f2397"
  next-thread="2006/02/1681fddd9168a27c9d00d28b96b4af41"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="multiple inheritance, bug or feature ?">
<msg 
  url="2006/02/6c745cdabcb81f4abee3ab4848327146"
  from="sejourne_kevin &lt;sejourne_kevin@y...&gt;"
  author="sejourne_kevin"
  date="2006-02-25T10:50:24"
  subject="multiple inheritance, bug or feature ?">
<msg 
  url="2006/02/af2129d76d17706f124c464488b55ccb"
  from="Jacques Garrigue &lt;garrigue@m...&gt;"
  author="Jacques Garrigue"
  date="2006-02-25T11:44:36"
  subject="Re: [Caml-list] multiple inheritance, bug or feature ?">
<msg 
  url="2006/02/14a34f8584252a88b013f61b18155090"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2006-02-25T11:56:18"
  subject="Re: [Caml-list] multiple inheritance, bug or feature ?">
</msg>
</msg>
<msg 
  url="2006/02/d9cbd2362d0ee2336cbbdae6063a8272"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2006-02-25T11:49:50"
  subject="Re: [Caml-list] multiple inheritance, bug or feature ?">
<msg 
  url="2006/02/cee40211d278f8e8b32d72defe400753"
  from="sejourne_kevin &lt;sejourne_kevin@y...&gt;"
  author="sejourne_kevin"
  date="2006-02-25T11:59:01"
  subject="Re: [Caml-list] multiple inheritance, bug or feature ?">
<msg 
  url="2006/02/62c2392c4a811f218f097d57a0564198"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2006-02-25T12:17:16"
  subject="Re: [Caml-list] multiple inheritance, bug or feature ?">
<msg 
  url="2006/02/1b75a8bb8bfe8ea1000b5732c70ea50a"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2006-02-25T12:34:04"
  subject="Re: [Caml-list] multiple inheritance, bug or feature ?">
</msg>
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>
Hello :


Consider the following sample :

class a =
object
   val mutable x = 0
   method set v = Printf.printf "%d\n" x;x &lt;- v
end
;;
class a : object val mutable x : int method set : int -&gt; unit end


class b =
object
   val mutable y = 0
   method set v = Printf.printf "%d\n" y;y &lt;- v
end
;;

class b : object val mutable y : int method set : int -&gt; unit end
class c =
object (self)
   inherit a as aa
   inherit a as bb
   inherit b as cc

   method set_x_a x = aa#set x
   method set_x_a' x = bb#set x
   method set_y x = cc#set x
end
;;

Warning M: the following methods are overriden by the inherited class: set
Warning V: this definition of an instance variable x hides a previously
defined instance variable of the same name.

Warning M: the following methods are overriden by the inherited class:
set

class c :
   object
     val mutable x : int
     val mutable y : int
     method set : int -&gt; unit
     method set_x_a : int -&gt; unit
     method set_x_a' : int -&gt; unit
     method set_y : int -&gt; unit
   end

let d = new c;;
val d : c = &lt;obj&gt;

d#set_x_a 3;;
0
- : unit = ()

d#set_x_a' 2;;
0
- : unit = ()


When I wrote this program I expect this behavior but
according to the warnings M the result should be 3. If methods are 
overriden, the same instance variable should be change (according to the 
type of class c too). If the variable isn't change the method are not 
overriden. So because methods are not overriden, I think there is a bug 
in the warning system. The warning V look also suspicious.




Kevin.

	

	
		
___________________________________________________________________________ 
Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels pour appeler la France et l'international.
Téléchargez sur http://fr.messenger.yahoo.com

</contents>

</message>

