You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Are circular imports valid flatbuffer schema? Since other similar schemas seem to support it, IMO this should be specified somewhere in the flatbuffer documentation; in the absence of a formal spec, it could go here in the section on "Includes".
Whether or not circular imports are supported, here's a minimized example that I think should ether throw an error about the circular dependency, or successfully generate code, depending on the intended flatc behavior.
Minimized example:
// a.fbs
include "b.fbs";
namespace a;
enum A : int {
a = 0,
b = 1,
c = 2,
}
// b.fbs
include "a.fbs";
namespace b;
table B {
some_a:a.A;
}
$ flatc --rust a.fbs
error:
/home/andrew-otiv/otiv3/otiv3/middleware_types/minimized_example/a.fbs:9: 0: error: type referenced but not defined (check namespace): a.A, originally at: b.fbs:5
(The wider context)
The .fbs files were generated from .proto files containting the same circular import.
The .proto files were generated from .xsd files containing the same circular import.
This original circularity wasn't intentional and I'll try to resolve it at the source.
The text was updated successfully, but these errors were encountered:
Are circular imports valid flatbuffer schema? Since other similar schemas seem to support it, IMO this should be specified somewhere in the flatbuffer documentation; in the absence of a formal spec, it could go here in the section on "Includes".
https://flatbuffers.dev/flatbuffers_guide_writing_schema.html
Whether or not circular imports are supported, here's a minimized example that I think should ether throw an error about the circular dependency, or successfully generate code, depending on the intended flatc behavior.
Minimized example:
(The wider context)
The .fbs files were generated from .proto files containting the same circular import.
The .proto files were generated from .xsd files containing the same circular import.
This original circularity wasn't intentional and I'll try to resolve it at the source.
The text was updated successfully, but these errors were encountered: