Skip to content

Instantly share code, notes, and snippets.

@CJ42
Last active March 21, 2023 18:28
Show Gist options
  • Save CJ42/6c2ab55badeb482c938be6950d100627 to your computer and use it in GitHub Desktop.
Save CJ42/6c2ab55badeb482c938be6950d100627 to your computer and use it in GitHub Desktop.
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.0;
contract UnimplementedFeatureError {
struct Vote {
uint256 optionId;
string value;
}
Vote[] myVotes;
function submitVoteNotWorking() public {
Vote[] memory newVote = new Vote[](1);
newVote[0] = Vote(1, "test");
myVotes = newVote;
}
// UnimplementedFeatureError: Copying of
// type struct UnimplementedFeatureError.Vote memory[] memory to storage not yet supported.
function working1() public {
Vote memory newVote = Vote(1, "test");
myVote[0] = newVote;
}
function working2() public {
Vote memory newVote = Vote(1, "test");
myVote.push(newVote);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment