go issue39938 源码

  • 2022-07-15
  • 浏览 (855)

golang issue39938 代码

文件路径:/src/cmd/compile/internal/types2/testdata/fixedbugs/issue39938.go

// Copyright 2020 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 p

// All but E2 and E5 provide an "indirection" and break infinite expansion of a type.
type E0[P any] []P
type E1[P any] *P
type E2[P any] struct{ _ P }
type E3[P any] struct{ _ *P }
type E5[P any] struct{ _ [10]P }

type T0 struct {
        _ E0[T0]
}

type T0_ struct {
        E0[T0_]
}

type T1 struct {
        _ E1[T1]
}

type T2 /* ERROR illegal cycle */ struct {
        _ E2[T2]
}

type T3 struct {
        _ E3[T3]
}

type T4 /* ERROR illegal cycle */ [10]E5[T4]

type T5 struct {
	_ E0[E2[T5]]
}

type T6 struct {
	_ E0[E2[E0[E1[E2[[10]T6]]]]]
}

type T7 struct {
	_ E0[[10]E2[E0[E2[E2[T7]]]]]
}

type T8 struct {
	_ E0[[]E2[E0[E2[E2[T8]]]]]
}

type T9 /* ERROR illegal cycle */ [10]E2[E5[E2[T9]]]

type T10 [10]E2[E5[E2[func(T10)]]]

相关信息

go 源码目录

相关文章

go issue20583 源码

go issue23203a 源码

go issue23203b 源码

go issue25838 源码

go issue26390 源码

go issue28251 源码

go issue39634 源码

go issue39664 源码

go issue39680 源码

go issue39693 源码

0  赞