]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(vim): Update base syntax, match Vim9 object type constructor
authorDoug Kearns <dougkearns@gmail.com>
Sat, 8 Nov 2025 17:23:47 +0000 (17:23 +0000)
committerChristian Brabandt <cb@256bit.org>
Sat, 8 Nov 2025 17:23:47 +0000 (17:23 +0000)
fixes: #18677.
closes: #18691

Reported by Aliaksei Budavei.

Signed-off-by: Doug Kearns <dougkearns@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/syntax/generator/vim.vim.base
runtime/syntax/testdir/dumps/vim9_types_00.dump
runtime/syntax/testdir/dumps/vim9_types_example_object_00.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim9_types_example_object_01.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim9_types_object_00.dump [new file with mode: 0644]
runtime/syntax/testdir/dumps/vim9_types_object_01.dump [new file with mode: 0644]
runtime/syntax/testdir/input/vim9_types.vim
runtime/syntax/testdir/input/vim9_types_example_object.vim [new file with mode: 0644]
runtime/syntax/testdir/input/vim9_types_object.vim [new file with mode: 0644]
runtime/syntax/vim.vim

index 0f7d3ff89d8093a4310a63a1951963daea4d1f23..3be56651e6cbf7cd32c9475452b5b9eeccfcce34 100644 (file)
@@ -2,7 +2,7 @@
 " Language:       Vim script
 " Maintainer:     Hirohito Higashi <h.east.727 ATMARK gmail.com>
 "         Doug Kearns <dougkearns@gmail.com>
-" Last Change:    2025 Nov 04
+" Last Change:    2025 Nov 07
 " Former Maintainer: Charles E. Campbell
 
 " DO NOT CHANGE DIRECTLY.
@@ -575,13 +575,20 @@ syn match vimParamType    contained       ":\s"   skipwhite skipnl nextgroup=@vimType conta
 syn match      vimTypeSep      contained       ":\%(\s\|\n\)\@=" skipwhite nextgroup=@vimType
 syn keyword    vimType contained       blob bool channel float job number string void
 syn keyword    vimTypeAny      contained       any
+syn region     vimTypeObject   contained
+      \ matchgroup=vimType
+      \ start="\<object<"
+      \ end=">"
+      \ contains=vimTypeAny,vimTypeObject,vimUserType
+      \ oneline
+      \ transparent
 syn match      vimType contained       "\<\%(func\)\>"
 syn region     vimCompoundType contained       matchgroup=vimType start="\<func("                end=")" nextgroup=vimTypeSep contains=@vim9Continue,@vimType transparent
 syn region     vimCompoundType contained       matchgroup=vimType start="\<tuple<"           end=">"                      contains=@vim9Continue,@vimType transparent
 syn region     vimCompoundType contained       matchgroup=vimType start="\<\%(list\|dict\)<" end=">"              contains=@vimType oneline       transparent
 syn match      vimUserType     contained       "\<\%(\h\w*\.\)*\u\w*\>"
 
-syn cluster vimType contains=vimType,vimTypeAny,vimCompoundType,vimUserType
+syn cluster vimType contains=vimType,vimTypeAny,vimTypeObject,vimCompoundType,vimUserType
 
 " Classes, Enums And Interfaces: {{{2
 " =============================
@@ -1130,6 +1137,13 @@ syn region       vim9VariableList        contained       start="\[" end="]" contains=@vimContinue,@
 syn match      vim9VariableTypeSep     contained       "\S\@1<=:\%(\s\|\n\)\@="                skipwhite nextgroup=@vim9VariableType
 syn keyword    vim9VariableType                contained       blob bool channel float job number string void  skipwhite nextgroup=vimLetHeredoc
 syn keyword    vim9VariableTypeAny     contained       any                     skipwhite nextgroup=vimLetHeredoc
+syn region     vim9VariableTypeObject  contained
+      \ matchgroup=vimType
+      \ start="\<object<"
+      \ end=">"
+      \ contains=vimTypeAny,vimTypeObject,vimUserType
+      \ oneline
+      \ transparent
 syn match      vim9VariableType                contained       "\<\%(func\)\>"                 skipwhite nextgroup=vimLetHeredoc
 syn region     vim9VariableCompoundType        contained
       \ matchgroup=vim9VariableType
@@ -1155,7 +1169,7 @@ syn region        vim9VariableCompoundType        contained
       \ transparent
 syn match      vim9VariableUserType    contained       "\<\%(\h\w*\.\)*\u\w*\>"        skipwhite nextgroup=vimLetHeredoc
 
-syn cluster vim9VariableType contains=vim9VariableType,vim9VariableTypeAny,vim9VariableCompoundType,vim9VariableUserType
+syn cluster vim9VariableType contains=vim9VariableType,vim9VariableTypeAny,vim9VariableTypeObject,vim9VariableCompoundType,vim9VariableUserType
 
 " Lockvar and Unlockvar: {{{2
 " =====================
@@ -2586,6 +2600,7 @@ if !exists("skip_vim_syntax_inits")
  hi def link vimTodo   Todo
  hi def link vimType   Type
  hi def link vimTypeAny        vimType
+ hi def link vimTypeObject     vimType
  hi def link vimUniq   vimCommand
  hi def link vimUniqBang       vimBang
  hi def link vimUniqOptions    Special
@@ -2677,7 +2692,8 @@ if !exists("skip_vim_syntax_inits")
  hi def link vim9TypeEquals    vimOper
  hi def link vim9Variable      vimVar
  hi def link vim9VariableType  vimType
- hi def link vim9VariableTypeAny       vimType
+ hi def link vim9VariableTypeAny       vimTypeAny
+ hi def link vim9VariableTypeObject    vimTypeObject
  hi def link vim9Var   vimCommand
  hi def link vim9Vim9ScriptArg Special
  hi def link vim9Vim9Script    vimCommand
index 9513a41943fba2b228f3ca1892de863d52d10d2d..515da0f089150b7cf51a6664ee9bdc8a20d77f9f 100644 (file)
@@ -1,13 +1,13 @@
 >v+0#af5f00255#ffffff0|i|m|9|s|c|r|i|p|t| +0#0000000&@64
 |#+0#0000e05&| |V|i|m|9| |t|y|p|e|s| +0#0000000&@62
 |#+0#0000e05&| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |h|i| |l|i|n|k| |v|i|m|T|y|p|e|A|n|y| |T|o|d|o| +0#0000000&@34
-|#+0#0000e05&| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |h|i| |l|i|n|k| |v|i|m|V|a|r|i|a|b|l|e|T|y|p|e|A|n|y| |T|o|d|o| +0#0000000&@26
+|#+0#0000e05&| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |h|i| |l|i|n|k| |v|i|m|9|V|a|r|i|a|b|l|e|T|y|p|e|A|n|y| |T|o|d|o| +0#0000000&@25
 @75
 @75
 |#+0#0000e05&| |b|u|i|l|t|i|n| |t|y|p|e|s| |(|d|i|s|t|i|n|c|t| |a|n|y| |h|i|g|h|l|i|g|h|t|i|n|g|)| +0#0000000&@31
 @75
 |v+0#af5f00255&|a|r| +0#0000000&|f|o@1|:| |b+0#00e0003&|o@1|l| +0#0000000&@61
-|v+0#af5f00255&|a|r| +0#0000000&|b|a|r|:| |a+0#00e0003&|n|y| +0#0000000&@62
+|v+0#af5f00255&|a|r| +0#0000000&|b|a|r|:| |a+0#0000001#ffff4012|n|y| +0#0000000#ffffff0@62
 @75
 |d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&|a+0#0000000&|r|g|:| |b+0#00e0003&|o@1|l|)+0#e000e06&|:+0#0000000&| |b+0#00e0003&|o@1|l| +0#0000000&@50
 |e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68
diff --git a/runtime/syntax/testdir/dumps/vim9_types_example_object_00.dump b/runtime/syntax/testdir/dumps/vim9_types_example_object_00.dump
new file mode 100644 (file)
index 0000000..98aaaee
--- /dev/null
@@ -0,0 +1,20 @@
+>v+0#af5f00255#ffffff0|i|m|9|s|c|r|i|p|t| +0#0000000&@64
+|#+0#0000e05&| |V|i|m|9| |o|b|j|e|c|t| |t|y|p|e| |c|o|n|s|t|r|u|c|t|o|r| +0#0000000&@44
+|#+0#0000e05&| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |h|i| |l|i|n|k| |v|i|m|T|y|p|e|O|b|j|e|c|t| |T|o|d|o| +0#0000000&@31
+|#+0#0000e05&| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |h|i| |l|i|n|k| |v|i|m|9|V|a|r|i|a|b|l|e|T|y|p|e|O|b|j|e|c|t| |T|o|d|o| +0#0000000&@22
+@75
+@75
+|#+0#0000e05&| |I|s@1|u|e| |#|1|8|6|7@1| |(|N|o| |r|e|c|o|g|n|i|t|i|o|n| |o|f| |o|b|j|e|c|t|<|a|n|y|>| |t|y|p|e|s| |-| |A|l|i|a|k|s|e|i| |B|u|d|a|v|e|i|)| +0#0000000&@3
+|| @73
+|i+0#af5f00255&|n|t|e|r|f|a|c|e| +0#0000000&|I| @63
+@2|d+0#af5f00255&|e|f| +0#0000000&|s+0#00e0e07&|t|r|i|n|g|(+0#e000e06&|)|:+0#0000000&| |s+0#00e0003&|t|r|i|n|g| +0#0000000&@52
+|e+0#af5f00255&|n|d|i|n|t|e|r|f|a|c|e| +0#0000000&@62
+@75
+|c+0#af5f00255&|l|a|s@1| +0#0000000&|C| |i+0#af5f00255&|m|p|l|e|m|e|n|t|s| +0#0000000&|I| @54
+@2|d+0#af5f00255&|e|f| +0#0000000&|s+0#00e0e07&|t|r|i|n|g|(+0#e000e06&|)|:+0#0000000&| |s+0#00e0003&|t|r|i|n|g| +0#0000000&@52
+@4|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|"+0#e000002&|C|"| +0#0000000&@60
+@2|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@66
+|e+0#af5f00255&|n|d|c|l|a|s@1| +0#0000000&@66
+@75
+|e+0#af5f00255&|n|u|m| +0#0000000&|E| |i+0#af5f00255&|m|p|l|e|m|e|n|t|s| +0#0000000&|I| @55
+@57|1|,|1| @10|T|o|p| 
diff --git a/runtime/syntax/testdir/dumps/vim9_types_example_object_01.dump b/runtime/syntax/testdir/dumps/vim9_types_example_object_01.dump
new file mode 100644 (file)
index 0000000..4f21002
--- /dev/null
@@ -0,0 +1,20 @@
+| +0&#ffffff0@1|d+0#af5f00255&|e|f| +0#0000000&|s+0#00e0e07&|t|r|i|n|g|(+0#e000e06&|)|:+0#0000000&| |s+0#00e0003&|t|r|i|n|g| +0#0000000&@52
+@4|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|"+0#e000002&|C|"| +0#0000000&@60
+@2|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@66
+|e+0#af5f00255&|n|d|c|l|a|s@1| +0#0000000&@66
+@75
+>e+0#af5f00255&|n|u|m| +0#0000000&|E| |i+0#af5f00255&|m|p|l|e|m|e|n|t|s| +0#0000000&|I| @55
+@2|I|N|S|T|A|N|C|E| @64
+@75
+@2|d+0#af5f00255&|e|f| +0#0000000&|s+0#00e0e07&|t|r|i|n|g|(+0#e000e06&|)|:+0#0000000&| |s+0#00e0003&|t|r|i|n|g| +0#0000000&@52
+@4|r+0#af5f00255&|e|t|u|r|n| +0#0000000&|"+0#e000002&|E|"| +0#0000000&@60
+@2|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@66
+|e+0#af5f00255&|n|d|e|n|u|m| +0#0000000&@67
+@75
+|v+0#af5f00255&|a|r| +0#0000000&|c|:| |o+0#00e0003&|b|j|e|c|t|<|C+0#0000000&|>+0#00e0003&| +0#0000000&|=+0#af5f00255&| +0#0000000&|C|.|n+0#00e0e07&|e|w|(+0#e000e06&|)| +0#0000000&@48
+|v+0#af5f00255&|a|r| +0#0000000&|e|:| |o+0#00e0003&|b|j|e|c|t|<|E+0#0000000&|>+0#00e0003&| +0#0000000&|=+0#af5f00255&| +0#0000000&|E|.+0#af5f00255&|I+0#0000000&|N|S|T|A|N|C|E| @45
+|v+0#af5f00255&|a|r| +0#0000000&|o|s|:| |t+0#00e0003&|u|p|l|e|<|o|b|j|e|c|t|<|a|n|y|>|,+0#0000000&| |o+0#00e0003&|b|j|e|c|t|<|I+0#0000000&|>+0#00e0003&@1| +0#0000000&|=+0#af5f00255&| +0#0000000&|(+0#e000e06&|c+0#0000000&|,| |e|)+0#e000e06&| +0#0000000&@28
+|e+0#af5f00255&|c|h|o| +0#0000000&|(+0#e000e06&|c+0#0000000&|,| |e|)+0#e000e06&| +0#0000000&|=+0#af5f00255&@1| +0#0000000&|o|s| @57
+@75
+|~+0#4040ff13&| @73
+| +0#0000000&@56|1|9|,|1| @9|B|o|t| 
diff --git a/runtime/syntax/testdir/dumps/vim9_types_object_00.dump b/runtime/syntax/testdir/dumps/vim9_types_object_00.dump
new file mode 100644 (file)
index 0000000..ea65303
--- /dev/null
@@ -0,0 +1,20 @@
+>v+0#af5f00255#ffffff0|i|m|9|s|c|r|i|p|t| +0#0000000&@64
+|#+0#0000e05&| |V|i|m|9| |o|b|j|e|c|t| |t|y|p|e| |c|o|n|s|t|r|u|c|t|o|r| +0#0000000&@44
+|#+0#0000e05&| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |h|i| |l|i|n|k| |v|i|m|I|y|p|e|O|b|j|e|c|t| |T|o|d|o| +0#0000000&@31
+|#+0#0000e05&| |V|I|M|_|T|E|S|T|_|S|E|T|U|P| |h|i| |l|i|n|k| |v|i|m|9|V|a|r|i|a|b|l|e|I|y|p|e|O|b|j|e|c|t| |T|o|d|o| +0#0000000&@22
+@75
+@75
+|i+0#af5f00255&|n|t|e|r|f|a|c|e| +0#0000000&|I| @63
+|e+0#af5f00255&|n|d|i|n|t|e|r|f|a|c|e| +0#0000000&@62
+@75
+|v+0#af5f00255&|a|r| +0#0000000&|a|:| |o+0#00e0003&|b|j|e|c|t|<|I+0#0000000&|>+0#00e0003&| +0#0000000&@58
+|v+0#af5f00255&|a|r| +0#0000000&|b|:| |o+0#00e0003&|b|j|e|c|t|<|a|n|y|>| +0#0000000&@56
+|v+0#af5f00255&|a|r| +0#0000000&|c|:| |o+0#00e0003&|b|j|e|c|t|<|o|b|j|e|c|t|<|I+0#0000000&|>+0#00e0003&@1| +0#0000000&@50
+|v+0#af5f00255&|a|r| +0#0000000&|d|:| |o+0#00e0003&|b|j|e|c|t|<|o|b|j|e|c|t|<|a|n|y|>@1| +0#0000000&@48
+@75
+|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&| +0#0000000&@66
+@4|a|r|g|1|:| |o+0#00e0003&|b|j|e|c|t|<|I+0#0000000&|>+0#00e0003&|,+0#0000000&| @54
+@4|a|r|g|2|:| |o+0#00e0003&|b|j|e|c|t|<|a|n|y|>|,+0#0000000&| @52
+@4|a|r|g|3|:| |o+0#00e0003&|b|j|e|c|t|<|o|b|j|e|c|t|<|I+0#0000000&|>+0#00e0003&@1|,+0#0000000&| @46
+@4|a|r|g|4|:| |o+0#00e0003&|b|j|e|c|t|<|o|b|j|e|c|t|<|a|n|y|>@1|)+0#e000e06&| +0#0000000&@44
+@57|1|,|1| @10|T|o|p| 
diff --git a/runtime/syntax/testdir/dumps/vim9_types_object_01.dump b/runtime/syntax/testdir/dumps/vim9_types_object_01.dump
new file mode 100644 (file)
index 0000000..d4031aa
--- /dev/null
@@ -0,0 +1,20 @@
+| +0&#ffffff0@74
+|d+0#af5f00255&|e|f| +0#0000000&|F|o@1|(+0#e000e06&| +0#0000000&@66
+@4|a|r|g|1|:| |o+0#00e0003&|b|j|e|c|t|<|I+0#0000000&|>+0#00e0003&|,+0#0000000&| @54
+@4|a|r|g|2|:| |o+0#00e0003&|b|j|e|c|t|<|a|n|y|>|,+0#0000000&| @52
+@4|a|r|g|3|:| |o+0#00e0003&|b|j|e|c|t|<|o|b|j|e|c|t|<|I+0#0000000&|>+0#00e0003&@1|,+0#0000000&| @46
+@4>a|r|g|4|:| |o+0#00e0003&|b|j|e|c|t|<|o|b|j|e|c|t|<|a|n|y|>@1|)+0#e000e06&| +0#0000000&@44
+|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68
+@75
+|d+0#af5f00255&|e|f| +0#0000000&|B|a|r|(+0#e000e06&|)|:+0#0000000&| |o+0#00e0003&|b|j|e|c|t|<|I+0#0000000&|>+0#00e0003&| +0#0000000&@54
+|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68
+@75
+|d+0#af5f00255&|e|f| +0#0000000&|B|a|z|(+0#e000e06&|)|:+0#0000000&| |o+0#00e0003&|b|j|e|c|t|<|o|b|j|e|c|t|<|I+0#0000000&|>+0#00e0003&@1| +0#0000000&@46
+|e+0#af5f00255&|n|d@1|e|f| +0#0000000&@68
+@75
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+|~| @73
+| +0#0000000&@56|1|9|,|5| @9|B|o|t| 
index 81e76efd46869437f00390ddd9bbe823a6a38d34..97a3636fcbefb1cf48f3aebb7fb595df29e96af0 100644 (file)
@@ -1,7 +1,7 @@
 vim9script
 # Vim9 types
 # VIM_TEST_SETUP hi link vimTypeAny Todo
-# VIM_TEST_SETUP hi link vimVariableTypeAny Todo
+# VIM_TEST_SETUP hi link vim9VariableTypeAny Todo
 
 
 # builtin types (distinct any highlighting)
diff --git a/runtime/syntax/testdir/input/vim9_types_example_object.vim b/runtime/syntax/testdir/input/vim9_types_example_object.vim
new file mode 100644 (file)
index 0000000..4d36cc9
--- /dev/null
@@ -0,0 +1,31 @@
+vim9script
+# Vim9 object type constructor
+# VIM_TEST_SETUP hi link vimTypeObject Todo
+# VIM_TEST_SETUP hi link vim9VariableTypeObject Todo
+
+
+# Issue #18677 (No recognition of object<any> types - Aliaksei Budavei)
+
+interface I
+  def string(): string
+endinterface
+
+class C implements I
+  def string(): string
+    return "C"
+  enddef
+endclass
+
+enum E implements I
+  INSTANCE
+
+  def string(): string
+    return "E"
+  enddef
+endenum
+
+var c: object<C> = C.new()
+var e: object<E> = E.INSTANCE
+var os: tuple<object<any>, object<I>> = (c, e)
+echo (c, e) == os
+
diff --git a/runtime/syntax/testdir/input/vim9_types_object.vim b/runtime/syntax/testdir/input/vim9_types_object.vim
new file mode 100644 (file)
index 0000000..7066464
--- /dev/null
@@ -0,0 +1,27 @@
+vim9script
+# Vim9 object type constructor
+# VIM_TEST_SETUP hi link vimIypeObject Todo
+# VIM_TEST_SETUP hi link vim9VariableIypeObject Todo
+
+
+interface I
+endinterface
+
+var a: object<I>
+var b: object<any>
+var c: object<object<I>>
+var d: object<object<any>>
+
+def Foo(
+    arg1: object<I>,
+    arg2: object<any>,
+    arg3: object<object<I>>,
+    arg4: object<object<any>>)
+enddef
+
+def Bar(): object<I>
+enddef
+
+def Baz(): object<object<I>>
+enddef
+
index 69ca7d153091e450fde641c95aa968a26e385f59..b9e05ddad65682efea23562974fbcad53325d0e6 100644 (file)
@@ -2,7 +2,7 @@
 " Language:       Vim script
 " Maintainer:     Hirohito Higashi <h.east.727 ATMARK gmail.com>
 "         Doug Kearns <dougkearns@gmail.com>
-" Last Change:    2025 Nov 04
+" Last Change:    2025 Nov 07
 " Former Maintainer: Charles E. Campbell
 
 " DO NOT CHANGE DIRECTLY.
@@ -629,13 +629,20 @@ syn match vimParamType    contained       ":\s"   skipwhite skipnl nextgroup=@vimType conta
 syn match      vimTypeSep      contained       ":\%(\s\|\n\)\@=" skipwhite nextgroup=@vimType
 syn keyword    vimType contained       blob bool channel float job number string void
 syn keyword    vimTypeAny      contained       any
+syn region     vimTypeObject   contained
+      \ matchgroup=vimType
+      \ start="\<object<"
+      \ end=">"
+      \ contains=vimTypeAny,vimTypeObject,vimUserType
+      \ oneline
+      \ transparent
 syn match      vimType contained       "\<\%(func\)\>"
 syn region     vimCompoundType contained       matchgroup=vimType start="\<func("                end=")" nextgroup=vimTypeSep contains=@vim9Continue,@vimType transparent
 syn region     vimCompoundType contained       matchgroup=vimType start="\<tuple<"           end=">"                      contains=@vim9Continue,@vimType transparent
 syn region     vimCompoundType contained       matchgroup=vimType start="\<\%(list\|dict\)<" end=">"              contains=@vimType oneline       transparent
 syn match      vimUserType     contained       "\<\%(\h\w*\.\)*\u\w*\>"
 
-syn cluster vimType contains=vimType,vimTypeAny,vimCompoundType,vimUserType
+syn cluster vimType contains=vimType,vimTypeAny,vimTypeObject,vimCompoundType,vimUserType
 
 " Classes, Enums And Interfaces: {{{2
 " =============================
@@ -1186,6 +1193,13 @@ syn region       vim9VariableList        contained       start="\[" end="]" contains=@vimContinue,@
 syn match      vim9VariableTypeSep     contained       "\S\@1<=:\%(\s\|\n\)\@="                skipwhite nextgroup=@vim9VariableType
 syn keyword    vim9VariableType                contained       blob bool channel float job number string void  skipwhite nextgroup=vimLetHeredoc
 syn keyword    vim9VariableTypeAny     contained       any                     skipwhite nextgroup=vimLetHeredoc
+syn region     vim9VariableTypeObject  contained
+      \ matchgroup=vimType
+      \ start="\<object<"
+      \ end=">"
+      \ contains=vimTypeAny,vimTypeObject,vimUserType
+      \ oneline
+      \ transparent
 syn match      vim9VariableType                contained       "\<\%(func\)\>"                 skipwhite nextgroup=vimLetHeredoc
 syn region     vim9VariableCompoundType        contained
       \ matchgroup=vim9VariableType
@@ -1211,7 +1225,7 @@ syn region        vim9VariableCompoundType        contained
       \ transparent
 syn match      vim9VariableUserType    contained       "\<\%(\h\w*\.\)*\u\w*\>"        skipwhite nextgroup=vimLetHeredoc
 
-syn cluster vim9VariableType contains=vim9VariableType,vim9VariableTypeAny,vim9VariableCompoundType,vim9VariableUserType
+syn cluster vim9VariableType contains=vim9VariableType,vim9VariableTypeAny,vim9VariableTypeObject,vim9VariableCompoundType,vim9VariableUserType
 
 " Lockvar and Unlockvar: {{{2
 " =====================
@@ -2648,6 +2662,7 @@ if !exists("skip_vim_syntax_inits")
  hi def link vimTodo   Todo
  hi def link vimType   Type
  hi def link vimTypeAny        vimType
+ hi def link vimTypeObject     vimType
  hi def link vimUniq   vimCommand
  hi def link vimUniqBang       vimBang
  hi def link vimUniqOptions    Special
@@ -2739,7 +2754,8 @@ if !exists("skip_vim_syntax_inits")
  hi def link vim9TypeEquals    vimOper
  hi def link vim9Variable      vimVar
  hi def link vim9VariableType  vimType
- hi def link vim9VariableTypeAny       vimType
+ hi def link vim9VariableTypeAny       vimTypeAny
+ hi def link vim9VariableTypeObject    vimTypeObject
  hi def link vim9Var   vimCommand
  hi def link vim9Vim9ScriptArg Special
  hi def link vim9Vim9Script    vimCommand