unison icon indicating copy to clipboard operation
unison copied to clipboard

incorrect output with ambibuous names

Open stew opened this issue 1 year ago • 2 comments

I'm getting this compiler error:

  
  Some common causes of this error include:
    * Your current namespace is too deep to contain the definition in its subtree
    * The definition is part of a library which hasn't been added to this project
  
  To add a library to this project use the command: `fork <.path.to.lib> .__projects._c8a19f50_9499_4b99_95cb_e3cdafc89545.branches._55829436_5dfc_4771_8895_390743bc271e.lib.<libname>`
  
  Whatever it is, its type should conform to ServerState -> cloud_4_6_6.ServiceHash a b -> aws_4_0_0.lib.http.HttpRequest -> aws_4_0_0.lib.http.HttpResponse.
  
  I found some terms in scope that have matching names and types. Maybe you meant one of these:
  
    - services.handleServiceHttpRequest : ServerState -> cloud_4_6_6.ServiceHash aws_4_0_0.lib.http.HttpRequest aws_4_0_0.lib.http.HttpResponse -> aws_4_0_0.lib.http.HttpRequest ->{IO, Abort, Random, logging.Log Event} aws_4_0_0.lib.http.HttpResponse
    - services.handleServiceHttpRequest : ServerState -> cloud_4_6_6.ServiceHash aws_4_0_0.lib.http.HttpRequest aws_4_0_0.lib.http.HttpResponse -> aws_4_0_0.lib.http.HttpRequest ->{IO, Abort, Random, logging.Log Event} aws_4_0_0.lib.http.HttpResponse

Notice that the last two lines are identical, they are both referring to services.handleServiceHttpRequest, In reality there are two different names: websockets.handleServiceHttpRequest and http.handleServiceHttpRequest:

@cloud/nimbus/mergewebsockets> names handleServiceHttpRequest

  Terms
  Hash:   #obqniljoj0
  Names:  services.handleServiceHttpRequest
  
  Hash:   #t7t7sjdt73
  Names:  websockets.handleServiceHttpRequest
  
  Tip: Use `names.global` to see more results.

stew avatar Dec 11 '23 20:12 stew

Do you happen to have a branch on Share we can check out to reproduce?

mitchellwrosen avatar Dec 13 '23 15:12 mitchellwrosen

@stew

aryairani avatar May 01 '24 00:05 aryairani

Here is a transcript that reproduces the issue:

```ucm
.> project.create-empty proj
proj/main> builtins.merge
```

```unison
this.is.a.really_really_really_really.long.name_space.path.foo = "foo1"
this.is.another.really_really_really_really.long.name_space.path.foo = "foo2"

bar = foo
```

ceedubs avatar Jun 06 '24 14:06 ceedubs