Open MatthieuHernandez opened 1 week ago
I think I've found a solution to my problem. I mustn't run cppfront on all my files at the same time in my building script.
This generates cpp1 code that does not compile:
cppfront -cwd ./generate ../src/color.h2 |
cppfront -cwd ./generate `
../src/stone.h2 `
../src/goban.h2 `
../src/move.h2 `
../src/game.h2 `
../src/engine.h2 `
../src/io.h2 `
../src/main.cpp2 `
-import-std
While it generates the expected code
cppfront -cwd ./generate ../src/color.h2 |
cppfront -cwd ./generate ../src/stone.h2 ../src/goban.h2 ../src/move.h2 -import-std |
cppfront -cwd ./generate ../src/game.h2 ../src/engine.h2 ../src/io.h2 -import-std |
cppfront -cwd ./generate ../src/main.cpp2 -import-std
Sounds like an issue with globals usage.
Sorry but I won't be able to give much info as this bug seems to appear “randomly”. Sometimes I'll add a valid line of code to a method and another function in my code (always the same) will start being generated in the wrong way. It's impossible to reproduce this bug in an MRE, because it's incomprehensible. I once had this bug and adding this line
count = count + 0;
, in the method I was working on made it go away.Sometime this method:
Is generated like this for no apparent reason:
Why does
cpp2::move(std)::cout
is generated? I don't have any explanation, I'll let you know if I get any new information on this.