patch 9.0.0836: wrong error when using extend() with funcref

Problem:    Wrong error when using extend() with funcref.
Solution:   Better check the variable type. (closes #11468, closes #11455)
diff --git a/src/testdir/test_let.vim b/src/testdir/test_let.vim
index 3f9bdd4..4e4a386 100644
--- a/src/testdir/test_let.vim
+++ b/src/testdir/test_let.vim
@@ -316,6 +316,7 @@
   call assert_fails('let l += 2', 'E734:')
   call assert_fails('let g:["a;b"] = 10', 'E461:')
   call assert_fails('let g:.min = function("max")', 'E704:')
+  call assert_fails('let g:cos = "" | let g:.cos = {-> 42}', 'E704:')
   if has('channel')
     let ch = test_null_channel()
     call assert_fails('let ch += 1', 'E734:')