-
Notifications
You must be signed in to change notification settings - Fork 14
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
Make the namespace resolution code closer to flatc #198
Comments
Honestly I am very surprising that this compiles using
|
Though perhaps that is a problem with |
To use this with planus, replace I have tried to use a newer |
I will investigate more, we are using such nested namespaces for years on our project with both Typescript and Rust versions of flatbuffers. |
Ahh, I missed the In any case, I am still very confused about why The resolution code in planus is here. We currently only support two resolution modes: Relative to current namespace, and relative to the root namespace. I personally think this makes the most sense, but even so I think there is value in following the behavior of I would definitely accept a patch to bring us closer to |
@stephanemagnenat Feel free to ping my in our discord if you want to chat more about this. |
I did not find a specification about namespace resolution, and I cannot recall how I chose the model we use. However, a discussion in an issue seems to indicate that namespace resolution uses a notion of closest distance while walking namespaces backwards, "similar to how C++ works", which seems to indicate that our usage is "correct" and not the exploitation of a bug ;-) |
Nice find! Unfortunately I don't have the capacity to work on this myself, but I will definitely accept a patch to make our resolution code closer to the |
flatc
flatc
Of course, that's kind of an arcane feature. For my experiments with planus, I will simplify our namespace structure. |
Maybe there could be a "conformity" tag for such issues? |
Given the two files (available here):
math.fbs
game.fbs
Using google's flatbuffers works as expected (using flatc version 2.0.6):
flatc -o rust -r --gen-all game.fbs
However, planus is not able to resolve namespaces:
planus check *.fbs
The text was updated successfully, but these errors were encountered: