1
0
forked from aniani/vim

patch 9.0.1796: Vim9 problems with null_objects

Problem:  Vim9 problems with null_objects
Solution: Vim9 improve null_object usage

Fix "xvar == null", where xvar might have been assigned null_object.

Fix compilation failure: "var o2: C = null_object".

closes: #12890

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ernie Rael <errael@raelity.com>
This commit is contained in:
Ernie Rael
2023-08-27 18:40:26 +02:00
committed by Christian Brabandt
parent d4e4ecbb37
commit 5c018bee0e
7 changed files with 54 additions and 4 deletions

View File

@@ -1578,12 +1578,15 @@ typval_compare_null(typval_T *tv1, typval_T *tv2)
#ifdef FEAT_JOB_CHANNEL
case VAR_CHANNEL: return tv->vval.v_channel == NULL;
#endif
// TODO: null_class handling
// case VAR_CLASS: return tv->vval.v_class == NULL;
case VAR_DICT: return tv->vval.v_dict == NULL;
case VAR_FUNC: return tv->vval.v_string == NULL;
#ifdef FEAT_JOB_CHANNEL
case VAR_JOB: return tv->vval.v_job == NULL;
#endif
case VAR_LIST: return tv->vval.v_list == NULL;
case VAR_OBJECT: return tv->vval.v_object == NULL;
case VAR_PARTIAL: return tv->vval.v_partial == NULL;
case VAR_STRING: return tv->vval.v_string == NULL;