summaryrefslogtreecommitdiff
path: root/script/vm
diff options
context:
space:
mode:
Diffstat (limited to 'script/vm')
-rw-r--r--script/vm/generic.lua11
-rw-r--r--script/vm/type.lua3
2 files changed, 9 insertions, 5 deletions
diff --git a/script/vm/generic.lua b/script/vm/generic.lua
index e6b47392..4ac7374d 100644
--- a/script/vm/generic.lua
+++ b/script/vm/generic.lua
@@ -36,11 +36,12 @@ local function cloneObject(source, resolved)
end
if source.type == 'doc.type' then
local newType = {
- type = source.type,
- start = source.start,
- finish = source.finish,
- parent = source.parent,
- types = {},
+ type = source.type,
+ start = source.start,
+ finish = source.finish,
+ parent = source.parent,
+ optional = source.optional,
+ types = {},
}
for i, typeUnit in ipairs(source.types) do
local newObj = cloneObject(typeUnit, resolved)
diff --git a/script/vm/type.lua b/script/vm/type.lua
index 57a6444f..32b8e50b 100644
--- a/script/vm/type.lua
+++ b/script/vm/type.lua
@@ -355,6 +355,9 @@ function vm.isSubType(uri, child, parent, mark, errs)
return true
end
end
+ if n.type == 'doc.generic.name' then
+ return true
+ end
end
if parent:isOptional() then
if vm.isSubType(uri, child, 'nil', mark, errs) == true then