Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gnovm): pass parameter previous path to FindEmbeddedFieldType methods #3242

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading