chore: emit more reasonable error message when using incomplete type in struct (#7678)

Co-authored-by: Derek Bailey <derekbailey@google.com>
This commit is contained in:
sssooonnnggg
2022-11-29 12:59:53 +08:00
committed by GitHub
parent c3a01c7228
commit ad6054c600
2 changed files with 10 additions and 0 deletions

View File

@@ -473,6 +473,10 @@ inline bool IsStruct(const Type &type) {
return type.base_type == BASE_TYPE_STRUCT && type.struct_def->fixed;
}
inline bool IsIncompleteStruct(const Type &type) {
return type.base_type == BASE_TYPE_STRUCT && type.struct_def->predecl;
}
inline bool IsTable(const Type &type) {
return type.base_type == BASE_TYPE_STRUCT && !type.struct_def->fixed;
}