@@ -374,10 +374,11 @@ function vm.isSubType(uri, child, parent, mark, errs)
374374 elseif child .type == ' vm.node' then
375375 if config .get (uri , ' Lua.type.weakUnionCheck' ) then
376376 local hasKnownType = 0
377+ local maxUnionVariants = config .get (uri , ' Lua.type.maxUnionVariants' ) or 0
377378 local i = 0
378379 for n in child :eachObject () do
379380 i = i + 1
380- if i > 100 then
381+ if maxUnionVariants > 0 and i > maxUnionVariants then
381382 break
382383 end
383384 if vm .getNodeName (n ) then
@@ -403,10 +404,11 @@ function vm.isSubType(uri, child, parent, mark, errs)
403404 else
404405 local weakNil = config .get (uri , ' Lua.type.weakNilCheck' )
405406 local skipTable
407+ local maxUnionVariants = config .get (uri , ' Lua.type.maxUnionVariants' ) or 0
406408 local i = 0
407409 for n in child :eachObject () do
408410 i = i + 1
409- if i > 100 then
411+ if maxUnionVariants > 0 and i > maxUnionVariants then
410412 break
411413 end
412414 if skipTable == nil and n .type == " table" and parent .type == " vm.node" then -- skip table type check if child has class
@@ -473,10 +475,11 @@ function vm.isSubType(uri, child, parent, mark, errs)
473475 parent = global
474476 elseif parent .type == ' vm.node' then
475477 local hasKnownType = 0
478+ local maxUnionVariants = config .get (uri , ' Lua.type.maxUnionVariants' ) or 0
476479 local i = 0
477480 for n in parent :eachObject () do
478481 i = i + 1
479- if i > 100 then
482+ if maxUnionVariants > 0 and i > maxUnionVariants then
480483 break
481484 end
482485 if vm .getNodeName (n ) then
0 commit comments