Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: emit more reasonable error message when using incomplete type … #7678

Merged
merged 2 commits into from Nov 29, 2022

Conversation

sssooonnnggg
Copy link
Contributor

Emit more reasonable error message when using incomplete type in struct.
Example:

struct B
{
  a: A;
}
struct A
{
  a: int;
}

When parsing this schema, flatc will emit a confusing error message: "structs may contain only scalar or struct fields".
In fact, it's not allowed because struct A is an incomplete type when parsing struct B, we can't get A's size and other information at this point.

@github-actions github-actions bot added c++ codegen Involving generating code from schema labels Nov 29, 2022
src/idl_parser.cpp Outdated Show resolved Hide resolved
@dbaileychess dbaileychess enabled auto-merge (squash) November 29, 2022 04:56
@dbaileychess dbaileychess merged commit ad6054c into google:master Nov 29, 2022
sunwen18 pushed a commit to sunwen18/flatbuffers that referenced this pull request Dec 25, 2022
…in struct (google#7678)

Co-authored-by: Derek Bailey <derekbailey@google.com>
candhyan pushed a commit to mediaz/flatbuffers that referenced this pull request Jan 2, 2023
…in struct (google#7678)

Co-authored-by: Derek Bailey <derekbailey@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ codegen Involving generating code from schema
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants