Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up-net-lib fails to read C# class that implements finalizer with "Invalid override" error #5241
Comments
|
Sorry I was wrong. Haxe fails to read any class that implements finalizer. In this case, |
|
I'm gonna set this to 3.3 and hope @waneck will be able to fix this during his next haxe session. |
|
@vroad can you please send a test case that fails? I've just added a test using finalizers which succeeds in C# |
|
@waneck Sure.
Will cause this error:
import cs.NDLLFunction;
class Main
{
public static function main()
{
trace("test");
}
} |
|
I avoided this issue by moving cs-ndll to lime template. This library is now compiled as part of C# application .Not only because of this bug though. I need to have access to type information which doesn't seems to be accessible with Reflection API. |
|
Thank you. As for the Reflection API, you can still use C#'s reflection api on Haxe - e.g. cs.system.reflection.* package |
|
My last comment about Reflection was bit misleading. I was not talking about Haxe Reflection issue. Since cs-ndll was seperate project at that time (and was written in C#), I was wondering if it's possible to access to length/__a of an Haxe Array without referencing it at compile time. It seems impossible to do this without obtaining FieldInfo every time because Haxe Array is a generic class. And obtaining fields with C# Reflection should be slower than directly using them. So I decided to include this in lime repository instead. |
|
@vroad I'm trying to test this, but I cannot compile cs-ndll . The sln seems to be missing a csproject. Can you send me the compiled dll? Thanks! |
|
@waneck This is the compiled dll I uploaded to GitHub before. |
|
@waneck is this relevant for 3.3 or should we postpone this issue? |
|
Im getting something similar when trying to use winforms in haxe 3.2.1, is it something related? I must admit i know very little about hxcs and c# in general, so its very possible it something im not doing correctly. Cheers, |
|
This is still a problem in Haxe 4.0.preview.1 Godot is going to merge C# support pretty soon and when I tried using Haxe the same problem happens:
|
|
The same in Haxe 3.4 :(
|
|
Did some digging and this may be the issue. A simple C# program: using System;
public class Program {
public static void Main() {
Console.WriteLine("Hello World");
}
~Program() { }
}Will have this IL for the destructor/Finalize:
But the sample project that @vroad posted has this IL for the destructor/Finalize:
Which is similar to the Godot's one:
Notice the I have no idea how to solve this but maybe this is more useful for you @waneck |
|
I'm trying to look into this, but it would really help to have a minimal C# source file that provides the failing assembly. |
|
I tried decompiling the cs-ndll.dll and compiling it back with ms .net and that doesn't seem to be broken :-/ |
|
Anyway, I made the IL loader just skip |
|
@waneck please check the referenced commit when you have time. |
|
Weird... I've got the simple program IL from here https://dotnetfiddle.net/pTR3SJ (the last dropdown from the center let you see the IL code) But I've created this project with Xamarin Studio: And the
|
|
Yes, it works @nadako ! Now to find how to make it work with Godot |
|
Maybe we should include this fix in 3.4.4, will it be a thing @Simn ? |
|
Yah, someone just has to start a branch... |
|
This seems to have been fixed in haxe 4 preview 2:
|
C# compiler seems to be thinking that this assembly is invalid. I'm currently using external class to avoid this issue, but it would be great if I can use any assemblies directly.