A Problem about The Go Programming Language Specification

when I read the chapter Type_identity of The Go Programming Language Specification, I find this code section:

type (
	A0 = []string
	A1 = A0
	A2 = struct{ a, b int }
	A3 = int
	A4 = func(A3, float64) *A0
	A5 = func(x int, _ float64) *[]string
)

type (
	B0 A0
	B1 []string
	B2 struct{ a, b int }
	B3 struct{ a, c int }
	B4 func(int, float64) *B0
	B5 func(x int, y float64) *A1
)

type	C0 = B0

and

A0, A1, and []string
A2 and struct{ a, b int }
A3 and int
A4, func(int, float64) *[]string, and A5

B0, B0, and C0
[]int and []int
struct{ a, b *T5 } and struct{ a, b *T5 }
func(x int, y float64) *[]string, func(int, float64) (result *[]string), and A5

the second code section has two B0. is it special mean or repeat words?

AFAIK it should be just “B0 and C0”. “A0” ([]string) and “B0” are distinct types.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.