Hi there,
as i am not a C#-guy, i am not sure if this is an issue with RO C# or C# in general. Any hints how to solve this issue are welcome.
A third party library compiles fine with MS C#, but including it in an Oxygene-project the compiler struggles with an error “Element not allowed before the inherited constructor has been called”.
The base class expects a delegate (a factory method) in its constructor…
Broken down and reduced to the bare minimum as example:
namespace XYZ
{
public delegate int SomeFunction(int someParam);
public class BaseClass
{
public BaseClass(string xyz, SomeFunction func)
{
func(42);
}
}
public class InheritedClass : BaseClass
{
public InheritedClass()
: base("FooBar", SomeFunctionImpl)
{
// The compiler has a problem with "SomeFunctionImpl" in this case
}
public static int SomeFunctionImpl(int someParam)
{
}
}
}
Regards,
Timm