Skip to content

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

Merged
dbaileychess merged 2 commits intogoogle:masterfrom
sssooonnnggg:master
Nov 29, 2022
Merged

chore: emit more reasonable error message when using incomplete type …#7678
dbaileychess merged 2 commits intogoogle:masterfrom
sssooonnnggg:master

Conversation

@sssooonnnggg
Copy link
Copy Markdown
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
@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>
jochenparm pushed a commit to jochenparm/flatbuffers that referenced this pull request Oct 29, 2024
…in struct (google#7678)

Co-authored-by: Derek Bailey <derekbailey@google.com>
jochenparm pushed a commit to jochenparm/flatbuffers that referenced this pull request Oct 29, 2024
…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.

2 participants