On Fri, May 8, 2020 at 4:31 PM Christoph Berger <christophberger....@gmail.com> wrote:
> Unfortunately, the connection between "predeclared" (or "implicitly declared" > as the first paragraph says) and "defined" is not at all obvious. Especially > as the definition of "defined type" refers to types explicitly declared via > the "type" keyword. The definition of "defined type" is correct and simple, no special rules exists. The predeclared identifier `int` is declared that way, except it's done by the compiler without the need to do it in user code. See here: https://godoc.org/builtin#int Of course, the builtin package is only a formal definiton, it has special treatment by the compiler, so doing the same in user code would be invalid. Still `int` is defined and treated as `type int something` and it's thus a defined(named) type. In the first approximation, any type represented by a name is a defined type. Later came type aliases, so now it's a bit more complicated b/c one can write also `type T = []U` where T is not a defined type b/c []U is not a defined type. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAA40n-WzJAWpg4TEcW%2BZ2G-1zcUFNiSS0ezJtz6077Z4U3uwUQ%40mail.gmail.com.