1
0
mirror of https://github.com/golang/go synced 2024-11-13 18:10:24 -07:00
go/test/fixedbugs/bug215.go
Ian Lance Taylor 84e7cb0611 Tweak test to work with both 6g and gccgo.
Pull the struct into a single line, since 6g reports the error
on the last line of the struct definition and gccgo reports it
on the first line.

6g:
bug215.go:12: invalid recursive type A

gccgo:
bug215.go:12:6: error: invalid recursive type ‘A’

R=rsc
https://golang.org/cl/180044
2009-12-15 13:57:24 -08:00

15 lines
373 B
Go

// errchk $G $D/$F.go
// 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.
// Used to crash the compiler.
// http://code.google.com/p/go/issues/detail?id=158
package main
type A struct { a A } // ERROR "recursive"
func foo() { new(A).bar() }
func (a A) bar() {}