File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -5512,6 +5512,14 @@ pub const DeclWithHandle = struct {
55125512 if (switch_expr_type .isEnumType ()) break :blk switch_expr_type ;
55135513 if (! switch_expr_type .isUnionType ()) return switch_expr_type ;
55145514
5515+ if (case .ast .values .len == 0 ) {
5516+ if (case .inline_token == null ) {
5517+ return switch_expr_type ;
5518+ }
5519+ // TODO either type
5520+ return null ;
5521+ }
5522+
55155523 // TODO Peer type resolution, we just use the first resolvable item for now.
55165524 for (case .ast .values ) | case_value | {
55175525 if (tree .nodeTag (case_value ) != .enum_literal ) continue ;
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ const switch_tagged_union = switch (some_tagged_union) {
4040 .bar = > | a | a ,
4141 // ^ (bool)()
4242 else = > | a | a ,
43- // ^ (unknown )() TODO this should be `TaggedUnion`
43+ // ^ (TaggedUnion )()
4444};
4545
4646const switch_null = switch (null ) {
You can’t perform that action at this time.
0 commit comments