On Sat, Oct 1, 2016 at 11:27 AM T L <tapir....@gmail.com> wrote:

> If they are predeclared, then is it meaningless to say their type names
originate in the same TypeSpec?
<https://golang.org/ref/spec#Type_declarations>

I don't know why do you think it's meaningless. byte and uint8 share the
same type specification, except it's not in the form of a Go source code
the compiler reads in some bootstrap stage. They are predeclared, always
known to the compiler. Hardcoded, if you prefer.

Here's an example in a Go compiler front end (WIP):
https://github.com/cznic/gc/blob/c3bc1381b6d1fb6498e2ef9f76002fc09554b3f8/context.go#L294
Later,
at line 317 and 318, the type aliases are set. You should be able to find
something similar somewhere in any other Go compiler front end.

-- 

-j

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to