summaryrefslogtreecommitdiffstats
path: root/src/vim9type.c
diff options
context:
space:
mode:
authorErnie Rael <errael@raelity.com>2023-08-27 18:40:26 +0200
committerChristian Brabandt <cb@256bit.org>2023-08-27 18:40:26 +0200
commit5c018bee0e1e272774584cfb1577327fbb67254a (patch)
tree8ac0883f1e7b9ea2fea36e27d4a293a0223af2d0 /src/vim9type.c
parentd4e4ecbb3793cd45b645471966c1ac703be52f4a (diff)
patch 9.0.1796: Vim9 problems with null_objectsv9.0.1796
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>
Diffstat (limited to 'src/vim9type.c')
-rw-r--r--src/vim9type.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/vim9type.c b/src/vim9type.c
index c42e4f4931..3955ce2f65 100644
--- a/src/vim9type.c
+++ b/src/vim9type.c
@@ -907,6 +907,8 @@ check_type_maybe(
return MAYBE; // use runtime type check
if (actual->tt_type != VAR_OBJECT)
return FAIL; // don't use tt_class
+ if (actual->tt_class == NULL)
+ return OK; // A null object matches
if (class_instance_of(actual->tt_class, expected->tt_class) == FALSE)
ret = FAIL;