When a define statement relies on a selector or type that may exist in another file it should revisit once GTA is complete. This allows that revisit. **Note:** In order to keep the original GTA error for the define statement, so the error received is correct and meaningful, I have added a node `meta` property. I decided to make it generic as it may be useful in future. There may be a better way to stash errors across the GTA runs and am open to suggestion here. Fixes #1253
33 lines
336 B
Go
33 lines
336 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"sync"
|
|
|
|
"github.com/traefik/yaegi/_test/method38"
|
|
)
|
|
|
|
func NewPool() Pool { return Pool{} }
|
|
|
|
type Buffer struct {
|
|
bs []byte
|
|
pool Pool
|
|
}
|
|
|
|
type Pool struct {
|
|
p *sync.Pool
|
|
}
|
|
|
|
var (
|
|
_pool = NewPool()
|
|
Get = _pool.Get
|
|
)
|
|
|
|
|
|
func main() {
|
|
fmt.Println(Get())
|
|
}
|
|
|
|
// Error:
|
|
// 17:11: undefined selector Get
|