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

Jb Evain jb at nurv.fr
Thu Nov 20 13:59:00 EST 2008


Hey,

On 11/20/08, Jon Harrop <jon at ffconsultancy.com> wrote:
> I just checked and F# definitely handles internal abstract fine on .NET,
>  including within Microsoft's TextBox.

No it doesn't. And it doesn't have anything to do with TextBox.

Try to compile the following code:

<<<
using System;

public abstract class BaseFoo {

	public void Bang ()
	{
		Console.WriteLine (Bar ());
	}

	internal abstract string Bar ();
}

public class Foo : BaseFoo {

	internal override string Bar ()
	{
		return "Foo !";
	}
}
<<<

Compile it to libtest.dll, and you'll see that you won't be able to
use it from F#:

<<<
> #r "libtest.dll"
- ;;

--> Referenced 'C:\Tmp\libtest.dll'

> type B() =
-  inherit Foo();;

  type B() =
  -----^^

stdin(3,6): error FS0191: No implementation was given for
'BaseFoo.Bar() : string'.
> #quit;;
<<<

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

Again, this has nothing to do with Mono.

The F# team is aware of this bug, which is according to them, their
bug #3929 in their tracking system.

-- 
Jb Evain  <jb at nurv.fr>


More information about the Mono-list mailing list