mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/gc: Don't accept qualified names as literal keys
Fixes #4067. R=golang-dev, minux.ma, dave, rsc CC=golang-dev https://golang.org/cl/6622056
This commit is contained in:
parent
d7b7957db1
commit
87c35d8df1
2 changed files with 25 additions and 4 deletions
19
test/fixedbugs/bug462.go
Normal file
19
test/fixedbugs/bug462.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
// errorcheck
|
||||
|
||||
// Copyright 2012 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.
|
||||
|
||||
package main
|
||||
|
||||
import "os"
|
||||
|
||||
type T struct {
|
||||
File int
|
||||
}
|
||||
|
||||
func main() {
|
||||
_ = T {
|
||||
os.File: 1, // ERROR "unknown T field"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue