[Mono-bugs] [Bug 33770][Nor] New - Problem with indexers in a class that inherits from ArrayList
bugzilla-daemon@rocky.ximian.com
bugzilla-daemon@rocky.ximian.com
12 Nov 2002 18:59:18 -0000
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 carlosga@telefonica.net.
http://bugzilla.ximian.com/show_bug.cgi?id=33770
--- shadow/33770 Tue Nov 12 13:59:18 2002
+++ shadow/33770.tmp.20638 Tue Nov 12 13:59:18 2002
@@ -0,0 +1,67 @@
+Bug#: 33770
+Product: Mono/MCS
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: Misc
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: carlosga@telefonica.net
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Problem with indexers in a class that inherits from ArrayList
+
+Hello:
+
+
+Problem implementing indexers in a class that inherits from ArrayList
+
+
+
+Test case:
+
+This builds well with csc but not with mcs.
+
+
+mcs error:
+
+
+You can run mcs with 'monomcs' on .NET, instead of mono, too.
+
+test.cs(10) warning CS0114:
+`FirebirdSql.Data.Firebird.FbParameterCollection.Item' hides inherited
+member `ArrayList.this'. To make the current member override that
+implementation, add the override keyword, otherwise use the new keyword
+Compilation succeeded - 1 warning(s)
+
+
+Note: If you put override to the indexer this donīt build with csc.
+
+
+using System;
+using System.Data;
+using System.Collections;
+
+namespace FirebirdSql.Data.Firebird
+{
+ public sealed class FbParameterCollection : ArrayList
+ {
+ // This gives error when build with mcs but not with csc
+ public Object this[string parameterName]
+ {
+ get{ return this[IndexOf(parameterName)]; }
+ set{ this[IndexOf(parameterName)] = value; }
+ }
+
+ public new Object this[int parameterIndex]
+ {
+ get{ return base[parameterIndex]; }
+ set{ base[parameterIndex] = value; }
+ }
+ }
+}