| ... | @@ -784,7 +784,7 @@ pub const Type = extern union { | ... | @@ -784,7 +784,7 @@ pub const Type = extern union { |
| 784 | | 784 | |
| 785 | .anyframe_T => { | 785 | .anyframe_T => { |
| 786 | if (b.zigTypeTag() != .AnyFrame) return false; | 786 | if (b.zigTypeTag() != .AnyFrame) return false; |
| 787 | return a.childType().eql(b.childType(), mod); | 787 | return a.elemType2().eql(b.elemType2(), mod); |
| 788 | }, | 788 | }, |
| 789 | | 789 | |
| 790 | .empty_struct => { | 790 | .empty_struct => { |
| ... | @@ -4125,14 +4125,15 @@ pub const Type = extern union { | ... | @@ -4125,14 +4125,15 @@ pub const Type = extern union { |
| 4125 | /// TODO this is deprecated in favor of `childType`. | 4125 | /// TODO this is deprecated in favor of `childType`. |
| 4126 | pub const elemType = childType; | 4126 | pub const elemType = childType; |
| 4127 | | 4127 | |
| 4128 | /// For *[N]T, returns T. | 4128 | /// For *[N]T, returns T. |
| 4129 | /// For ?*T, returns T. | 4129 | /// For ?*T, returns T. |
| 4130 | /// For ?*[N]T, returns T. | 4130 | /// For ?*[N]T, returns T. |
| 4131 | /// For ?[*]T, returns T. | 4131 | /// For ?[*]T, returns T. |
| 4132 | /// For *T, returns T. | 4132 | /// For *T, returns T. |
| 4133 | /// For [*]T, returns T. | 4133 | /// For [*]T, returns T. |
| 4134 | /// For [N]T, returns T. | 4134 | /// For [N]T, returns T. |
| 4135 | /// For []T, returns T. | 4135 | /// For []T, returns T. |
| | 4136 | /// For anyframe->T, returns T. |
| 4136 | pub fn elemType2(ty: Type) Type { | 4137 | pub fn elemType2(ty: Type) Type { |
| 4137 | return switch (ty.tag()) { | 4138 | return switch (ty.tag()) { |
| 4138 | .vector => ty.castTag(.vector).?.data.elem_type, | 4139 | .vector => ty.castTag(.vector).?.data.elem_type, |
| ... | @@ -4173,6 +4174,9 @@ pub const Type = extern union { | ... | @@ -4173,6 +4174,9 @@ pub const Type = extern union { |
| 4173 | .optional_single_mut_pointer => ty.castPointer().?.data, | 4174 | .optional_single_mut_pointer => ty.castPointer().?.data, |
| 4174 | .optional_single_const_pointer => ty.castPointer().?.data, | 4175 | .optional_single_const_pointer => ty.castPointer().?.data, |
| 4175 | | 4176 | |
| | 4177 | .anyframe_T => ty.castTag(.anyframe_T).?.data, |
| | 4178 | .@"anyframe" => Type.@"void", |
| | 4179 | |
| 4176 | else => unreachable, | 4180 | else => unreachable, |
| 4177 | }; | 4181 | }; |
| 4178 | } | 4182 | } |