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

cmd/compile: remove assert failed in types2 #47947

Closed
oiooj opened this issue Aug 25, 2021 · 2 comments
Closed

cmd/compile: remove assert failed in types2 #47947

oiooj opened this issue Aug 25, 2021 · 2 comments
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Milestone

Comments

@oiooj
Copy link
Member

oiooj commented Aug 25, 2021

We need start to clean assert func in types2, maybe we can use cmd/compile/internal/base package to report accurate errors. see: #47883

/cc @mdempsky

@mdempsky
Copy link
Member

types2 is meant to stay similar to go/types (i.e., decoupled from the rest of the compiler), and I'm not aware of any intent to remove the assert function. I'm not sure there's anything to coordinate here via an issue.

/cc @griesemer

@toothrot toothrot added the NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. label Aug 25, 2021
@toothrot toothrot added this to the Backlog milestone Aug 25, 2021
@griesemer
Copy link
Contributor

The assert calls in types2 are not there for error handling; they are there to express internal invariants that are expected to be true, even in the presence of errors in the type-checked code. Assertions that fail point to a bug in the code that needs to be fixed; similar to how an "index out of bounds" error points to an error in the code indexing the array or slice.

Closing as there is nothing to do here.

@golang golang locked and limited conversation to collaborators Aug 25, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made.
Projects
None yet
Development

No branches or pull requests

5 participants