LuaLS / lua-language-server

A language server that offers Lua language support - programmed in Lua
https://luals.github.io
MIT License
3.38k stars 320 forks source link

fix: add missing `errs ~= nil` checks to script/vm/type checkTableShape #2956

Closed d-enk closed 2 weeks ago

d-enk commented 2 weeks ago

fix that

[Error - 12:44:58 PM] Request textDocument/semanticTokens/range failed.
  Message: [12:44:56.481][error][#0:script/vm/type.lua:341]: script/vm/type.lua:341: attempt to get length of a nil value (local 'errs')
stack traceback:
    script/vm/type.lua:341: in function <script/vm/type.lua:287>
    (...tail calls...)
    script/vm/type.lua:461: in function 'vm.vm.isSubType'
    script/vm/type.lua:372: in function 'vm.vm.isSubType'
    script/vm/type.lua:785: in function 'vm.vm.canCastType'
    script/vm/function.lua:349: in upvalue 'isAllParamMatched'
    script/vm/function.lua:363: in upvalue 'calcFunctionMatchScore'
    script/vm/function.lua:400: in function 'vm.vm.getExactMatchedFunctions'
    script/vm/compiler.lua:611: in upvalue 'matchCall'
    script/vm/compiler.lua:2278: in function 'vm.vm.compileNode'
    script/vm/infer.lua:272: in function 'vm.vm.getInfer'
    script/core/semantic-tokens.lua:140: in function <script/core/semantic-tokens.lua:114>
    (...tail calls...)
    script/core/semantic-tokens.lua:892: in local 'callback'
    script/parser/guide.lua:719: in function 'parser.guide.eachSourceBetween'
    script/core/semantic-tokens.lua:887: in function 'core.semantic-tokens'
    script/provider/provider.lua:1124: in function <script/provider/provider.lua:1112>
    [C]: in function 'xpcall'
    script/proto/proto.lua:202: in function <script/proto/proto.lua:177>