Skip to content

Commit 76664a6

Browse files
committed
Fix errors in checker
1 parent 282244d commit 76664a6

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

checker/checker.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ func (v *visitor) MemberNode(node *ast.MemberNode) (reflect.Type, info) {
434434
// First, check methods defined on base type itself,
435435
// independent of which type it is. Without dereferencing.
436436
if m, ok := base.MethodByName(name.Value); ok {
437-
if base.Kind() == reflect.Interface {
437+
if kind(base) == reflect.Interface {
438438
// In case of interface type method will not have a receiver,
439439
// and to prevent checker decreasing numbers of in arguments
440440
// return method type as not method (second argument is false).
@@ -452,11 +452,11 @@ func (v *visitor) MemberNode(node *ast.MemberNode) (reflect.Type, info) {
452452
}
453453
}
454454

455-
if base.Kind() == reflect.Ptr {
455+
if kind(base) == reflect.Ptr {
456456
base = base.Elem()
457457
}
458458

459-
switch base.Kind() {
459+
switch kind(base) {
460460
case reflect.Interface:
461461
return anyType, info{}
462462

compiler/compiler_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ func TestCompile_panic(t *testing.T) {
285285
`(TotalPosts.Profile[Authors > TotalPosts == get(nil, TotalLikes)] > Authors) ^ (TotalLikes / (Posts?.PublishDate[TotalPosts] < Posts))`,
286286
`one(Posts, nil)`,
287287
`trim(TotalViews, Posts) <= get(Authors, nil)`,
288+
`Authors.IsZero(nil * Authors) - (TotalViews && Posts ? nil : nil)[TotalViews.IsZero(false, " ").IsZero(Authors)]`,
288289
}
289290
for _, test := range tests {
290291
t.Run(test, func(t *testing.T) {

0 commit comments

Comments
 (0)