How does Haxe handle a very strange dll name?

35 views
Skip to first unread message

S.A. Asselbergs

unread,
Jun 14, 2016, 1:24:29 PM6/14/16
to Haxe
Hello fellow Haxers,

I have added references with awkward names in my haxe c# project, and i have no idea how to use import on them. Anyone suggestions?
-dce:full
-net-lib E:/source code/Haxe/Assembly-CSharp.dll
-net-lib E:/source code/Haxe/Assembly-CSharp-firstpass.dll

For Assembly-CSharp.dll I tried to import the following ways:

import Assembly-CSharp; //error: Unexpected -
import assemblyCSharp; //error: No classes found in assemblyCSharp
import assemblycsharp;//No classes found in assemblycsharp
import assembly_CSharp
;//No classes found in assembly_CSharp
import assembly_csharp;//No classes found in assembly_csharp
 
The same goes with Assembly-CSharp-firstpass.dll, however that class has this C# code

SingleInstance<T>
and it has this definition:
public abstract class SingleInstance<T> : MonoBehaviour where T : SingleInstance<T>
look especially to the "where T"

How would I solve that with haxe?

Greetings, Simon

Cauê Waneck

unread,
Jun 14, 2016, 2:38:26 PM6/14/16
to haxe...@googlegroups.com
There is some name mangling that happens in order to make C#-imported files be compatible with Haxe. You can check them out by running `haxe -cs dummy --no-output -D dump=pretty -net-lib path/to/dll` . This will create a directory called `dump` where you can find all classes as they are seen by Haxe.

In the second case, SingleInstance, type parameters get a `_<number of type parameters>` suffix. So you can access it through the name `SingleInstance_1<>`

You don't need to import the dll name; Rather, you just need to know which namespace they were defined. All namespaces are lower-cased, so if you have MyNamespace.Other.SingleInstance, you can access it through the path mynamespace.other.SingleInstance_1

--
To post to this group haxe...@googlegroups.com
http://groups.google.com/group/haxelang?hl=en
---
You received this message because you are subscribed to the Google Groups "Haxe" group.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages