-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Allow mapping to struct with dynamically-sized type to implement inherited function #8489
Comments
Thanks for reporting! I just confirmed this and will look into fixing it. |
This should be "fixed" by #8491.
To change this to overriding |
I'm closing this. |
Hey Guys, I am still facing the same problem. Not sure if I am missing something. Lets keep this example (though I am using solc 0.8.4):
If I do it this way and I access one member of bazMap. then its not possible to access member.a cause the compiler doesnt know that this member has this attribute. Even if I write: Still not possible. What am I missing?
Compiler says return types differ. But they dont, they are exactly the same and get even referenced with their origin. Dont really understand how to implement this. |
Please ask this question either in ethereum stackexchange or the solidity channel on matrix - this issue is not the right place. |
Here's a related issue that's still open: #11826. @danielb1986 If you have a snippet that produces a compilation error and you think it's a bug (rather than just incorrect usage), you could post it there. Please use a complete example though - you said that accessing some members causes errors but I don't see that in your example and we're left guessing what might be happening. If you're unsure, drop by at the #solidity channel so that we can discuss it first. |
Overriding functions defined in interfaces with the automatically-generated getters from public state variables usually work great. This was reported in a previous issue (#3514) and fixed.
However, when the return type is a
struct
that has a dynamically-sized type, like thestring
in the example below, the generated getter doesn't override properly, causing a compiler error.Based on the docs, I might expect the function to override to be like:
but that doesn't work either.
Related to: #6337, #3514, #7521, #4244
The text was updated successfully, but these errors were encountered: