Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use statements can sometimes erroneously capture local variables #5464

Open
mitchellwrosen opened this issue Nov 25, 2024 · 0 comments · May be fixed by #5465
Open

use statements can sometimes erroneously capture local variables #5464

mitchellwrosen opened this issue Nov 25, 2024 · 0 comments · May be fixed by #5465
Assignees
Labels

Comments

@mitchellwrosen
Copy link
Member

I've seen this a few times over the last few months during upgrades and merges (has anyone else?), and I finally narrowed it down:

```ucm
scratch/main> builtins.merge lib.builtin
```

```unison
foo : Nat
foo =
  baz = bar.baz + bar.baz
  19

bar.baz : Nat
bar.baz = 20

qux : Nat
qux = foo + foo
```

```ucm
scratch/main> add
```

```unison
foo : Nat
foo =
  baz = bar.baz + bar.baz
  20

bar.baz : Nat
bar.baz = 20
```

```ucm:error
scratch/main> update
```

This update will fail, because it incorrectly renders foo as

foo : Nat
foo =
  use Nat +
  use bar baz
  baz = baz + baz
  20

rather than the correct

foo : Nat
foo =
  use Nat +
  baz = bar.baz + bar.baz
  20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant