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
Milestone

Comments

@oiooj
Copy link
Member

@oiooj 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

@mdempsky mdempsky commented Aug 25, 2021

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

Loading

@toothrot toothrot added this to the Backlog milestone Aug 25, 2021
@griesemer
Copy link
Contributor

@griesemer griesemer commented Aug 25, 2021

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.

Loading

@griesemer griesemer closed this Aug 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants