Skip to content

Commit a3f1007

Browse files
committed
go/analysis/passes/loopclosure: remove token.TILDE given x/tools supports versions older than Go 1.18
1 parent eeaa1fb commit a3f1007

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

go/analysis/passes/loopclosure/filter.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,9 +328,10 @@ func (f *filter) skipExpr(expr ast.Expr) bool {
328328
case *ast.UnaryExpr:
329329
switch x.Op {
330330
// See https://go.dev/ref/spec#UnaryExpr
331-
case token.ADD, token.SUB, token.NOT, token.XOR, token.AND, token.TILDE:
331+
case token.ADD, token.SUB, token.NOT, token.XOR, token.AND:
332332
// We disallow token.MUL because we currently do not want to allow dereference.
333333
// We also disallow token.ARROW because it can cause a wait.
334+
// TODO: allow token.TILDE once Go 1.18 is the earliest supported version for x/tools.
334335
// TODO: confirm token.AND is not allowing more address operations than we expect.
335336
return f.skipExpr(x.X)
336337
}

0 commit comments

Comments
 (0)