It compiles for me. What's the problem? As it is, MyType has no constructor and to use the the interface you have to cast a MyType instance to ITest.

Regards,
Stephan

By on 9/14/2008 10:03 AM ()

You are right Stephan. This sample compiles. I did not see my error because the compiler didn't give me a message.

The problem was that ITest is in a C#-Project, and MyTest is in F#-Project 1.
But i have a class MyTest2 (inherit MyTest) in a F#-Project 2. This project needs also a reference to the C#-Project but the compiler didn't told me until I opened the MyTest2-file. Bad luck.

The next problem was that my Visual Studio doesn't allow me to add project-references to a F#-Project.
Error: Object reference not set to an instance of an object.

I added the project-reference in the manually in the .fsproj-File.

Best regards,
Steffen

By on 9/15/2008 1:15 AM ()

Normally adding project references with the F# plugin (v. 1.9.6.2) should work. However, if you haven't yet compiled the C# DLL and add the reference, the F# plugin won't update the error messages in the editor window once the DLL is actually compiled. In that instance, restarting Visual Studio will help. The error message you cite looks like being related to a different problem, though.

Stephan

By on 9/15/2008 1:53 AM ()

Btw: how would you define ITest in F#?

Steffen

By on 9/15/2008 9:15 AM ()
1
2
3
4
5
type ITest =
    abstract Dimensions: int


    abstract Item: int -> float with get

Stephan

By on 9/15/2008 11:24 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper