patch 8.2.4871: Vim9: in :def function no error for misplaced range

Problem:    Vim9: in :def function no error for using a range with a command
            that does not accept one.
Solution:   Check for the command to accept a range. (closes #10330)
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 8b22a8d..b0cf6a7 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -3080,6 +3080,11 @@
 		ea.forceit = TRUE;
 		p = skipwhite(p + 1);
 	    }
+	    if ((ea.argt & EX_RANGE) == 0 && ea.addr_count > 0)
+	    {
+		emsg(_(e_no_range_allowed));
+		goto erret;
+	    }
 	}
 
 	switch (ea.cmdidx)