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

Comments

Projects
None yet
3 participants
@FiloSottile
Copy link
Member

commented May 9, 2018

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 this to the Go1.11 milestone May 9, 2018

@mvdan mvdan self-assigned this May 9, 2018

@mvdan

This comment has been minimized.

Copy link
Member

commented May 9, 2018

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

@gopherbot

This comment has been minimized.

Copy link

commented May 9, 2018

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

@gopherbot gopherbot closed this in 2486ebf May 9, 2018

@golang golang locked and limited conversation to collaborators May 9, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.