func checkSliceExpr(slice *ast.SliceExpr, env Env) (*SliceExpr, []error) {
	aexpr := &SliceExpr{SliceExpr: slice}
	x, errs := CheckExpr(slice.X, env)
	aexpr.X = x
	if errs != nil && !x.IsConst() {
		return aexpr, errs
	}
	t, err := expectSingleType(x)
	if err != nil {
		return aexpr, append(errs, err)
	}
	if t.Kind() == reflect.Array && !isAddressable(x) {
		return aexpr, append(errs, ErrUnaddressableSliceOperand{aexpr})
	}
	if t.Kind() == reflect.Ptr && t.Elem().Kind() == reflect.Array {
		t = t.Elem()
	}
	switch t.Kind() {
	case reflect.Array, reflect.Slice, reflect.String:
		var l, h int
		var low, high Expr
		var moreErrs []error
		if t == ConstString {
			aexpr.knownType = knownType{stringType}
		} else {
			aexpr.knownType = knownType(x.KnownType())
		}
		if slice.Low != nil {
			low, l, moreErrs = checkSliceVectorExpr(x, slice.Low, env)
			aexpr.Low = low
			if moreErrs != nil {
				errs = append(errs, moreErrs...)
				if !low.IsConst() {
					return aexpr, errs
				}
			}
		}
		if slice.High != nil {
			high, h, moreErrs = checkSliceVectorExpr(x, slice.High, env)
			aexpr.High = high
			if moreErrs != nil {
				errs = append(errs, moreErrs...)
				if !high.IsConst() {
					return aexpr, errs
				}
			}
			if low != nil && low.IsConst() && high.IsConst() && !(l <= h) {
				errs = append(errs, ErrInvalidSliceIndex{aexpr})
			}
		}
		return aexpr, errs
	default:
		return aexpr, append(errs, ErrInvalidSliceOperation{aexpr})
	}
}
TODO[crc] support [::] syntax after go1.2 upgrade
package eval
import (
	"reflect"
	"go/ast"
)