diff options
| author | Daniel Gavin <danielgavin5@hotmail.com> | 2022-07-09 18:36:01 +0200 |
|---|---|---|
| committer | Daniel Gavin <danielgavin5@hotmail.com> | 2022-07-09 18:36:01 +0200 |
| commit | 28d4e76ecc635c1c386ff914d4db6c92eea092e8 (patch) | |
| tree | e7b181f43a0e65358917988c11ad2e04c0cbeabd /src/server/analysis.odin | |
| parent | 9e9f4958f0ff2686cd0ace5a247c54c5ab775106 (diff) | |
| parent | fb5b19056827afbad2133f486d68d2ea162930e7 (diff) | |
Merge branch 'master' into index-caching
Diffstat (limited to 'src/server/analysis.odin')
| -rw-r--r-- | src/server/analysis.odin | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/server/analysis.odin b/src/server/analysis.odin index 8043148..933ce8a 100644 --- a/src/server/analysis.odin +++ b/src/server/analysis.odin @@ -1785,8 +1785,18 @@ make_symbol_union_from_ast :: proc(ast_context: ^AstContext, v: ast.Union_Type, symbol.name = "union" } + types := make([dynamic]^ast.Expr, ast_context.allocator) + + for variant in v.variants { + if v.poly_params != nil { + append(&types, clone_type(variant, ast_context.allocator, nil)) + } else { + append(&types, variant) + } + } + symbol.value = SymbolUnionValue { - types = v.variants, + types = types[:], } if v.poly_params != nil { |