interp: fix derivation of type of slice expression of binary object
Fixes #1328.
This commit is contained in:
@@ -854,6 +854,14 @@ func nodeType2(interp *Interpreter, sc *scope, n *node, seen []*node) (t *itype,
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if t.cat == valueT {
|
||||
switch t.rtype.Kind() {
|
||||
case reflect.Array, reflect.Ptr:
|
||||
t = valueTOf(reflect.SliceOf(t.rtype.Elem()), withScope(sc))
|
||||
}
|
||||
break
|
||||
}
|
||||
if t.cat == ptrT {
|
||||
t = t.val
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user