summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
Diffstat (limited to 'script')
-rw-r--r--script/core/diagnostics/cast-type-mismatch.lua2
-rw-r--r--script/core/diagnostics/unknown-cast-variable.lua2
2 files changed, 2 insertions, 2 deletions
diff --git a/script/core/diagnostics/cast-type-mismatch.lua b/script/core/diagnostics/cast-type-mismatch.lua
index ecee6a84..0561a8da 100644
--- a/script/core/diagnostics/cast-type-mismatch.lua
+++ b/script/core/diagnostics/cast-type-mismatch.lua
@@ -16,7 +16,7 @@ return function (uri, callback)
end
for _, doc in ipairs(state.ast.docs) do
- if doc.type == 'doc.cast' then
+ if doc.type == 'doc.cast' and doc.loc then
await.delay()
local defs = vm.getDefs(doc.loc)
local loc = defs[1]
diff --git a/script/core/diagnostics/unknown-cast-variable.lua b/script/core/diagnostics/unknown-cast-variable.lua
index cfa25ed8..57377f6e 100644
--- a/script/core/diagnostics/unknown-cast-variable.lua
+++ b/script/core/diagnostics/unknown-cast-variable.lua
@@ -16,7 +16,7 @@ return function (uri, callback)
end
for _, doc in ipairs(state.ast.docs) do
- if doc.type == 'doc.cast' then
+ if doc.type == 'doc.cast' and doc.loc then
await.delay()
local defs = vm.getDefs(doc.loc)
local loc = defs[1]