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/vet: builtin calls now return hasSideEffects false #25303

Closed
FiloSottile opened this issue May 9, 2018 · 2 comments
Closed

cmd/vet: builtin calls now return hasSideEffects false #25303

FiloSottile opened this issue May 9, 2018 · 2 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@FiloSottile
Copy link
Contributor

https://golang.org/cl/111416 made hasSideEffects return false when CallExpr.Fun has a true IsValue, but "Builtins are not considered values."

This showed up in https://golang.org/cl/112255, where a call to len started being recognized as having no side-effects. len indeed has no side effects, and it's probably a useful change as shown by the spotted new issue.

However, I suspect not all built-ins are side-effects free.

/cc @griesemer @mvdan

@FiloSottile FiloSottile added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label May 9, 2018
@FiloSottile FiloSottile added this to the Go1.11 milestone May 9, 2018
@mvdan mvdan self-assigned this May 9, 2018
@mvdan
Copy link
Member

mvdan commented May 9, 2018

Thanks for noticing so quickly! This was indeed unintended behavior. I'll send a fix right away.

@gopherbot
Copy link

Change https://golang.org/cl/112177 mentions this issue: cmd/vet: assume that no builtin funcs are pure

@golang golang locked and limited conversation to collaborators May 9, 2019
@rsc rsc unassigned mvdan Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

3 participants