templated type

This commit is contained in:
2026-07-29 22:57:58 +02:00
parent 81e5f093f9
commit 4f6ad45b0e
10 changed files with 478 additions and 25 deletions
+19
View File
@@ -97,6 +97,25 @@ void ErrorTest() {
"datatype already");
TestError("struct X (force_align: 7) { Y:int; }", "force_align");
TestError("struct X {}", "size 0");
TestError(
"struct X { Y:int; } table T { y:X (native_type_template_arg:\"int\"); "
"}",
"'native_type_template' attribute");
TestError(
"table T { y:int (native_type_template_arg:\"int\"); }",
"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");
TestError("table X { Y:byte; } root_type X; { Y:1 } { Y:1 }", "end of file");
TestError("table X { Y:byte; } root_type X; { Y:1 } table Y{ Z:int }",