blob: d7a6122d07a7a99c20e3ce7e0f57d27b054d2bcc [file] [log] [blame]
Colin Cross7bb052a2015-02-03 12:59:37 -08001//gofmt -r=x+x->2*x
2
3// Copyright 2011 The Go Authors. All rights reserved.
4// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file.
6
7// Rewriting of expressions containing nodes with associated comments to
8// expressions without those nodes must also eliminate the associated
9// comments.
10
11package p
12
13func f(x int) int {
14 _ = x + x // this comment remains in the rewrite
15 _ = x /* this comment must not be in the rewrite */ + x
16 return x /* this comment must not be in the rewrite */ + x
17}