-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/compile: spurious inference error with undefined value #60434
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
Comments
Hi, can I try fixing it? I am new to GO, not sure if I will be able to anyways |
Dont wanna sound dumb, but should I look into the slices package or some other package to get a fix? |
Really?
…On Sun, May 28, 2023 at 11:43 AM Gyanendra Singh ***@***.***> wrote:
Hi, can I try fixing it? I am new to GO, not sure if I will be able to
anyways
—
Reply to this email directly, view it on GitHub
<#60434 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/A65XM66C2ZLIAXPZ6UGQDIDXINXDFANCNFSM6AAAAAAYPCWMWI>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
@gyanendrasng This is a compiler issue; the only relation to the slices package is that the example uses slices. I prefer fixing this myself - also this is not urgent. But thanks for offer. |
Here is another related issue. This one might be worth fixing for Go 1.21 if it's an easy fix. The error message does not explain enough about the context:
It would be helpful to say what function is being called and what S is, as in:
In my actual program, I had imported slices and written append(slices.Clip(versions), more things), and all I got was Eventually I removed the call to slices.Clip entirely and that left me with:
That made clear what I'd done wrong, by telling me the type of versions. Even when I started this bug report I hadn't figured that out yet and thought versions was simply an undeclared variable (my actual bug was deleting the local declaration of versions without updating the slices.Clip call). |
Moved the related issue into it's own issue #60542. |
problem: why the first error printed before the second error. it means why the first error occurred when the second one is the reason of first one!?
and what you get is this:
and it is obvious that now priority of them are different for the compiler. |
Change https://go.dev/cl/543176 mentions this issue: |
The first error should not be printed, since it is caused by the second error.
The text was updated successfully, but these errors were encountered: