On Fri, May 8, 2020 at 3:29 PM Christoph Berger
<christophberger....@gmail.com> wrote:

> So I conclude that the assignment of *int to intp succeeds because *int is 
> not a defined type and both *int and intp have the same underlying type *int.
>
> Looking through the ref spec I found a couple of places that mention some 
> defined types (esp., all numeric types and string). Is there an exhaustive 
> list available of all predefined types that technically count as defined 
> types?

Predeclared types are listed here:
https://golang.org/ref/spec#Predeclared_identifiers in the section
"Types:"

Note that they do not "technically count". If 'name' is binded to a
type in a declaration then type 'name' is a defined type. The rule is
universal. The difference is that eg. `*int` is not a name
(identifier), so it's a type literal defining a pointer to a
named/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-U9L6f7jPTFSMZQYXcw9wumv0E7o0tnZt-SY2R5yjFhGw%40mail.gmail.com.

Reply via email to