aboutsummaryrefslogtreecommitdiff
path: root/src/server
diff options
context:
space:
mode:
Diffstat (limited to 'src/server')
-rw-r--r--src/server/locals.odin32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/server/locals.odin b/src/server/locals.odin
index 800e01d..a68c5b7 100644
--- a/src/server/locals.odin
+++ b/src/server/locals.odin
@@ -677,21 +677,23 @@ get_locals_for_range_stmt :: proc(
case SymbolProcedureValue:
calls := make(map[int]struct{}, context.temp_allocator)
get_generic_assignment(file, stmt.expr, ast_context, &results, &calls, {}, false)
- for val, i in stmt.vals {
- if ident, ok := unwrap_ident(val); ok {
- result_i := min(len(results) - 1, i)
- store_local(
- ast_context,
- ident,
- results[result_i],
- ident.pos.offset,
- ident.name,
- ast_context.non_mutable_only,
- false,
- {.Mutable},
- symbol.pkg,
- false,
- )
+ if len(results) > 0 {
+ for val, i in stmt.vals {
+ if ident, ok := unwrap_ident(val); ok {
+ result_i := min(len(results) - 1, i)
+ store_local(
+ ast_context,
+ ident,
+ results[result_i],
+ ident.pos.offset,
+ ident.name,
+ ast_context.non_mutable_only,
+ false,
+ {.Mutable},
+ symbol.pkg,
+ false,
+ )
+ }
}
}
case SymbolUntypedValue: