Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Codegen fails for layers created with a default name in editor #37

Open
jacobalbano opened this issue Dec 27, 2024 · 0 comments
Open

Codegen fails for layers created with a default name in editor #37

jacobalbano opened this issue Dec 27, 2024 · 0 comments

Comments

@jacobalbano
Copy link

When you create a new layer in LDtk, the default name will be the same as its type name:
image

However, when you try to load this project with the macro, it fails with the internal compile error "Recursive class", because the generated name (using the prefix of "Level_") yields the exact same name as the internal base class Level_Entities.

I have attached a minimal LDtk project file (renamed to .json so Github would let me upload it) that illustrates the problem.
repro.json

Embed it as per the official documentation:

package ldtk;
private typedef _Tmp = haxe.macro.MacroType<[ ldtk.Project.build("repro.json") ]>;

Here is a text log of the generated type definitions, where you can see that the Entities class is being generated with the name Layer_Entities and that its parent class is also Layer_Entities.

repro_output.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant