Sema: implement cast from anon struct ptr to union ptr

This commit is contained in:
Andrew Kelley
2022-03-02 20:17:09 -07:00
parent ac7028f559
commit 06b1a88a15
3 changed files with 74 additions and 33 deletions

View File

@@ -5036,6 +5036,13 @@ pub const Type = extern union {
};
}
pub fn isAnonStruct(ty: Type) bool {
return switch (ty.tag()) {
.anon_struct => true,
else => false,
};
}
pub fn isTupleOrAnonStruct(ty: Type) bool {
return switch (ty.tag()) {
.tuple, .empty_struct_literal, .anon_struct => true,