C# 2.0 RTM compler incompatability with c# 1.1
C# 2.0 RTM compler incompatability with c# 1.1
I have an existing application that declares a class that derives from System.Windows.Forms.Form and an interface. This compiled and worked correctly in 1.1 but an error is reported during in C# 2.0 "IRecitalMirageForm - type is not supported by the language"
public
class Form1 : System.Windows.Forms.Form, IRecitalMirageForm
Is there any workaround for this behavior
C# 2.0 RTM compler incompatability with c# 1.1
ChristopherK
The C# 2.0 compiler will not allow me to apply an interface when i am subclassing a Form.
This works perfectly ok in 1.1
The interface is simple. It would appear that the C# 2.0 compiler only allows to subclass one class (as previously) but interfaces are in fact valid. For some reason it thinks the interface is also a class.
The code for the interface is written in J#:
package
Recital.Mirage;public interface IRecitalMirageForm
{
public IRecitalMirage Mirage = null;
public void OpenForm();
public void CloseForm();
public System.Collections.Hashtable GetForm();
public void PutForm();
}
Maybe C# 2.0 does not handle j# interfaces correctly as it previously did.
melinjo
If it's just an interface, how does it help to have it in J# Why can't you do it in C#
Wil Herren
We happen to write in both J# and C# targetting the CLR.
The problem appears to be in subclassing a J# interface with another class.
Seeing that the interface is quite small it can easily be put into C#. The only point i am making however is that C# 2.0 has broken the previous behavior of 1.1 which handles this ok.
Thanks for your feedback.
SED
Thank you very much for sharing your issue.
I am puzzled, not by the error you get but by it previously working! Please, if you have not already done so, file a bug in our product center with a repro also of the previous working code, so that we can investigate the difference and get back to you.
Thanks again,
Mads
Stefano.Gallotta
If C# 1.1 allowed this same declaration, post a bug on the Microsoft Product Feedback Center with example projects both in Visual Studio 2003 and Visual Studio 2005.
Adam81
Best regards,
Johan Stenberg
shiuu
In fact, I googled and could not find it at all, so I'd bet on it being in your code base somewhere. As the interface is not part of the framework, it's not a .NET problem, I'm sure you can still apply an interface to a class in .NET 2.0.
PaulTromans
I will report the incompability as this all works perfectly well in 1.1.
Thanks again.