1// errorcheck 2 3// Copyright 2017 The Go Authors. All rights reserved. 4// Use of this source code is governed by a BSD-style 5// license that can be found in the LICENSE file. 6 7package main 8 9type T0 T0 // ERROR "invalid recursive type" 10type _ map[T0]int 11 12type T1 struct{ T1 } // ERROR "invalid recursive type" 13type _ map[T1]int 14 15func f() { 16 type T2 T2 // ERROR "invalid recursive type" 17 type _ map[T2]int 18} 19 20func g() { 21 type T3 struct{ T3 } // ERROR "invalid recursive type" 22 type _ map[T3]int 23} 24 25func h() { 26 type T4 struct{ m map[T4]int } // ERROR "invalid map key" 27 type _ map[T4]int // GC_ERROR "invalid map key" 28} 29