[Mono-list] Problem with inheritance

Jason Diamond jason@injektilo.org
Sat, 14 Jul 2001 18:27:37 -0700


According to the documentation, System.Web.UI.TemplateParser doesn't have a
property called DefaultBaseType. So it must not be a public or protected
member. When I compile your sample, I get the same error along with an error
that says: "no suitable method found to override".

Your IL snippet shows the access as being "assembly". Is it possible that
the compiler can't find the DefaultBaseType property because your new class
isn't in the same assembly as TemplateParser and therefore doesn't have
access to it?

Since PageParser is sealed, I can't think of a workaround other than
implementing all of the classes in the hierarchy yourself.

Jason.

> -----Original Message-----
> From: mono-list-admin@ximian.com [mailto:mono-list-admin@ximian.com]On
> Behalf Of Sebastien Lambla
> Sent: Sunday, July 15, 2001 3:02 AM
> To: mono-list@ximian.com
> Subject: [Mono-list] Problem with inheritance
>
>
> Hello all,
>
> I can't seem to see where my problem lies. I'm trying to implement the
> PageParser class. Here's the partial code:
>
> public sealed class PageParser : TemplateControlParser
> {
> 	protected override Type DefaultBaseType
> 	{
> 		get
> 		{
> 			return null;
> 		}
> 	}
> }
> The compiler keep on telling me System.Web.UI.PageParser does not
> implement
> inherited abstract class member
> System.Web.UI.TemplateParser.DefaultBaseType.get
>
> The DefaultBaseType property is an abstract defined in the TemplateParser,
> and TemplateControlParser inherits from it.
>
> What am I doing wrong? Here is the metadata on this property :
>
> .property instance class [mscorlib]System.Type
>         DefaultBaseType()
>
> and
>
> .method assembly hidebysig specialname virtual
>         instance class [mscorlib]System.Type
>         get_DefaultBaseType() cil managed
>
> I'm sure I'm missing a very simple thing, but can't seem to go nowhere...
>
> Thanks,
>
> Sebastien Lambla
>
>
> _______________________________________________
> Mono-list maillist  -  Mono-list@ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>