Haxe-UnrealEngine5 icon indicating copy to clipboard operation
Haxe-UnrealEngine5 copied to clipboard

Unreal Enums seems to create problems

Open datee opened this issue 3 years ago • 2 comments

It seems that in general trying to use Unreal Enums in Haxe causes problems.

Test:

var b:EBodyCollisionResponse = EBodyCollisionResponse.BodyCollision_Enabled;
var c:EBlendableLocation = EBlendableLocation.BL_AfterTonemapping;
var e:EndPlayReason:EEndPlayReason = EEndPlayReason.Destroyed;

I get :

C:\dev\Unreal\SampleProject\Source\HaxeCompatibility\HaxeOutput\src\MyActor.cpp	36	Error (active)	E1696	cannot open source file "EBlendableLocation.h"	HaxeProject
C:\dev\Unreal\SampleProject\Source\HaxeCompatibility\HaxeOutput\src\MyActor.cpp	36	Error (active)	E1696	cannot open source file "EBodyCollisionResponse/Type.h"	HaxeProject	
C:\dev\Unreal\SampleProject\Source\HaxeCompatibility\HaxeOutput\src\MyActor.cpp	39	Error (active)	E1696	cannot open source file "EEndPlayReason/Type.h"	HaxeProject
C:\dev\Unreal\SampleProject\Source\HaxeCompatibility\HaxeOutput\src\MyActor.cpp	42	Error (active)	E0276	name followed by '::' must be a class or namespace name	HaxeProject
C:\dev\Unreal\SampleProject\Source\HaxeCompatibility\HaxeOutput\src\MyActor.cpp	88	Error (active)	E0276	name followed by '::' must be a class or namespace name	HaxeProject
C:\dev\Unreal\SampleProject\Source\HaxeCompatibility\HaxeOutput\src\MyActor.cpp	89	Error (active)	E0413	no suitable conversion function from "EEndPlayReason::Type" to "EEndPlayReason::Type" exists	HaxeProject	

datee avatar Oct 30 '22 15:10 datee

This is an issue with Haxe itself. I’ve been trying to find a solution, but also waiting to see if this pull request gets accepted:

https://github.com/HaxeFoundation/haxe/pull/10830

in mean time, next commit should also fix this somewhat by replacing the externs with abstracts.

SomeRanDev avatar Oct 30 '22 16:10 SomeRanDev

Yes ok i see. Well thats good to know then! Im just looking into testing this and reporting things that i find! 👍

datee avatar Oct 30 '22 16:10 datee