mirror of
https://github.com/golang/go
synced 2024-11-22 00:04:41 -07:00
cmd/gc: test for issue 3552
R=rsc CC=golang-dev https://golang.org/cl/6128051
This commit is contained in:
parent
c1c851bbe8
commit
81d9621534
28
test/bugs/bug434.dir/one.go
Normal file
28
test/bugs/bug434.dir/one.go
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
// 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 one
|
||||||
|
|
||||||
|
// Issue 3552
|
||||||
|
|
||||||
|
type T struct { int }
|
||||||
|
|
||||||
|
func (t T) F() int { return t.int }
|
||||||
|
|
||||||
|
type U struct { int int }
|
||||||
|
|
||||||
|
func (u U) F() int { return u.int }
|
||||||
|
|
||||||
|
type lint int
|
||||||
|
|
||||||
|
type V struct { lint }
|
||||||
|
|
||||||
|
func (v V) F() int { return int(v.lint) }
|
||||||
|
|
||||||
|
type W struct { lint lint }
|
||||||
|
|
||||||
|
func (w W) F() int { return int(w.lint) }
|
||||||
|
|
||||||
|
|
||||||
|
|
22
test/bugs/bug434.dir/two.go
Normal file
22
test/bugs/bug434.dir/two.go
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
// 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.
|
||||||
|
|
||||||
|
// Use the functions in one.go so that the inlined
|
||||||
|
// forms get type-checked.
|
||||||
|
|
||||||
|
package two
|
||||||
|
|
||||||
|
import "./one"
|
||||||
|
|
||||||
|
func use() {
|
||||||
|
var t one.T
|
||||||
|
var u one.U
|
||||||
|
var v one.V
|
||||||
|
var w one.W
|
||||||
|
|
||||||
|
_ = t.F()
|
||||||
|
_ = u.F()
|
||||||
|
_ = v.F()
|
||||||
|
_ = w.F()
|
||||||
|
}
|
7
test/bugs/bug434.go
Normal file
7
test/bugs/bug434.go
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
// $G $D/$F.dir/one.go && $G $D/$F.dir/two.go || echo BUG:bug434
|
||||||
|
|
||||||
|
// Copyright 2011 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 ignored
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
package one
|
package one
|
||||||
|
|
||||||
|
// Issue 2687
|
||||||
type T struct { int }
|
type T struct { int }
|
||||||
|
|
||||||
func New(i int) T { return T{i} }
|
func New(i int) T { return T{i} }
|
||||||
|
@ -22,3 +22,7 @@ throw: all goroutines are asleep - deadlock!
|
|||||||
|
|
||||||
=========== bugs/bug395.go
|
=========== bugs/bug395.go
|
||||||
bug395 is broken
|
bug395 is broken
|
||||||
|
|
||||||
|
=========== bugs/bug434.go
|
||||||
|
bugs/bug434.dir/two.go:10: one.t.int undefined (cannot refer to unexported field or method one.int)
|
||||||
|
BUG:bug434
|
||||||
|
Loading…
Reference in New Issue
Block a user