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

there's something buggy about TDNR and name resolution #5369

Closed
mitchellwrosen opened this issue Sep 25, 2024 · 0 comments · Fixed by #5370
Closed

there's something buggy about TDNR and name resolution #5369

mitchellwrosen opened this issue Sep 25, 2024 · 0 comments · Fixed by #5370
Assignees

Comments

@mitchellwrosen
Copy link
Member

This transcript shows odd behavior:

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

```unison
one.foo : Nat
one.foo = 17

two.foo : Text
two.foo = "blah"
```

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

```unison
one.foo : Nat
one.foo = 18

bar : Nat
bar = foo + foo
```

Here, we expect foo to resolve to the one.foo in the file, because although it could also refer to two.foo in the namespace, that wouldn't type check.

Yet the transcript fails, and with a confusing/wrong error message, too:

  Loading changes detected in scratch.u.

  I couldn't figure out what foo refers to here:
  
      5 | bar = foo + foo
  
  The name foo is ambiguous. Its type should be: Nat
  
  I found some terms in scope that have matching names and
  types. Maybe you meant one of these:
  
  one.foo : Nat
  one.foo : Nat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants