I have a struct with a nested mapping which I am instantiating and trying to push to an array, but I'm receiving the following error on the line i try to push:
Storage arrays with nested mappings do not support .push(<arg>).
Its obvious what the compiler is complaining about, my struct has a mapping and im trying to perform a push. Is this fundamentally not allowed or is there something I can change in my implementation to make this work? I'm using solidity 0.8.0.
Code:
struct Dividend {
mapping(address => bool) claimed;
uint256 pool;
}
Dividend[] public dividends;
function createDividends() public {
Dividend storage d;
d.pool = dividendPool;
dividends.push(d);
}