Skip to content

Commit

Permalink
Allow TypeNames from external packages (#1599)
Browse files Browse the repository at this point in the history
Co-authored-by: George Pollard <[email protected]>
  • Loading branch information
theunrepentantgeek and Porges authored Jun 26, 2021
1 parent f40b9a7 commit 9f78d9e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions hack/generator/pkg/astmodel/type_walker.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ func (t *TypeWalker) visitTypeName(this *TypeVisitor, it TypeName, ctx interface
panic(fmt.Sprintf("TypeWalker visitor visitTypeName must return a TypeName, instead returned %T", visitedTypeName))
}

if _, isLocal := it.PackageReference.AsLocalPackage(); !isLocal {
// Non-local type names are fine, we can exit early
return it, nil
}

def, ok := t.allTypes[it]
if !ok {
return nil, errors.Errorf("couldn't find type %q", it)
Expand Down

0 comments on commit 9f78d9e

Please sign in to comment.