2009-09-24 14:38:18 -06:00
|
|
|
// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: compos
|
|
|
|
|
|
|
|
// Copyright 2009 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
|
|
|
|
|
|
|
|
type T struct {
|
2010-09-03 18:36:13 -06:00
|
|
|
int
|
2009-09-24 14:38:18 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
func f() *T {
|
|
|
|
return &T{1}
|
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
2010-09-03 18:36:13 -06:00
|
|
|
x := f()
|
|
|
|
y := f()
|
2009-09-24 14:38:18 -06:00
|
|
|
if x == y {
|
2010-09-03 18:36:13 -06:00
|
|
|
panic("not allocating & composite literals")
|
2009-09-24 14:38:18 -06:00
|
|
|
}
|
|
|
|
}
|