Open utterances-bot opened 8 months ago
A note that this documentation glosses over; there are two different forced access metadatas:
@:access(Target)
allows you to access any private variables on the Target within the proceeding class or method.@:privateAccess(Target)
allows you to access any private variables on the Target within the proceeding expression.So if you want to access a single variable within the Target in a single line, you probably want to use @:privateAccess
just before you perform the actual access. If you want to access multiple variables or you want to perform access multiple times, especially if it's across several methods within a class, you should put @:access
at the top of the method or at the top of the module.
EDIT: Also, if you're having trouble, try using the fully qualified name inside the metadata instead of just the class name (so include the package, and the module name if that is different).
Access Control - Haxe - The Cross-platform Toolkit
Haxe is an open source toolkit based on a modern, high level, strictly typed programming language.
https://haxe.org/manual/lf-access-control.html