patch 8.2.1096: Vim9: return type of getqflist() is wrong

Problem:    Vim9: return type of getqflist() is wrong.
Solution:   Let the return type depend on the arguments.  Also for
            getloclist(). (closes #6367)
diff --git a/src/testdir/test_vim9_func.vim b/src/testdir/test_vim9_func.vim
index fbe73f7..1fc13c0 100644
--- a/src/testdir/test_vim9_func.vim
+++ b/src/testdir/test_vim9_func.vim
@@ -837,6 +837,22 @@
   res = [1, 2, 3]->sort()
 enddef
 
+def Test_getqflist_return_type()
+  let l = getqflist()
+  assert_equal([], l)
+
+  let d = getqflist(#{items: 0})
+  assert_equal(#{items: []}, d)
+enddef
+
+def Test_getloclist_return_type()
+  let l = getloclist(1)
+  assert_equal([], l)
+
+  let d = getloclist(1, #{items: 0})
+  assert_equal(#{items: []}, d)
+enddef
+
 def Line_continuation_in_def(dir: string = ''): string
     let path: string = empty(dir)
             \ ? 'empty'