Skip to content

Commit

Permalink
fix: change-the-call-path-in-find-embedded-field-type
Browse files Browse the repository at this point in the history
  • Loading branch information
jinoosss committed Nov 28, 2024
1 parent 6433b86 commit 8201e96
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gnovm/pkg/gnolang/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ func (pt *PointerType) FindEmbeddedFieldType(callerPath string, n Name, m map[Ty
// Pointer to declared types and structs
// expose embedded methods and fields.
// See tests/selector_test.go for examples.
trail, hasPtr, rcvr, field, accessError = findEmbeddedFieldType(callerPath, cet, n, m)
trail, hasPtr, rcvr, field, accessError = findEmbeddedFieldType(cet.GetPkgPath(), cet, n, m)
if trail != nil { // found
hasPtr = true // pt *is* a pointer.
switch trail[0].Type {
Expand Down Expand Up @@ -991,7 +991,7 @@ func (it *InterfaceType) FindEmbeddedFieldType(callerPath string, n Name, m map[
}
if et, ok := baseOf(im.Type).(*InterfaceType); ok {
// embedded interfaces must be recursively searched.
trail, hasPtr, rcvr, ft, accessError = et.FindEmbeddedFieldType(callerPath, n, m)
trail, hasPtr, rcvr, ft, accessError = et.FindEmbeddedFieldType(et.PkgPath, n, m)
if accessError {
// XXX make test case and check against go
return nil, false, nil, nil, true
Expand Down Expand Up @@ -1642,7 +1642,7 @@ func (dt *DeclaredType) FindEmbeddedFieldType(callerPath string, n Name, m map[T
}
}
// Otherwise, search base.
trail, hasPtr, rcvr, ft, accessError = findEmbeddedFieldType(callerPath, dt.Base, n, m)
trail, hasPtr, rcvr, ft, accessError = findEmbeddedFieldType(dt.PkgPath, dt.Base, n, m)
if trail == nil {
return nil, false, nil, nil, accessError
}
Expand Down

0 comments on commit 8201e96

Please sign in to comment.