Class access problem

Wondering if the Masters of Haxe Compilation™ can help me here…

Scenario:
I am using two haxelibs (away3d and away3d-csg) which have a similar package structure, i.e. they both start with “away3d”, such as “package away3d.materials” etc. There are some private fields in away3d which are marked with @:allow, such as:

@:allow(away3d) private function addOwner(owner:IMaterialOwner):Void

When I compile with Haxe 4.1.5, the class in away3d-csg is able to use addOwner with no runtime error. When I use Haxe 4.2.5, it generates a runtime error “TypeError: this._material.addOwner is not a function”.

Possible Solution?
I suspected that Haxe got stricter about package access in the recent version, so I attempted to use @:access metadata in the AwayCSG class which is used by my application but I don’t seem to have the right solution. This doesn’t work:

@:access(away3d.materials.MaterialBase)
or this: @:access(away3d.materials.MaterialBase.addOwner)

Am I anywhere close to a solution? Thanks in advance!

Runtime error should be unrelated to access metas. Maybe this happen because you call that function from Dynamic object with enabled DCE? Do you have analyzer or dce defines in project?

I don’t think it’s from a Dynamic object (the only Dynamic is the caught error here), but dce is currently set to “full”.

Anyone else got your ears on? Did Haxe get stricter about package access?

Did you tested without dce?
If behaviour is changed between compiler versions, you probably should minimize code to reproducible example and report it.

Thanks—yes, I’ve tested it again now and setting to dce “no” gives the same problem.

It might take a while for me to simplify this. :slight_smile: