2016-04-10 15:32:26 -06:00
|
|
|
// Copyright 2012 The Go Authors. All rights reserved.
|
2012-01-11 14:21:06 -07:00
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
// Functions that the inliner exported incorrectly.
|
|
|
|
|
2012-01-11 13:26:54 -07:00
|
|
|
package one
|
|
|
|
|
2012-01-11 14:21:06 -07:00
|
|
|
type T int
|
|
|
|
|
|
|
|
// Issue 2678
|
|
|
|
func F1(T *T) bool { return T == nil }
|
2012-01-11 13:26:54 -07:00
|
|
|
|
2012-01-11 14:21:06 -07:00
|
|
|
// Issue 2682.
|
|
|
|
func F2(c chan int) bool { return c == (<-chan int)(nil) }
|
2012-01-11 15:25:09 -07:00
|
|
|
|
2012-01-11 18:32:02 -07:00
|
|
|
// Use of single named return value.
|
|
|
|
func F3() (ret []int) { return append(ret, 1) }
|
|
|
|
|
2012-01-11 15:25:09 -07:00
|
|
|
// Call of inlined method with blank receiver.
|
|
|
|
func (_ *T) M() int { return 1 }
|
|
|
|
func (t *T) MM() int { return t.M() }
|
2012-02-06 04:19:59 -07:00
|
|
|
|
|
|
|
|
|
|
|
// One more like issue 2678
|
|
|
|
type S struct { x, y int }
|
|
|
|
type U []S
|
|
|
|
|
|
|
|
func F4(S int) U { return U{{S,S}} }
|
|
|
|
|
|
|
|
func F5() []*S {
|
|
|
|
return []*S{ {1,2}, { 3, 4} }
|
|
|
|
}
|
|
|
|
|
|
|
|
func F6(S int) *U {
|
|
|
|
return &U{{S,S}}
|
|
|
|
}
|
|
|
|
|
2012-02-08 22:26:08 -07:00
|
|
|
// Bug in the fix.
|
2012-02-06 04:19:59 -07:00
|
|
|
|
2012-02-08 22:26:08 -07:00
|
|
|
type PB struct { x int }
|
2012-02-06 04:19:59 -07:00
|
|
|
|
2012-02-08 22:26:08 -07:00
|
|
|
func (t *PB) Reset() { *t = PB{} }
|