@@ -128,7 +128,7 @@ macro bool is_int($Type) @const => $Type.kindof == TypeKind.SIGNED_INT || $Type
128
128
**/
129
129
macro bool is_signed($Type) @const
130
130
{
131
- $switch (inner_kind ($Type))
131
+ $switch (remove_distinct_kind ($Type))
132
132
$case SIGNED_INT:
133
133
$case FLOAT:
134
134
return true;
@@ -144,7 +144,7 @@ macro bool is_signed($Type) @const
144
144
**/
145
145
macro bool is_unsigned($Type) @const
146
146
{
147
- $switch (inner_kind ($Type))
147
+ $switch (remove_distinct_kind ($Type))
148
148
$case UNSIGNED_INT:
149
149
return true;
150
150
$case VECTOR:
@@ -209,20 +209,29 @@ macro bool is_vector($Type) @const
209
209
return $Type.kindof == TypeKind.VECTOR;
210
210
}
211
211
212
- macro typeid inner_type($Type) @const
212
+ /**
213
+ * Recursively remove distinct to get the innermost type.
214
+ **/
215
+ macro typeid remove_distinct($Type) @const
213
216
{
214
217
$if $Type.kindof == TypeKind.DISTINCT:
215
- return inner_type ($typefrom($Type.inner));
218
+ return remove_distinct ($typefrom($Type.inner));
216
219
$else
217
220
return $Type.typeid;
218
221
$endif
219
222
}
220
223
221
- macro TypeKind inner_kind($Type) @const
224
+ /**
225
+ * Recursively remove distinct to get the innermost TypeKind.
226
+ **/
227
+ macro TypeKind remove_distinct_kind($Type) @const
222
228
{
223
- return inner_type ($Type).kindof;
229
+ return remove_distinct ($Type).kindof;
224
230
}
225
231
232
+ macro typeid inner_type($Type) @const @deprecated("Use remove_distinct") => remove_distinct($Type);
233
+ macro TypeKind inner_kind($Type) @const @deprecated("Use remove_distinct_kind") => remove_distinct_kind($Type);
234
+
226
235
macro bool is_same($TypeA, $TypeB) @const
227
236
{
228
237
return $TypeA.typeid == $TypeB.typeid;
0 commit comments