1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

compiler: allow a type to be used as a variant of multiple sum types

This commit is contained in:
joe-conigliaro
2020-02-26 15:15:38 +11:00
parent bc3d1eaf6e
commit c4e83faa57
5 changed files with 39 additions and 23 deletions

View File

@ -140,7 +140,7 @@ fn (p mut Parser) match_statement(is_expr bool) string {
if is_sum_type {
sum_child_type = p.get_type2().name
tt := sum_child_type.all_after('_')
p.gen('SumType_$tt')
p.gen('SumType_${typ}_$tt')
// println('got child $sum_child_type')
p.register_var(Var{
name: 'it'