Skip to content

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

Description

@mbenke

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions