patch 9.1.0226: Not able to assign enum values to an enum static variable

Problem:  Not able to assign enum values to an enum static variable
          (zzzyxwvut)
Solution: Make it work
          (Yegappan Lakshmanan)

related: #14224
closes: #14329

Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/vim9class.c b/src/vim9class.c
index 6963491..2d60ba9 100644
--- a/src/vim9class.c
+++ b/src/vim9class.c
@@ -2056,6 +2056,11 @@
 	    if (enum_parse_values(eap, cl, line, &classmembers,
 					&num_enum_values, &enum_end) == FAIL)
 		break;
+
+	    if (enum_end)
+		// Add the enum "values" class variable.
+		enum_add_values_member(cl, &classmembers, num_enum_values,
+							&type_list);
 	    continue;
 	}
 
@@ -2368,9 +2373,9 @@
 
     vim_free(theline);
 
-    if (success && is_enum)
-	// Add the enum "values" class variable.
-	enum_add_values_member(cl, &classmembers, num_enum_values, &type_list);
+    if (success && is_enum && num_enum_values == 0)
+	// Empty enum statement. Add an empty "values" class variable
+	enum_add_values_member(cl, &classmembers, 0, &type_list);
 
     /*
      * Check a few things