argotorg / argotorg/solidity

Make copy / reference semantics more explicit

Open
#2,435 11 comments 0 reactions 0 assignees View on GitHub
breaking change :warning: high effort high impact language design :rage4: needs design selected for development
Dominant language
C++
Stars
25.7k
Forks
6.2k
Avg merge
1d 11h
Merged PRs (30d)
21

Description

Implicit copy operations from storage to memory, from calldata to memory, from memory to external function arguments, etc is not possible anymore except for value types.

To make an ordinary value copyable, use the `copyof` operator: `x` cannot be copied, but `copyof x` can be copied. Using `copyof` twice is invalid. Storing a copyable type somewhere erases the copyable property again, i.e. `uint[] memory x = copyof y; c.f(x);` is invalid.

Contributor guide

Open the contributing guide

Research direction

Use the issue's copyof examples as the behavioral specification; determine where copyability and implicit-copy checks are implemented. Done means the listed storage, calldata, memory, and external-argument cases follow the stated rules, including rejection of copyof copyof and loss of copyability after storage.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, solidity
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.