diff options
Diffstat (limited to 'script/vm/infer.lua')
-rw-r--r-- | script/vm/infer.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/script/vm/infer.lua b/script/vm/infer.lua index b9dfb29a..99cf622e 100644 --- a/script/vm/infer.lua +++ b/script/vm/infer.lua @@ -432,10 +432,14 @@ function mt:view(uri, default) end if self.node:isOptional() then - if max > 1 then - view = '(' .. view .. ')?' + if #array == 0 then + view = 'nil' else - view = view .. '?' + if max > 1 then + view = '(' .. view .. ')?' + else + view = view .. '?' + end end end |