Simplify templates

This commit is contained in:
2026-07-29 23:11:48 +02:00
parent 4f6ad45b0e
commit a06c41f2c7
4 changed files with 21 additions and 42 deletions
+2 -2
View File
@@ -24,12 +24,12 @@ table Matrix (native_type:"Native::Matrix") {
// field via `native_type_template_arg` instead of needing one flatbuffers
// struct declaration per specialization (compare to Vector3D/Vector3DAlt
// above).
struct Tagged (native_type_template: "Native::Tagged<{{T}}>") {
struct Tagged (native_type_template: "Native::Tagged") {
value:int32;
}
// A native type template that takes more than one argument.
struct Pair (native_type_template: "Native::Pair<{{T0}}, {{T1}}>") {
struct Pair (native_type_template: "Native::Pair") {
value:int32;
}
-8
View File
@@ -106,14 +106,6 @@ void ErrorTest() {
"struct-typed fields");
TestError(
"struct X (native_type_template: \"Foo\") { Y:int; } "
"table T { y:X (native_type_template_arg:\"int\"); }",
"does not reference");
TestError(
"struct X (native_type_template: \"Foo<{{T0}}, {{T1}}>\") { Y:int; } "
"table T { y:X (native_type_template_arg:\"int\"); }",
"beyond the");
TestError(
"struct X (native_type_template: \"Foo<{{T}}>\") { Y:int; } "
"table T { y:X (native_type_template_arg:\"\"); }",
"empty template argument");
TestError("{}", "no root");