operator-dot.go: replaced []any with *ListType
This commit is contained in:
parent
434ddee733
commit
f55a48aa26
@ -47,10 +47,11 @@ func evalDot(ctx ExprContext, self *term) (v any, err error) {
|
|||||||
indexTerm := self.children[1]
|
indexTerm := self.children[1]
|
||||||
|
|
||||||
switch unboxedValue := leftValue.(type) {
|
switch unboxedValue := leftValue.(type) {
|
||||||
case []any:
|
case *ListType:
|
||||||
var index int
|
var index int
|
||||||
if index, err = verifyIndex(ctx, indexTerm, len(unboxedValue)); err == nil {
|
array := ([]any)(*unboxedValue)
|
||||||
v = unboxedValue[index]
|
if index, err = verifyIndex(ctx, indexTerm, len(array)); err == nil {
|
||||||
|
v = array[index]
|
||||||
}
|
}
|
||||||
case string:
|
case string:
|
||||||
var index int
|
var index int
|
||||||
|
Loading…
Reference in New Issue
Block a user