| ... | @@ -5921,32 +5921,44 @@ pub const Type = struct { | ... | @@ -5921,32 +5921,44 @@ pub const Type = struct { |
| 5921 | }; | 5921 | }; |
| 5922 | | 5922 | |
| 5923 | pub fn isTuple(ty: Type) bool { | 5923 | pub fn isTuple(ty: Type) bool { |
| 5924 | return switch (ty.tag()) { | 5924 | return switch (ty.ip_index) { |
| 5925 | .tuple, .empty_struct_literal => true, | 5925 | .none => switch (ty.tag()) { |
| 5926 | .@"struct" => ty.castTag(.@"struct").?.data.is_tuple, | 5926 | .tuple, .empty_struct_literal => true, |
| 5927 | else => false, | 5927 | .@"struct" => ty.castTag(.@"struct").?.data.is_tuple, |
| | 5928 | else => false, |
| | 5929 | }, |
| | 5930 | else => false, // TODO |
| 5928 | }; | 5931 | }; |
| 5929 | } | 5932 | } |
| 5930 | | 5933 | |
| 5931 | pub fn isAnonStruct(ty: Type) bool { | 5934 | pub fn isAnonStruct(ty: Type) bool { |
| 5932 | return switch (ty.tag()) { | 5935 | return switch (ty.ip_index) { |
| 5933 | .anon_struct, .empty_struct_literal => true, | 5936 | .none => switch (ty.tag()) { |
| 5934 | else => false, | 5937 | .anon_struct, .empty_struct_literal => true, |
| | 5938 | else => false, |
| | 5939 | }, |
| | 5940 | else => false, // TODO |
| 5935 | }; | 5941 | }; |
| 5936 | } | 5942 | } |
| 5937 | | 5943 | |
| 5938 | pub fn isTupleOrAnonStruct(ty: Type) bool { | 5944 | pub fn isTupleOrAnonStruct(ty: Type) bool { |
| 5939 | return switch (ty.tag()) { | 5945 | return switch (ty.ip_index) { |
| 5940 | .tuple, .empty_struct_literal, .anon_struct => true, | 5946 | .none => switch (ty.tag()) { |
| 5941 | .@"struct" => ty.castTag(.@"struct").?.data.is_tuple, | 5947 | .tuple, .empty_struct_literal, .anon_struct => true, |
| 5942 | else => false, | 5948 | .@"struct" => ty.castTag(.@"struct").?.data.is_tuple, |
| | 5949 | else => false, |
| | 5950 | }, |
| | 5951 | else => false, // TODO |
| 5943 | }; | 5952 | }; |
| 5944 | } | 5953 | } |
| 5945 | | 5954 | |
| 5946 | pub fn isSimpleTuple(ty: Type) bool { | 5955 | pub fn isSimpleTuple(ty: Type) bool { |
| 5947 | return switch (ty.tag()) { | 5956 | return switch (ty.ip_index) { |
| 5948 | .tuple, .empty_struct_literal => true, | 5957 | .none => switch (ty.tag()) { |
| 5949 | else => false, | 5958 | .tuple, .empty_struct_literal => true, |
| | 5959 | else => false, |
| | 5960 | }, |
| | 5961 | else => false, // TODO |
| 5950 | }; | 5962 | }; |
| 5951 | } | 5963 | } |
| 5952 | | 5964 | |