[Mono-list] Inheriting from System.Windows.Forms.TextBox

Jon Harrop jon at ffconsultancy.com
Thu Nov 20 14:55:32 EST 2008


On Thursday 20 November 2008 16:55:20 Ivan N. Zlatev wrote:
> On Thu, Nov 20, 2008 at 4:47 PM, Jb Evain <jb at nurv.fr> wrote:
> > Hey,
> >
> > On 11/20/08, Jon Harrop <jon at ffconsultancy.com> wrote:
> >  >  Any ideas why?
> >
> > It looks like a F# compiler bug to me.
>
> Just for info the the method is defined in the TextBoxBase:
>
>    internal abstract Color ChangeBackColor (Color backColor);
>
> and implemented in the TextBox class:
>
>    internal override Color ChangeBackColor (Color backColor) { ... }
>
> So maybe the F# compiler/interpreter doesn't handle "internal abstract" ?

I just checked and F# definitely handles internal abstract fine on .NET, 
including within Microsoft's TextBox.

However, running the F# batch compiler on Mono instead of evaluating the code 
interactively is more enlightening:

$ mono fsc.exe -r System.Windows.Forms.dll test.fs
Microsoft F# Compiler, (c) Microsoft Corporation, All Rights Reserved
F# Version 1.9.6.2, compiling for .NET Framework Version v2.0.50727

test.fs(3,6): error FS0191: No implementation was given 
for 'System.Windows.Forms.TextBoxBase.ChangeBackColor(System.Drawing.Color 
backColor) : System.Drawing.Color'.

test.fs(3,6): error FS0054: This type is 'abstract' since some abstract 
members have not been given an implementation. If this is intentional then 
add the '[<AbstractClass>]' attribute to your type.

So it looks like F# does not handle Mono's abstract classes. I'll e-mail the 
F# team...

-- 
Dr Jon Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?e


More information about the Mono-list mailing list