New error: declaring an enum field without a default in range of the enum.

Change-Id: I4db7f032440c00d31c7434975b8a3f17c29d74b9
Tested: on Linux.
This commit is contained in:
Wouter van Oortmerssen
2018-01-18 12:06:01 -08:00
parent 3694ae0817
commit f431a96523
2 changed files with 18 additions and 9 deletions

View File

@@ -1179,6 +1179,8 @@ void ErrorTest() {
TestError("table X { Y:int; Y:int; }", "field already");
TestError("table Y {} table X { Y:int; }", "same as table");
TestError("struct X { Y:string; }", "only scalar");
TestError("table X { Y:string = 1; }", "default values");
TestError("enum Y:byte { Z = 1 } table X { y:Y; }", "not part of enum");
TestError("struct X { Y:int (deprecated); }", "deprecate");
TestError("union Z { X } table X { Y:Z; } root_type X; { Y: {}, A:1 }",
"missing type field");
@@ -1968,7 +1970,7 @@ int main(int /*argc*/, const char * /*argv*/ []) {
EndianSwapTest();
JsonDefaultTest();
FlexBuffersTest();
if (!testing_fails) {