1
0
mirror of https://github.com/golang/go synced 2024-09-30 08:28:34 -06:00
go/test/fixedbugs/issue20415.go
Matthew Dempsky ca8e17164e [dev.regabi] all: merge master into dev.regabi
The list of conflicted files for this merge is:

   src/cmd/compile/internal/gc/inl.go
   src/cmd/compile/internal/gc/order.go
   src/cmd/compile/internal/gc/ssa.go
   test/fixedbugs/issue20415.go
   test/fixedbugs/issue22822.go
   test/fixedbugs/issue28079b.go

inl.go was updated for changes on dev.regabi: namely that OSELRECV has
been removed, and that OSELRECV2 now only uses List, rather than both
Left and List.

order.go was updated IsAutoTmp is now a standalone function, rather
than a method on Node.

ssa.go was similarly updated for new APIs involving package ir.

The tests are all merging upstream additions for gccgo error messages
with changes to cmd/compile's error messages on the dev.regabi branch.

Change-Id: Icaaf186d69da791b5994dbb6688ec989caabec42
2020-12-21 11:19:04 -08:00

34 lines
599 B
Go

// errorcheck
// Copyright 2017 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Make sure redeclaration errors report correct position.
package p
// 1
var f byte
var f interface{} // ERROR "issue20415.go:12: previous declaration|redefinition"
func _(f int) {
}
// 2
var g byte
func _(g int) {
}
var g interface{} // ERROR "issue20415.go:20: previous declaration|redefinition"
// 3
func _(h int) {
}
var h byte
var h interface{} // ERROR "issue20415.go:31: previous declaration|redefinition"