Hi all,  I have been banging my head on this all day.  I am doinking around 
in some code-generation and find myself deep into the go/types package.

Given code like:

```
type E1 string
type E2 E1
```

I loaded the package with x/tools/go/packages.  I got the root scope via 
`pkg.Types.Scope()`.  I did a `Lookup(typename)` and got a `TypeName` 
back.  `TypeName.Type()` gets me a `Named`.

Here's where I am stuck.

In the debugger I can see that E1 and E2 are different.  E1's `fromRHS` 
field tells me it is a `go/types.Basic` with `.name` =  "string".  E2's 
`fromRHS` tells me it is `go/types.Named` which is an E1.

Awesome - that is what I want.  But I can't figure out how to learn that 
through the public API.  AFAICT, `fromRHS` is only used internally and 
calling `Underlying()` on E1 and E2 yields a string in both cases.

Is there any way to learn what I am trying to learn?  The information is 
THERE but I can't seem to get at it.

Tim

-- 
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/0e4da407-7e14-42e7-90e2-05f322509232n%40googlegroups.com.

Reply via email to