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

go/types, types2: better error messages for copy, others #49735

Closed
griesemer opened this issue Nov 22, 2021 · 5 comments
Closed

go/types, types2: better error messages for copy, others #49735

griesemer opened this issue Nov 22, 2021 · 5 comments
Assignees
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@griesemer
Copy link
Contributor

Reminder issue. The compiler prints more descriptive errors, especially in the presence of untyped nils.

See also #48852.

@griesemer griesemer added the NeedsFix The path to resolution is known, but the work has not been done. label Nov 22, 2021
@griesemer griesemer added this to the Go1.18 milestone Nov 22, 2021
@griesemer griesemer self-assigned this Nov 22, 2021
@griesemer
Copy link
Contributor Author

cc: @findleyr

@gopherbot
Copy link

Change https://golang.org/cl/366276 mentions this issue: cmd/compile/internal/types2: print "nil" rather than "untyped nil"

gopherbot pushed a commit that referenced this issue Nov 22, 2021
When we have a typed nil, we already say so; thus it is sufficient
to use "nil" in all the other cases.

This is closer to (1.17) compiler behavior. In cases where the
1.17 compiler prints "untyped nil" (e.g., wrong uses of "copy"),
we already print a different message. We can do better in those
cases as well; will be addressed in a separate CL (see #49735).

Fixes #48852.

Change-Id: I9a7a72e0f99185b00f80040c5510a693b1ea80f6
Reviewed-on: https://go-review.googlesource.com/c/go/+/366276
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
@griesemer
Copy link
Contributor Author

The CL above addresses the concern for append, which is perhaps the most important case.
Moving to 1.19 for the rest.

@griesemer griesemer changed the title go/types, types2: better error messages for append, copy, etc. go/types, types2: better error messages for copy, others Feb 9, 2022
@griesemer griesemer modified the milestones: Go1.18, Go1.19 Feb 9, 2022
@gopherbot
Copy link

Change https://go.dev/cl/384615 mentions this issue: go/types, types2: better error messages for append

gopherbot pushed a commit that referenced this issue Feb 9, 2022
For #49735.

Change-Id: Ib7343061dca0e8d848e0719d39be0393d7cfad93
Reviewed-on: https://go-review.googlesource.com/c/go/+/384615
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
@griesemer
Copy link
Contributor Author

The error messages for copy, append with respect to nil (untyped nil) seem ok and match pre-1.18 behavior.
If there are specific cases that don't look right, we can file issues for those.
Closing.

@golang golang locked and limited conversation to collaborators Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
Development

No branches or pull requests

2 participants