diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2022-08-18 02:37:41 +0200 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2022-08-18 02:37:41 +0200 |
| commit | 0121af997113de35011dcb9e940498a70ea393cb (patch) | |
| tree | cbf03663835f5ef76266cdcd00dc21663dd1cefa | |
| parent | 4820ffdf3e5567aa645561964b769f6a8e6f86aa (diff) | |
Fixed comp literal inference with indexed version
| -rw-r--r-- | src/server/analysis.odin | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin index 3491557..facc202 100644 --- a/src/server/analysis.odin +++ b/src/server/analysis.odin @@ -331,9 +331,8 @@ resolve_type_comp_literal :: proc(ast_context: ^AstContext, position_context: ^D } } } - } else { //indexed + } else if comp_value, ok := elem.derived.(^ast.Comp_Lit); ok { //indexed if s, ok := current_symbol.value.(SymbolStructValue); ok { - if len(s.types) <= element_index { return {}, {}, false } @@ -343,7 +342,7 @@ resolve_type_comp_literal :: proc(ast_context: ^AstContext, position_context: ^D if _, ok := symbol.value.(SymbolBitSetValue); ok { return current_symbol, current_comp_lit, true } - return resolve_type_comp_literal(ast_context, position_context, symbol, cast(^ast.Comp_Lit)field_value.value) + return resolve_type_comp_literal(ast_context, position_context, symbol, comp_value) } } } |