Last active
March 21, 2023 18:28
-
-
Save CJ42/6c2ab55badeb482c938be6950d100627 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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