From 8201e96adbce169380aeae93a27948b51918d68b Mon Sep 17 00:00:00 2001 From: jinoosss Date: Wed, 13 Nov 2024 18:36:29 +0900 Subject: [PATCH] fix: change-the-call-path-in-find-embedded-field-type --- gnovm/pkg/gnolang/types.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnovm/pkg/gnolang/types.go b/gnovm/pkg/gnolang/types.go index eedb71ffa73..ea725c27ba4 100644 --- a/gnovm/pkg/gnolang/types.go +++ b/gnovm/pkg/gnolang/types.go @@ -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 { @@ -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 @@ -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 }