disallow circular struct references (#8851)

* detect and fail for circular struct dependencies

* pr comments

* pr comment
This commit is contained in:
Justin Davis
2026-02-04 10:15:05 -05:00
committed by GitHub
parent 4623cfa4bc
commit ea0a73d168
4 changed files with 60 additions and 1 deletions

View File

@@ -71,3 +71,12 @@ class SchemaTests:
schema_json["enums"][0]["values"][2]["attributes"][1]["value"]
== "Value 3 (deprecated)"
)
def CircularStructDependency(self):
try:
flatc(["-c", "circular_struct_dependency.fbs"])
assert False, "Expected flatc to fail on circular struct dependency"
except subprocess.CalledProcessError:
pass
flatc(["-c", "circular_table.fbs"])