File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -1341,8 +1341,8 @@ local compilerSwitch = util.switch()
1341
1341
hasMarkDoc = vm .bindDocs (source )
1342
1342
end
1343
1343
1344
+ local key = guide .getKeyName (source )
1344
1345
if not hasMarkDoc then
1345
- local key = guide .getKeyName (source )
1346
1346
if key then
1347
1347
vm .compileByParentNode (source .node , key , function (src )
1348
1348
if src .type == ' doc.field'
@@ -1368,7 +1368,8 @@ local compilerSwitch = util.switch()
1368
1368
end
1369
1369
1370
1370
if source .value then
1371
- if not hasMarkDoc or source .value .type == ' table' then
1371
+ if not hasMarkDoc
1372
+ or (type (key ) == ' string' and util .stringStartWith (key , ' __' )) then
1372
1373
vm .setNode (source , vm .compileNode (source .value ))
1373
1374
end
1374
1375
end
Original file line number Diff line number Diff line change @@ -4293,6 +4293,21 @@ local m = setmetatable({},{ __index = { a = 1 } })
4293
4293
m.<?a?>
4294
4294
]]
4295
4295
4296
+ TEST ' integer' [[
4297
+ ---@class metatable : table
4298
+ ---@field __index table
4299
+
4300
+ ---@param table table
4301
+ ---@param metatable? metatable
4302
+ ---@return table
4303
+ function setmetatable(table, metatable) end
4304
+
4305
+ local mt = {a = 1 }
4306
+ local m = setmetatable({},{ __index = mt })
4307
+
4308
+ m.<?a?>
4309
+ ]]
4310
+
4296
4311
TEST ' integer' [[
4297
4312
local x = 1
4298
4313
repeat
You can’t perform that action at this time.
0 commit comments