Confusing error message when trying to initialize an anonymous struct with {}
#22498
Labels
Bug
This tag is applied to issues which reports bugs.
Status: Confirmed
This bug has been confirmed to be valid by a contributor.
Describe the bug
Running the code below, the compiler produces a confusing error message and a completely unrelated message just after.
Reproduction Steps
Expected Behavior
An error that says to use
struct {}
to initialize the anonymous struct.Current Behavior
Possible Solution
Change the error message to suggest using
struct {}
to initialize the embedded struct.Additional Information/Context
The code in the error message does work, which is a little bit weird:
the above compiles and runs, but it probably shouldn't (since
_VAnonStruct1
is a type defined by the compiler). Could be related to a different issue.V version
V 0.4.8 ab862c4
Environment details (OS name and version, etc.)
Note
You can use the 👍 reaction to increase the issue's priority for developers.
Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.
The text was updated successfully, but these errors were encountered: