Commit 26e43779 authored by Robert Griesemer's avatar Robert Griesemer

Revert "cmd/vet: teach vet about ast.AliasSpec"

This reverts commit aa8c8e77.

Reason: Decision to back out current alias implementation.

For #16339.

Change-Id: I4db9a8d6b3625c794be9d2f1ff0e9c047f383d28
Reviewed-on: https://go-review.googlesource.com/32827
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarChris Manghane <cmang@golang.org>
parent 8e970536
......@@ -61,10 +61,7 @@ func checkCopyLocksGenDecl(f *File, gd *ast.GenDecl) {
return
}
for _, spec := range gd.Specs {
valueSpec, ok := spec.(*ast.ValueSpec)
if !ok {
continue
}
valueSpec := spec.(*ast.ValueSpec)
for i, x := range valueSpec.Values {
if path := lockPathRhs(f, x); path != nil {
f.Badf(x.Pos(), "variable declaration copies lock value to %v: %v", valueSpec.Names[i].Name, path)
......
......@@ -188,7 +188,8 @@ func checkShadowDecl(f *File, d *ast.GenDecl) {
for _, spec := range d.Specs {
valueSpec, ok := spec.(*ast.ValueSpec)
if !ok {
continue
f.Badf(spec.Pos(), "invalid AST: var GenDecl not ValueSpec")
return
}
// Don't complain about deliberate redeclarations of the form
// var i = i
......
package testdata
import (
"runtime"
"sync"
"sync/atomic"
)
......@@ -157,11 +156,3 @@ func AtomicTypesCheck() {
vP := &vX
vZ := &atomic.Value{}
}
// ensure we don't crash when we encounter aliases; issue 17755
var _ => runtime.MemProfileRate
const _ => runtime.Compiler
type _ => sync.Mutex
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment