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 @@ -5478,6 +5478,14 @@ pub const DeclWithHandle = struct {
54785478 if (switch_expr_type .isEnumType ()) break :blk switch_expr_type ;
54795479 if (! switch_expr_type .isUnionType ()) return switch_expr_type ;
54805480
5481+ if (case .ast .values .len == 0 ) {
5482+ if (case .inline_token == null ) {
5483+ return switch_expr_type ;
5484+ }
5485+ // TODO either type
5486+ return null ;
5487+ }
5488+
54815489 // TODO Peer type resolution, we just use the first resolvable item for now.
54825490 for (case .ast .values ) | case_value | {
54835491 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