I have the following structures defined in my smart contract:
mapping(bytes4 => Question) private questions;
struct Question {
bytes8[] answers;
mapping(bytes32 => bool) answerers;
}
Which I use to be able to create Questions, and have people answer to them "anonymously" (It's not anonymous because that's impossible on the blockchain, but at least I don't want to directly associate an answer to an answerer). The mapping in the struct Question is responsible for being easily able to access who answered already and who didn't.
However, when I try to add a new question in one of my functions, like so:
Question storage newQ;
questions[uid] = newQ;
I get the error Types in storage containing (nested) mapping cannot be assigned to
. Does that mean it's impossible to use my answerers
mapping in my struct? How can I go around that, and why should or shouldn't I?