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/eval.c b/src/eval.c
index b815113..c57f6a4 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1376,7 +1376,8 @@
 		else
 		    prevval = 0; // avoid compiler warning
 		wrong = (lp->ll_dict->dv_scope == VAR_DEF_SCOPE
-			       && rettv->v_type == VAR_FUNC
+			       && (rettv->v_type == VAR_FUNC
+					    || rettv->v_type == VAR_PARTIAL)
 			       && var_wrong_func_name(key, lp->ll_di == NULL))
 			|| !valid_varname(key, -1, TRUE);
 		if (len != -1)