-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Using this
to get access to a state variable of struct instance causes an bool-type var
#15525
Comments
I guess the type system exposes a tuple type including all element types in the struct. For instance, if the struct |
Based on this assumption, I'd like to help update the document to notify users about this scenario. Can anyone help add a document tag for this issue and remove the bug one? |
This is a long-standing quirk of the language stemming from the fact that ABI-encoding of structs was not defined back when the getter functionality was implemented. There are multiple issues this could be considered a duplicate of: #14114, #6337, #12863. Especially #6337 - I see that it got closed as stale. I'm going to reopen it and close this one. In any case, changing it would be breaking. We definitely should have it documented though. It's a very unintuitive behavior. |
Description
The line
true ? contract0.struct1(true) : this.struct_instance13();
causes an error with the following error message:True expression's type struct contract0.struct1 memory does not match false expression's type bool
. I think both sides are of typecontract0.struct1
.Environment
The text was updated successfully, but these errors were encountered: