(tp type_path, scope *scope)
| 559 | } |
| 560 | |
| 561 | func lookup_path(tp type_path, scope *scope) *decl { |
| 562 | if tp.is_nil() { |
| 563 | return nil |
| 564 | } |
| 565 | var decl *decl |
| 566 | if tp.pkg != "" { |
| 567 | decl = scope.lookup(tp.pkg) |
| 568 | // return nil early if the package wasn't found but it's part |
| 569 | // of the type specification |
| 570 | if decl == nil { |
| 571 | return nil |
| 572 | } |
| 573 | } |
| 574 | |
| 575 | if decl != nil { |
| 576 | if tp.name != "" { |
| 577 | return decl.find_child(tp.name) |
| 578 | } else { |
| 579 | return decl |
| 580 | } |
| 581 | } |
| 582 | |
| 583 | return scope.lookup(tp.name) |
| 584 | } |
| 585 | |
| 586 | func lookup_pkg(tp type_path, scope *scope) string { |
| 587 | if tp.is_nil() { |
no test coverage detected