]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - tests/varargs.qc
Parameter omitting in fteqcc is disallowed.
[xonotic/gmqcc.git] / tests / varargs.qc
index ffe7d1b6b34b152ffa9b2a12751f6302464a0f70..eceec4a5ac693a824ead8f758a262207515fb678 100644 (file)
@@ -1,7 +1,4 @@
-void(string...)   print  = #1;
-string(float)     ftos   = #2;
-
-void nbva(float a, string...count) {
+void nbva(float a, ...count) {
     print("You gave me ", ftos(count), " additional parameters\n");
     print("First: ", ...(0, string), "\n");
     print("You chose: ", ...(a, string), "\n");
@@ -9,6 +6,15 @@ void nbva(float a, string...count) {
         print("Vararg ", ftos(a), " = ", ...(a, string), "\n");
 }
 
+var void unstable(...);
+void stability(float a, float b, ...count)
+{
+    print("Got: ", ftos(count), "\n");
+}
+
 void main() {
     nbva(1, "Hello", "You", "There");
+    stability(1, 2, 3, 4, 5);
+    unstable = stability;
+    unstable(1, 2, 3, 4, 5);
 }