aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDanielGavin <danielgavin5@hotmail.com>2023-12-29 17:58:35 +0100
committerDanielGavin <danielgavin5@hotmail.com>2023-12-29 17:58:35 +0100
commitf4296894e1ef797a7c95997797c85d130e3847f5 (patch)
treea8bc6113040f317eb70508eb3bed6ccb9345c0c4 /src
parentd87fe143aeca52667413bd990a03d0bcac9386ed (diff)
Check for len being nil
Diffstat (limited to 'src')
-rw-r--r--src/server/generics.odin29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/server/generics.odin b/src/server/generics.odin
index 7141a75..b4393bb 100644
--- a/src/server/generics.odin
+++ b/src/server/generics.odin
@@ -171,22 +171,23 @@ resolve_poly :: proc(
}
found |= true
}
+ if p.len != nil {
+ if poly_type, ok := p.len.derived.(^ast.Poly_Type); ok {
+ if ident, ok := unwrap_ident(poly_type.type); ok {
+ poly_map[ident.name] = call_array.len
+ }
- if poly_type, ok := p.len.derived.(^ast.Poly_Type); ok {
- if ident, ok := unwrap_ident(poly_type.type); ok {
- poly_map[ident.name] = call_array.len
- }
-
- if poly_type.specialization != nil {
- return resolve_poly(
- ast_context,
- call_array.len,
- call_symbol,
- p.len,
- poly_map,
- )
+ if poly_type.specialization != nil {
+ return resolve_poly(
+ ast_context,
+ call_array.len,
+ call_symbol,
+ p.len,
+ poly_map,
+ )
+ }
+ found |= true
}
- found |= true
}
return found