title: Type has not field or method Read (but it does)
body: <p>I'm stumped on this one.  In the project that I'm working on, we generate go code from Thrift.  The code gets created in the package A/B/thriftapi (which used to be A/B/thrift which was causing problems because all of the generated code was importing <code>git.apache.org/thrift.git/lib/go/thrift</code> and causing name collisions).  </p>
  
  <p>I generated the code and moved the code into <code>$GOPATH/src/A/B/D</code>  I then tried to build my project and was getting tons of errors of the form:</p>
  
  <pre><code>p.X.Read undefined (type Foo has no field or method Read)
  </code></pre>
  
  <p>I looked at one of the offending lines:</p>
  
  <pre><code>import (
      "A/B/D"
      "git.apache.org/thrift.git/lib/go/thrift"
  )
  
  func(p *Bar) readField1(iprot thrift.TProtocol) error {
      p.X = D.NewFoo()
      if err := p.X.Read(iprot); err != nil { 
      ...
   }
  </code></pre>
  
  <p>Since I am using IntelliJ, I CTRL+clicked on the <code>Read()</code> method and sure enough it jumps to <code>$GOPATH/A/B/D/ttypes.go</code> to the method</p>
  
  <pre><code>func (p *Foo) Read(iprot thrift.TProtocol) error {
      ...
  }
  </code></pre>
  
  <p>That's exactly the file I'd expect the method to be in, and it's a method on a pointer to <code>Foo</code> so no problems there.  Everything seems like it should be right, but both in IntelliJ and on the command line I get these problems.  </p>
  
  <p>Any ideas what might be going wrong?  It's frustrating when it tells me the method doesn't exist, yet will take me right to it if I click on it (and also pops up in the intellisense) </p>
  
  <p>EDIT - Per comment</p>
  
  <pre><code>type Bar struct {
     X Foo `thrift:"x,1,required"`    
  }
  </code></pre>