From a7774552c125c09a5a40ec5954a5dd816cf4dd47 Mon Sep 17 00:00:00 2001 From: SimFG Date: Thu, 1 Aug 2024 16:20:10 +0800 Subject: [PATCH] rebase the origin master branch --- checker/checker.go | 14 ++++++++------ vm/runtime/runtime.go | 1 - 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/checker/checker.go b/checker/checker.go index ea402611..46911a3e 100644 --- a/checker/checker.go +++ b/checker/checker.go @@ -478,13 +478,15 @@ func (v *checker) MemberNode(node *ast.MemberNode) Nature { if m, ok := base.MethodByName(name.Value); ok { return m } - if m, ok := reflect.PtrTo(base).MethodByName(name.Value); ok { - if kind(base) == reflect.Interface { - return m.Type, info{} + if m, ok := reflect.PtrTo(base.Type).MethodByName(name.Value); ok { + if kind(base.Type) == reflect.Interface { + // return m.Type, info{} + return Nature{Type: m.Type} } else { - node.SetMethodIndex(m.Index) - node.Name = name.Value - return m.Type, info{method: true} + // node.SetMethodIndex(m.Index) + // node.Name = name.Value + // return m.Type, info{method: true} + return Nature{Type: m.Type, Method: true} } } } diff --git a/vm/runtime/runtime.go b/vm/runtime/runtime.go index 3b9b5ef2..3cba9fea 100644 --- a/vm/runtime/runtime.go +++ b/vm/runtime/runtime.go @@ -7,7 +7,6 @@ import ( "math" "reflect" "unsafe" -) "github.com/expr-lang/expr/internal/deref" )