Skip to content

Commit

Permalink
rebase the origin master branch
Browse files Browse the repository at this point in the history
  • Loading branch information
SimFG committed Aug 1, 2024
1 parent 12f0cff commit a777455
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
14 changes: 8 additions & 6 deletions checker/checker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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}
}
}
}
Expand Down
1 change: 0 additions & 1 deletion vm/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"math"
"reflect"
"unsafe"
)

"github.com/expr-lang/expr/internal/deref"
)
Expand Down

0 comments on commit a777455

Please sign in to comment.