[Mono-bugs] [Bug 62342][Nor] New - A single implementation does not solve multiple inheritance for properties

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 3 Aug 2004 03:23:12 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by tsureshkumar@novell.com.

http://bugzilla.ximian.com/show_bug.cgi?id=62342

--- shadow/62342	2004-08-03 03:23:12.000000000 -0400
+++ shadow/62342.tmp.4485	2004-08-03 03:23:12.000000000 -0400
@@ -0,0 +1,115 @@
+Bug#: 62342
+Product: Mono: Compilers
+Version: unspecified
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: tsureshkumar@novell.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: A single implementation does not solve multiple inheritance for properties
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+A single implementation does not suffice for the same kind of methods in
+multiple inheritance. The following code compiles fine with MS environment
+whereas mono does not.
+
+<Code Snip>
+using System;
+                                                                          
+                                                                          
+                             
+namespace Test
+{
+        public interface IBook
+        {
+                string GetTitle ();
+                string Title { get; }
+        }
+                                                                          
+                                                                          
+                             
+        public interface IMovie
+        {
+                string GetTitle ();
+                string Title { get; }
+        }
+                                                                          
+                                                                          
+                             
+        public class BookAboutMovie : IBook, IMovie
+        {
+                private string title = "";
+                public BookAboutMovie (string title)
+                {
+                        this.title = title;
+                }
+                                                                          
+                                                                          
+                             
+                public string GetTitle ()
+                {
+                        return title;
+                }
+                                                                          
+                                                                          
+                             
+                public string Title
+                {
+                        get { return title; }
+                }
+
+                public static void Main ( string [] args)
+                {
+                        BookAboutMovie jurassicPark = new BookAboutMovie
+("Jurassic Park");
+                        Console.WriteLine ("Book Title : " +
+jurassicPark.GetTitle ());
+                        Console.WriteLine ("Book Title : " +
+((IBook)jurassicPark).Title );
+                }
+                                                                          
+                                                                          
+                             
+        }
+
+</Code Snip>
+
+
+Steps to reproduce the problem:
+1. compile the above program
+2. 
+3. 
+
+Actual Results:
+propmt:~/mcs/class/System.Data/Test> mcs /tmp/themovie.cs
+/tmp/themovie.cs(17) error CS0536: 'Test.BookAboutMovie' does not implement
+interface member 'Test.IBook.Title'. 'Test.BookAboutMovie.Title' is either
+static, not public, or has the wrong return type
+Compilation failed: 1 error(s), 0 warnings
+
+
+Expected Results:
+Compilation Succeeded
+
+How often does this happen? 
+Always
+
+Additional Information:
+
+****
+If I give two different property implementation
+  - string IMovie.Title
+  - string IBook.Title
+the compiler keeps quiet.
+
+**** Same does not work for indexor also