Closed
Description
[split out of https://github.com//issues/70815#issuecomment-2598663385]
@findleyr says:
I encountered a bug in the slices.Contains modernizer today.
Modernizing using slices.Contains here results in an error:
https://cs.opensource.google/go/x/tools/+/master:gopls/internal/golang/highlight.go;l=348;drc=344e48255740736de8c8277e9a286cf3231c7e13
case *ast.CallExpr:
// If cursor is an arg in a callExpr, we don't want control flow highlighting.
if i > 0 {
for _, arg := range n.Args {
if arg == path[i-1] {
return
}
}
}
Error is: S (type []ast.Expr) does not satisfy ~[]E
.
For now, I think we need to check that the types in the match condition are identical.
Activity