argotorg / argotorg/solcore

Assigning to a comptime variable generates incorrect Hull (and fails in yule)

Open
#549 1 comment 0 reactions 1 assignee Claimed by @mbenke View on GitHub
Dominant language
Haskell
Stars
113
Forks
9
Avg merge
4d 9h
Merged PRs (30d)
1

Description

Reproduction:

```
contract T {
function main() -> word {
let n : comptime word = 5;
n = 7;
return n;
}
}
```
generates the following in Hull

```
function main () -> word {
n := 7
return 7
```

which fails with

```
Type error:
Undefined variable: n
```

We should forbid mutation of comptime variables.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.