How do I avoid conflicts between haxe Type class and C# Type class?

Viewed 292

I am developing Haxe code that I convert in C# and insert into a Unity project.

The conversion works fine and I am able to use the generated class when I import it alone in Unity. To make it work, I have to bring in Unity the whole generated src folder, including the Type.cs file.

However, when I import the "Post Processing Stack" (a basic Unity extension) I get errors due to name Conflicts. The Type class is also a basic C# class and It is used by the Post Processing scripts. The haxe-Type takes priority and breaks the compilation:

Assets/PostProcessing/Runtime/PostProcessingBehaviour.cs(406,30): error CS1502: The best overloaded method match for `System.Collections.Generic.Dictionary<Type,System.Collections.Generic.KeyValuePair<UnityEngine.Rendering.CameraEvent,UnityEngine.Rendering.CommandBuffer>>.Add(Type, System.Collections.Generic.KeyValuePair<UnityEngine.Rendering.CameraEvent,UnityEngine.Rendering.CommandBuffer>)' has some invalid arguments

Assets/PostProcessing/Runtime/PostProcessingBehaviour.cs(406,34): error CS1503: Argument `#1' cannot convert `System.Type' expression to type `Type'

I don't know if it is possible to solve this issue by playing around with C#/Unity/Mono search paths.

I as wondering wether it is more appropriate to (optionally) wrap all haxe top-level classes into the haxe namespace, or a special haxe-defaultnamespace, or prefix them for example to class HType. Name conflicts for this basic types are likely to emerge in many other contexts, not only in Unity.

1 Answers
Related