github.com/JimmyHuang454/JLS-go@v0.0.0-20230831150107-90d536585ba0/internal/types/testdata/fixedbugs/issue39982.go (about) 1 // Copyright 2020 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package p 6 7 type ( 8 T[_ any] struct{} 9 S[_ any] struct { 10 data T[*T[int]] 11 } 12 ) 13 14 func _() { 15 _ = S[int]{ 16 data: T[*T[int]]{}, 17 } 18 } 19 20 // full test case from issue 21 22 type ( 23 Element[TElem any] struct{} 24 25 entry[K comparable] struct{} 26 27 Cache[K comparable] struct { 28 data map[K]*Element[*entry[K]] 29 } 30 ) 31 32 func _() { 33 _ = Cache[int]{ 34 data: make(map[int](*Element[*entry[int]])), 35 } 36 }