diff --git a/current/fyne_io_fyne_v2/custom.go b/current/fyne_io_fyne_v2/custom.go new file mode 100644 index 0000000..d09bfd9 --- /dev/null +++ b/current/fyne_io_fyne_v2/custom.go @@ -0,0 +1,33 @@ +// Add your custom builtins to this file. + +package fyne_io_fyne_v2 + +import ( + "strings" + + "github.com/refaktor/rye/env" +) + +var builtinsCustom = map[string]*env.Builtin{ + "nil": { + Doc: "nil value for go types", + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + return *env.NewInteger(0) + }, + }, + "kind": { + Doc: "underlying kind of a go native", + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + nat, ok := arg0.(env.Native) + if !ok { + ps.FailureFlag = true + return env.NewError("kind: arg0: expected native") + } + s := ps.Idx.GetWord(nat.Kind.Index) + s = s[3 : len(s)-1] // remove surrounding "Go()" + s = strings.TrimPrefix(s, "*") // remove potential pointer "*" + return *env.NewString(s) + }, + }, + // Add your custom builtins here: +} diff --git a/current/fyne_io_fyne_v2/builtins.go b/current/fyne_io_fyne_v2/generated.go similarity index 63% rename from current/fyne_io_fyne_v2/builtins.go rename to current/fyne_io_fyne_v2/generated.go index 484453b..525558f 100644 --- a/current/fyne_io_fyne_v2/builtins.go +++ b/current/fyne_io_fyne_v2/generated.go @@ -1,5 +1,9 @@ // Code generated by ryegen. DO NOT EDIT. +// You can add custom binding code to builtins_custom.go! + +//go:build !b_no_fyne + package fyne_io_fyne_v2 import ( @@ -30,10 +34,23 @@ import ( "io" "net/url" "reflect" + "strconv" "testing" "time" ) +var Builtins map[string]*env.Builtin + +func init() { + Builtins = make(map[string]*env.Builtin, len(builtinsGenerated)+len(builtinsCustom)) + for k, v := range builtinsGenerated { + Builtins[k] = v + } + for k, v := range builtinsCustom { + Builtins[k] = v + } +} + // Force-use evaldo and env packages since tracking them would be too complicated var _ = evaldo.BuiltinNames var _ = env.Object(nil) @@ -46,6 +63,39 @@ func boolToInt64(x bool) int64 { return res } +func objectDebugString(idx *env.Idxs, v any) string { + if v, ok := v.(env.Object); ok { + return v.Inspect(*idx) + } else { + return "[Non-object of type " + reflect.TypeOf(v).String() + "]" + } +} + +func ifaceToNative(idx *env.Idxs, v any, ifaceName string) env.Native { + rV := reflect.ValueOf(v) + var typRyeName string + var ok bool + if rV.Type() != nil { + var typPfx string + if rV.Type().Kind() == reflect.Struct { + newRV := reflect.New(rV.Type()) + newRV.Elem().Set(rV) + rV = newRV + } + typ := rV.Type() + if typ.Kind() == reflect.Pointer { + typ = rV.Type().Elem() + typPfx = "*" + } + typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] + } + if ok { + return *env.NewNative(idx, rV.Interface(), typRyeName) + } else { + return *env.NewNative(idx, rV.Interface(), ifaceName) + } +} + var ryeStructNameLookup = map[string]string{ "fyne.io/fyne/v2.*Animation": "Go(*fyne.Animation)", "fyne.io/fyne/v2.*AppMetadata": "Go(*fyne.AppMetadata)", @@ -160,6 +210,7 @@ var ryeStructNameLookup = map[string]string{ "sync.*Once": "Go(*sync.Once)", "sync.*Pool": "Go(*sync.Pool)", "sync.*RWMutex": "Go(*sync.RWMutex)", + "sync.*WaitGroup": "Go(*sync.WaitGroup)", "sync/atomic.*Value": "Go(*atomic.Value)", } @@ -202,14 +253,14 @@ func ctxTo_binding_Bool(ps *env.ProgramState, v env.RyeCtx) (binding.Bool, error impl := &iface_binding_Bool{ self: v, } - ctxObj0, ok := wordToObj["Get"] + ctxObj0, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.Bool: expected context to have function Get") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.Bool: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.Bool: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) (bool, error) { actualFn := fn @@ -219,26 +270,29 @@ func ctxTo_binding_Bool(ps *env.ProgramState, v env.RyeCtx) (binding.Bool, error var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Bool: arg 0: callback result: expected block for multiple return values", + "context to binding.Bool: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Bool: arg 0: callback result: expected block with 2 return values", + "context to binding.Bool: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = v.Value != 0 + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Bool: arg 0: callback result: expected integer", + "context to binding.Bool: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -251,8 +305,9 @@ func ctxTo_binding_Bool(ps *env.ProgramState, v env.RyeCtx) (binding.Bool, error res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Bool: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.Bool: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -260,8 +315,9 @@ func ctxTo_binding_Bool(ps *env.ProgramState, v env.RyeCtx) (binding.Bool, error } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Bool: arg 0: callback result: expected error, string or nil", + "context to binding.Bool: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -270,23 +326,23 @@ func ctxTo_binding_Bool(ps *env.ProgramState, v env.RyeCtx) (binding.Bool, error return res0, res1 } default: - return nil, errors.New("context to binding.Bool: context fn Get: expected function") + return nil, errors.New("context to binding.Bool: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Set"] + ctxObj1, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.Bool: expected context to have function Set") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.Bool: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.Bool: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 bool) error { - var arg0Val env.Object - arg0Val = *env.NewInteger(boolToInt64(arg0)) + impl.fn_Set = func(ctx env.RyeCtx, farg0 bool) error { + var farg0Val env.Object + farg0Val = *env.NewInteger(boolToInt64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -295,8 +351,9 @@ func ctxTo_binding_Bool(ps *env.ProgramState, v env.RyeCtx) (binding.Bool, error res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Bool: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.Bool: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -304,8 +361,9 @@ func ctxTo_binding_Bool(ps *env.ProgramState, v env.RyeCtx) (binding.Bool, error } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Bool: arg 0: callback result: expected error, string or nil", + "context to binding.Bool: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -314,79 +372,45 @@ func ctxTo_binding_Bool(ps *env.ProgramState, v env.RyeCtx) (binding.Bool, error return res } default: - return nil, errors.New("context to binding.Bool: context fn Set: expected function") + return nil, errors.New("context to binding.Bool: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["AddListener"] + ctxObj2, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.Bool: expected context to have function AddListener") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.Bool: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.Bool: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.Bool: context fn AddListener: expected function") + return nil, errors.New("context to binding.Bool: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["RemoveListener"] + ctxObj3, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.Bool: expected context to have function RemoveListener") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.Bool: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.Bool: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.Bool: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.Bool: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -454,21 +478,21 @@ func ctxTo_binding_BoolList(ps *env.ProgramState, v env.RyeCtx) (binding.BoolLis impl := &iface_binding_BoolList{ self: v, } - ctxObj0, ok := wordToObj["Append"] + ctxObj0, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.BoolList: expected context to have function Append") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.BoolList: context fn Append: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.BoolList: context fn Append: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 bool) error { - var arg0Val env.Object - arg0Val = *env.NewInteger(boolToInt64(arg0)) + impl.fn_Append = func(ctx env.RyeCtx, farg0 bool) error { + var farg0Val env.Object + farg0Val = *env.NewInteger(boolToInt64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -477,8 +501,9 @@ func ctxTo_binding_BoolList(ps *env.ProgramState, v env.RyeCtx) (binding.BoolLis res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BoolList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -486,8 +511,9 @@ func ctxTo_binding_BoolList(ps *env.ProgramState, v env.RyeCtx) (binding.BoolLis } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: expected error, string or nil", + "context to binding.BoolList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -496,16 +522,16 @@ func ctxTo_binding_BoolList(ps *env.ProgramState, v env.RyeCtx) (binding.BoolLis return res } default: - return nil, errors.New("context to binding.BoolList: context fn Append: expected function") + return nil, errors.New("context to binding.BoolList: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Get"] + ctxObj1, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.BoolList: expected context to have function Get") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.BoolList: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.BoolList: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) ([]bool, error) { actualFn := fn @@ -515,16 +541,18 @@ func ctxTo_binding_BoolList(ps *env.ProgramState, v env.RyeCtx) (binding.BoolLis var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: expected block for multiple return values", + "context to binding.BoolList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: expected block with 2 return values", + "context to binding.BoolList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -534,32 +562,23 @@ func ctxTo_binding_BoolList(ps *env.ProgramState, v env.RyeCtx) (binding.BoolLis case env.Block: res0 = make([]bool, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.Integer); ok { - res0[i] = v.Value != 0 + if vc, ok := it.(env.Integer); ok { + res0[i] = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: block item: expected integer", + "context to binding.BoolList: arg 0: callback result: "+"block item: "+"expected integer, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } } - case env.Native: - var ok bool - res0, ok = v.Value.([]bool) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: expected native of type []bool", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BoolList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -567,8 +586,9 @@ func ctxTo_binding_BoolList(ps *env.ProgramState, v env.RyeCtx) (binding.BoolLis } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: expected block, native or nil", + "context to binding.BoolList: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -581,8 +601,9 @@ func ctxTo_binding_BoolList(ps *env.ProgramState, v env.RyeCtx) (binding.BoolLis res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BoolList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -590,8 +611,9 @@ func ctxTo_binding_BoolList(ps *env.ProgramState, v env.RyeCtx) (binding.BoolLis } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: expected error, string or nil", + "context to binding.BoolList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -600,47 +622,50 @@ func ctxTo_binding_BoolList(ps *env.ProgramState, v env.RyeCtx) (binding.BoolLis return res0, res1 } default: - return nil, errors.New("context to binding.BoolList: context fn Get: expected function") + return nil, errors.New("context to binding.BoolList: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["GetValue"] + ctxObj2, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.BoolList: expected context to have function GetValue") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.BoolList: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.BoolList: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 int) (bool, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 int) (bool, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 bool var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: expected block for multiple return values", + "context to binding.BoolList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: expected block with 2 return values", + "context to binding.BoolList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = v.Value != 0 + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: expected integer", + "context to binding.BoolList: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -653,8 +678,9 @@ func ctxTo_binding_BoolList(ps *env.ProgramState, v env.RyeCtx) (binding.BoolLis res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BoolList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -662,8 +688,9 @@ func ctxTo_binding_BoolList(ps *env.ProgramState, v env.RyeCtx) (binding.BoolLis } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: expected error, string or nil", + "context to binding.BoolList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -672,23 +699,23 @@ func ctxTo_binding_BoolList(ps *env.ProgramState, v env.RyeCtx) (binding.BoolLis return res0, res1 } default: - return nil, errors.New("context to binding.BoolList: context fn GetValue: expected function") + return nil, errors.New("context to binding.BoolList: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Prepend"] + ctxObj3, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.BoolList: expected context to have function Prepend") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.BoolList: context fn Prepend: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.BoolList: context fn Prepend: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 bool) error { - var arg0Val env.Object - arg0Val = *env.NewInteger(boolToInt64(arg0)) + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 bool) error { + var farg0Val env.Object + farg0Val = *env.NewInteger(boolToInt64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -697,8 +724,9 @@ func ctxTo_binding_BoolList(ps *env.ProgramState, v env.RyeCtx) (binding.BoolLis res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BoolList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -706,8 +734,9 @@ func ctxTo_binding_BoolList(ps *env.ProgramState, v env.RyeCtx) (binding.BoolLis } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: expected error, string or nil", + "context to binding.BoolList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -716,29 +745,29 @@ func ctxTo_binding_BoolList(ps *env.ProgramState, v env.RyeCtx) (binding.BoolLis return res } default: - return nil, errors.New("context to binding.BoolList: context fn Prepend: expected function") + return nil, errors.New("context to binding.BoolList: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Set"] + ctxObj4, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.BoolList: expected context to have function Set") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.BoolList: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.BoolList: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 []bool) error { - var arg0Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 []bool) error { + var farg0Val env.Object { - items := make([]env.Object, len(arg0)) - for i, it := range arg0 { + items := make([]env.Object, len(farg0)) + for i, it := range farg0 { items[i] = *env.NewInteger(boolToInt64(it)) } - arg0Val = *env.NewBlock(*env.NewTSeries(items)) + farg0Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -747,8 +776,9 @@ func ctxTo_binding_BoolList(ps *env.ProgramState, v env.RyeCtx) (binding.BoolLis res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BoolList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -756,8 +786,9 @@ func ctxTo_binding_BoolList(ps *env.ProgramState, v env.RyeCtx) (binding.BoolLis } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: expected error, string or nil", + "context to binding.BoolList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -766,24 +797,24 @@ func ctxTo_binding_BoolList(ps *env.ProgramState, v env.RyeCtx) (binding.BoolLis return res } default: - return nil, errors.New("context to binding.BoolList: context fn Set: expected function") + return nil, errors.New("context to binding.BoolList: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["SetValue"] + ctxObj5, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.BoolList: expected context to have function SetValue") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.BoolList: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.BoolList: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 int, arg1 bool) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) - arg1Val = *env.NewInteger(boolToInt64(arg1)) + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 int, farg1 bool) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) + farg1Val = *env.NewInteger(boolToInt64(farg1)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -792,8 +823,9 @@ func ctxTo_binding_BoolList(ps *env.ProgramState, v env.RyeCtx) (binding.BoolLis res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BoolList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -801,8 +833,9 @@ func ctxTo_binding_BoolList(ps *env.ProgramState, v env.RyeCtx) (binding.BoolLis } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: expected error, string or nil", + "context to binding.BoolList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -811,37 +844,39 @@ func ctxTo_binding_BoolList(ps *env.ProgramState, v env.RyeCtx) (binding.BoolLis return res } default: - return nil, errors.New("context to binding.BoolList: context fn SetValue: expected function") + return nil, errors.New("context to binding.BoolList: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["GetItem"] + ctxObj6, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.BoolList: expected context to have function GetItem") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.BoolList: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.BoolList: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 int) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 int) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: expected block for multiple return values", + "context to binding.BoolList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: expected block with 2 return values", + "context to binding.BoolList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -852,19 +887,21 @@ func ctxTo_binding_BoolList(ps *env.ProgramState, v env.RyeCtx) (binding.BoolLis var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: "+err.Error()+"", + "context to binding.BoolList: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.BoolList: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -872,8 +909,9 @@ func ctxTo_binding_BoolList(ps *env.ProgramState, v env.RyeCtx) (binding.BoolLis } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BoolList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -881,8 +919,9 @@ func ctxTo_binding_BoolList(ps *env.ProgramState, v env.RyeCtx) (binding.BoolLis } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: expected native", + "context to binding.BoolList: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -895,8 +934,9 @@ func ctxTo_binding_BoolList(ps *env.ProgramState, v env.RyeCtx) (binding.BoolLis res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BoolList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -904,8 +944,9 @@ func ctxTo_binding_BoolList(ps *env.ProgramState, v env.RyeCtx) (binding.BoolLis } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: expected error, string or nil", + "context to binding.BoolList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -914,27 +955,28 @@ func ctxTo_binding_BoolList(ps *env.ProgramState, v env.RyeCtx) (binding.BoolLis return res0, res1 } default: - return nil, errors.New("context to binding.BoolList: context fn GetItem: expected function") + return nil, errors.New("context to binding.BoolList: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["Length"] + ctxObj7, ok := wordToObj["length"] if !ok { return nil, errors.New("context to binding.BoolList: expected context to have function Length") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.BoolList: context fn Length: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.BoolList: context fn Length: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Length = func(ctx env.RyeCtx) int { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res int - if v, ok := ps.Res.(env.Integer); ok { - res = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + res = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolList: arg 0: callback result: expected integer", + "context to binding.BoolList: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -943,79 +985,45 @@ func ctxTo_binding_BoolList(ps *env.ProgramState, v env.RyeCtx) (binding.BoolLis return res } default: - return nil, errors.New("context to binding.BoolList: context fn Length: expected function") + return nil, errors.New("context to binding.BoolList: context fn Length: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["AddListener"] + ctxObj8, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.BoolList: expected context to have function AddListener") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.BoolList: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.BoolList: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.BoolList: context fn AddListener: expected function") + return nil, errors.New("context to binding.BoolList: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["RemoveListener"] + ctxObj9, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.BoolList: expected context to have function RemoveListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.BoolList: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.BoolList: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.BoolList: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.BoolList: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -1083,23 +1091,23 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre impl := &iface_binding_BoolTree{ self: v, } - ctxObj0, ok := wordToObj["Append"] + ctxObj0, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.BoolTree: expected context to have function Append") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 3 { - return nil, errors.New("context to binding.BoolTree: context fn Append: function has invalid number of arguments (expected 3)") + return nil, errors.New("context to binding.BoolTree: context fn Append: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 string, arg1 string, arg2 bool) error { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) - arg2Val = *env.NewInteger(boolToInt64(arg2)) + impl.fn_Append = func(ctx env.RyeCtx, farg0 string, farg1 string, farg2 bool) error { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) + farg2Val = *env.NewInteger(boolToInt64(farg2)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val, farg2Val) var res error switch v := ps.Res.(type) { case env.String: @@ -1108,8 +1116,9 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BoolTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1117,8 +1126,9 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected error, string or nil", + "context to binding.BoolTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1127,16 +1137,16 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre return res } default: - return nil, errors.New("context to binding.BoolTree: context fn Append: expected function") + return nil, errors.New("context to binding.BoolTree: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Get"] + ctxObj1, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.BoolTree: expected context to have function Get") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.BoolTree: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.BoolTree: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) (map[string][]string, map[string]bool, error) { actualFn := fn @@ -1147,16 +1157,18 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre var res2 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected block for multiple return values", + "context to binding.BoolTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } if len(res.Series.S) != 3 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected block with 3 return values", + "context to binding.BoolTree: arg 0: callback result: "+"expected block with 3 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1165,8 +1177,9 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre switch v := res.Series.S[0].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.BoolTree: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1175,11 +1188,12 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre res0 = make(map[string][]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: map key: expected string", + "context to binding.BoolTree: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1190,32 +1204,23 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: map value: block item: expected string", + "context to binding.BoolTree: arg 0: callback result: "+"map value: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: map value: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.BoolTree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1223,8 +1228,9 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.BoolTree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1241,32 +1247,23 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: map value: block item: expected string", + "context to binding.BoolTree: arg 0: callback result: "+"map value: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: map value: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.BoolTree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1274,8 +1271,9 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.BoolTree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1283,21 +1281,11 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre } res0[mapK] = mapV } - case env.Native: - var ok bool - res0, ok = v.Value.(map[string][]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected native of type map[string][]string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BoolTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1305,8 +1293,9 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected native, block, dict or nil", + "context to binding.BoolTree: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1315,8 +1304,9 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre switch v := res.Series.S[1].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.BoolTree: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1325,22 +1315,24 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre res1 = make(map[string]bool, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: map key: expected string", + "context to binding.BoolTree: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } var mapV bool - if v, ok := v.Series.S[i+1].(env.Integer); ok { - mapV = v.Value != 0 + if vc, ok := v.Series.S[i+1].(env.Integer); ok { + mapV = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: map value: expected integer", + "context to binding.BoolTree: arg 0: callback result: "+"map value: "+"expected integer, but got "+objectDebugString(ps.Idx, v.Series.S[i+1]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1353,11 +1345,12 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre for dictK, dictV := range v.Data { mapK := dictK var mapV bool - if v, ok := dictV.(env.Integer); ok { - mapV = v.Value != 0 + if vc, ok := dictV.(env.Integer); ok { + mapV = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: map value: expected integer", + "context to binding.BoolTree: arg 0: callback result: "+"map value: "+"expected integer, but got "+objectDebugString(ps.Idx, dictV), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1365,21 +1358,11 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre } res1[mapK] = mapV } - case env.Native: - var ok bool - res1, ok = v.Value.(map[string]bool) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected native of type map[string]bool", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BoolTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1387,8 +1370,9 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected native, block, dict or nil", + "context to binding.BoolTree: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1401,8 +1385,9 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre res2 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BoolTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1410,8 +1395,9 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre } res2 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected error, string or nil", + "context to binding.BoolTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1420,47 +1406,50 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre return res0, res1, res2 } default: - return nil, errors.New("context to binding.BoolTree: context fn Get: expected function") + return nil, errors.New("context to binding.BoolTree: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["GetValue"] + ctxObj2, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.BoolTree: expected context to have function GetValue") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.BoolTree: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.BoolTree: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 string) (bool, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 string) (bool, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 bool var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected block for multiple return values", + "context to binding.BoolTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected block with 2 return values", + "context to binding.BoolTree: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = v.Value != 0 + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected integer", + "context to binding.BoolTree: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1473,8 +1462,9 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BoolTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1482,8 +1472,9 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected error, string or nil", + "context to binding.BoolTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1492,25 +1483,25 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre return res0, res1 } default: - return nil, errors.New("context to binding.BoolTree: context fn GetValue: expected function") + return nil, errors.New("context to binding.BoolTree: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Prepend"] + ctxObj3, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.BoolTree: expected context to have function Prepend") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 3 { - return nil, errors.New("context to binding.BoolTree: context fn Prepend: function has invalid number of arguments (expected 3)") + return nil, errors.New("context to binding.BoolTree: context fn Prepend: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 string, arg1 string, arg2 bool) error { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) - arg2Val = *env.NewInteger(boolToInt64(arg2)) + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 string, farg1 string, farg2 bool) error { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) + farg2Val = *env.NewInteger(boolToInt64(farg2)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val, farg2Val) var res error switch v := ps.Res.(type) { case env.String: @@ -1519,8 +1510,9 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BoolTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1528,8 +1520,9 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected error, string or nil", + "context to binding.BoolTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1538,22 +1531,22 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre return res } default: - return nil, errors.New("context to binding.BoolTree: context fn Prepend: expected function") + return nil, errors.New("context to binding.BoolTree: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Set"] + ctxObj4, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.BoolTree: expected context to have function Set") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.BoolTree: context fn Set: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.BoolTree: context fn Set: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 map[string][]string, arg1 map[string]bool) error { - var arg0Val, arg1Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 map[string][]string, farg1 map[string]bool) error { + var farg0Val, farg1Val env.Object { - data := make(map[string]any, len(arg0)) - for mKey, mVal := range arg0 { + data := make(map[string]any, len(farg0)) + for mKey, mVal := range farg0 { var dVal env.Object { items := make([]env.Object, len(mVal)) @@ -1564,20 +1557,20 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre } data[mKey] = dVal } - arg0Val = *env.NewDict(data) + farg0Val = *env.NewDict(data) } { - data := make(map[string]any, len(arg1)) - for mKey, mVal := range arg1 { + data := make(map[string]any, len(farg1)) + for mKey, mVal := range farg1 { var dVal env.Object dVal = *env.NewInteger(boolToInt64(mVal)) data[mKey] = dVal } - arg1Val = *env.NewDict(data) + farg1Val = *env.NewDict(data) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -1586,8 +1579,9 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BoolTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1595,8 +1589,9 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected error, string or nil", + "context to binding.BoolTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1605,24 +1600,24 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre return res } default: - return nil, errors.New("context to binding.BoolTree: context fn Set: expected function") + return nil, errors.New("context to binding.BoolTree: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["SetValue"] + ctxObj5, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.BoolTree: expected context to have function SetValue") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.BoolTree: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.BoolTree: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 string, arg1 bool) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewInteger(boolToInt64(arg1)) + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 string, farg1 bool) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewInteger(boolToInt64(farg1)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -1631,8 +1626,9 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BoolTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1640,8 +1636,9 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected error, string or nil", + "context to binding.BoolTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1650,37 +1647,39 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre return res } default: - return nil, errors.New("context to binding.BoolTree: context fn SetValue: expected function") + return nil, errors.New("context to binding.BoolTree: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["GetItem"] + ctxObj6, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.BoolTree: expected context to have function GetItem") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.BoolTree: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.BoolTree: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 string) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 string) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected block for multiple return values", + "context to binding.BoolTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected block with 2 return values", + "context to binding.BoolTree: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1691,19 +1690,21 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: "+err.Error()+"", + "context to binding.BoolTree: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.BoolTree: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1711,8 +1712,9 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BoolTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1720,8 +1722,9 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected native", + "context to binding.BoolTree: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1734,8 +1737,9 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BoolTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1743,8 +1747,9 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected error, string or nil", + "context to binding.BoolTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1753,54 +1758,45 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre return res0, res1 } default: - return nil, errors.New("context to binding.BoolTree: context fn GetItem: expected function") + return nil, errors.New("context to binding.BoolTree: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["ChildIDs"] + ctxObj7, ok := wordToObj["child-i-ds"] if !ok { return nil, errors.New("context to binding.BoolTree: expected context to have function ChildIDs") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.BoolTree: context fn ChildIDs: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.BoolTree: context fn ChildIDs: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_ChildIDs = func(ctx env.RyeCtx, arg0 string) []string { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_ChildIDs = func(ctx env.RyeCtx, farg0 string) []string { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res []string switch v := ps.Res.(type) { case env.Block: res = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - res[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + res[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: block item: expected string", + "context to binding.BoolTree: arg 0: callback result: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BoolTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1808,8 +1804,9 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BoolTree: arg 0: callback result: expected block, native or nil", + "context to binding.BoolTree: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1818,79 +1815,45 @@ func ctxTo_binding_BoolTree(ps *env.ProgramState, v env.RyeCtx) (binding.BoolTre return res } default: - return nil, errors.New("context to binding.BoolTree: context fn ChildIDs: expected function") + return nil, errors.New("context to binding.BoolTree: context fn ChildIDs: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["AddListener"] + ctxObj8, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.BoolTree: expected context to have function AddListener") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.BoolTree: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.BoolTree: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.BoolTree: context fn AddListener: expected function") + return nil, errors.New("context to binding.BoolTree: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["RemoveListener"] + ctxObj9, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.BoolTree: expected context to have function RemoveListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.BoolTree: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.BoolTree: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.BoolTree: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.BoolTree: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -1934,14 +1897,14 @@ func ctxTo_binding_Bytes(ps *env.ProgramState, v env.RyeCtx) (binding.Bytes, err impl := &iface_binding_Bytes{ self: v, } - ctxObj0, ok := wordToObj["Get"] + ctxObj0, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.Bytes: expected context to have function Get") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.Bytes: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.Bytes: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) ([]byte, error) { actualFn := fn @@ -1951,16 +1914,18 @@ func ctxTo_binding_Bytes(ps *env.ProgramState, v env.RyeCtx) (binding.Bytes, err var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Bytes: arg 0: callback result: expected block for multiple return values", + "context to binding.Bytes: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Bytes: arg 0: callback result: expected block with 2 return values", + "context to binding.Bytes: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -1972,40 +1937,32 @@ func ctxTo_binding_Bytes(ps *env.ProgramState, v env.RyeCtx) (binding.Bytes, err for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - res0[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + res0[i] = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Bytes: arg 0: callback result: block item: expected native of type byte", + "context to binding.Bytes: arg 0: callback result: "+"block item: "+"expected native of type byte, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Bytes: arg 0: callback result: block item: expected native", + "context to binding.Bytes: arg 0: callback result: "+"block item: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } } - case env.Native: - var ok bool - res0, ok = v.Value.([]byte) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Bytes: arg 0: callback result: expected native of type []byte", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Bytes: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.Bytes: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2013,8 +1970,9 @@ func ctxTo_binding_Bytes(ps *env.ProgramState, v env.RyeCtx) (binding.Bytes, err } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Bytes: arg 0: callback result: expected block, native or nil", + "context to binding.Bytes: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2027,8 +1985,9 @@ func ctxTo_binding_Bytes(ps *env.ProgramState, v env.RyeCtx) (binding.Bytes, err res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Bytes: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.Bytes: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2036,8 +1995,9 @@ func ctxTo_binding_Bytes(ps *env.ProgramState, v env.RyeCtx) (binding.Bytes, err } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Bytes: arg 0: callback result: expected error, string or nil", + "context to binding.Bytes: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2046,29 +2006,29 @@ func ctxTo_binding_Bytes(ps *env.ProgramState, v env.RyeCtx) (binding.Bytes, err return res0, res1 } default: - return nil, errors.New("context to binding.Bytes: context fn Get: expected function") + return nil, errors.New("context to binding.Bytes: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Set"] + ctxObj1, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.Bytes: expected context to have function Set") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.Bytes: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.Bytes: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 []byte) error { - var arg0Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 []byte) error { + var farg0Val env.Object { - items := make([]env.Object, len(arg0)) - for i, it := range arg0 { + items := make([]env.Object, len(farg0)) + for i, it := range farg0 { items[i] = *env.NewNative(ps.Idx, it, "Go(byte)") } - arg0Val = *env.NewBlock(*env.NewTSeries(items)) + farg0Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -2077,8 +2037,9 @@ func ctxTo_binding_Bytes(ps *env.ProgramState, v env.RyeCtx) (binding.Bytes, err res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Bytes: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.Bytes: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2086,8 +2047,9 @@ func ctxTo_binding_Bytes(ps *env.ProgramState, v env.RyeCtx) (binding.Bytes, err } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Bytes: arg 0: callback result: expected error, string or nil", + "context to binding.Bytes: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2096,79 +2058,45 @@ func ctxTo_binding_Bytes(ps *env.ProgramState, v env.RyeCtx) (binding.Bytes, err return res } default: - return nil, errors.New("context to binding.Bytes: context fn Set: expected function") + return nil, errors.New("context to binding.Bytes: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["AddListener"] + ctxObj2, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.Bytes: expected context to have function AddListener") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.Bytes: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.Bytes: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.Bytes: context fn AddListener: expected function") + return nil, errors.New("context to binding.Bytes: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["RemoveListener"] + ctxObj3, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.Bytes: expected context to have function RemoveListener") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.Bytes: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.Bytes: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.Bytes: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.Bytes: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -2236,27 +2164,27 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL impl := &iface_binding_BytesList{ self: v, } - ctxObj0, ok := wordToObj["Append"] + ctxObj0, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.BytesList: expected context to have function Append") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.BytesList: context fn Append: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.BytesList: context fn Append: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 []byte) error { - var arg0Val env.Object + impl.fn_Append = func(ctx env.RyeCtx, farg0 []byte) error { + var farg0Val env.Object { - items := make([]env.Object, len(arg0)) - for i, it := range arg0 { + items := make([]env.Object, len(farg0)) + for i, it := range farg0 { items[i] = *env.NewNative(ps.Idx, it, "Go(byte)") } - arg0Val = *env.NewBlock(*env.NewTSeries(items)) + farg0Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -2265,8 +2193,9 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BytesList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2274,8 +2203,9 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected error, string or nil", + "context to binding.BytesList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2284,16 +2214,16 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL return res } default: - return nil, errors.New("context to binding.BytesList: context fn Append: expected function") + return nil, errors.New("context to binding.BytesList: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Get"] + ctxObj1, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.BytesList: expected context to have function Get") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.BytesList: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.BytesList: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) ([][]byte, error) { actualFn := fn @@ -2303,16 +2233,18 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected block for multiple return values", + "context to binding.BytesList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected block with 2 return values", + "context to binding.BytesList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2328,40 +2260,32 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - res0[i][i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + res0[i][i] = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: block item: block item: expected native of type byte", + "context to binding.BytesList: arg 0: callback result: "+"block item: "+"block item: "+"expected native of type byte, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: block item: block item: expected native", + "context to binding.BytesList: arg 0: callback result: "+"block item: "+"block item: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } } - case env.Native: - var ok bool - res0[i], ok = v.Value.([]byte) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: block item: expected native of type []byte", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: block item: expected integer to be 0 or nil", + "context to binding.BytesList: arg 0: callback result: "+"block item: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2369,29 +2293,20 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL } res0[i] = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: block item: expected block, native or nil", + "context to binding.BytesList: arg 0: callback result: "+"block item: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } } - case env.Native: - var ok bool - res0, ok = v.Value.([][]byte) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected native of type [][]byte", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BytesList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2399,8 +2314,9 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected block, native or nil", + "context to binding.BytesList: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2413,8 +2329,9 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BytesList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2422,8 +2339,9 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected error, string or nil", + "context to binding.BytesList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2432,37 +2350,39 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL return res0, res1 } default: - return nil, errors.New("context to binding.BytesList: context fn Get: expected function") + return nil, errors.New("context to binding.BytesList: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["GetValue"] + ctxObj2, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.BytesList: expected context to have function GetValue") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.BytesList: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.BytesList: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 int) ([]byte, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 int) ([]byte, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 []byte var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected block for multiple return values", + "context to binding.BytesList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected block with 2 return values", + "context to binding.BytesList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2474,40 +2394,32 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - res0[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + res0[i] = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: block item: expected native of type byte", + "context to binding.BytesList: arg 0: callback result: "+"block item: "+"expected native of type byte, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: block item: expected native", + "context to binding.BytesList: arg 0: callback result: "+"block item: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } } - case env.Native: - var ok bool - res0, ok = v.Value.([]byte) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected native of type []byte", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BytesList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2515,8 +2427,9 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected block, native or nil", + "context to binding.BytesList: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2529,8 +2442,9 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BytesList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2538,8 +2452,9 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected error, string or nil", + "context to binding.BytesList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2548,29 +2463,29 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL return res0, res1 } default: - return nil, errors.New("context to binding.BytesList: context fn GetValue: expected function") + return nil, errors.New("context to binding.BytesList: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Prepend"] + ctxObj3, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.BytesList: expected context to have function Prepend") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.BytesList: context fn Prepend: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.BytesList: context fn Prepend: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 []byte) error { - var arg0Val env.Object + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 []byte) error { + var farg0Val env.Object { - items := make([]env.Object, len(arg0)) - for i, it := range arg0 { + items := make([]env.Object, len(farg0)) + for i, it := range farg0 { items[i] = *env.NewNative(ps.Idx, it, "Go(byte)") } - arg0Val = *env.NewBlock(*env.NewTSeries(items)) + farg0Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -2579,8 +2494,9 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BytesList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2588,8 +2504,9 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected error, string or nil", + "context to binding.BytesList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2598,22 +2515,22 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL return res } default: - return nil, errors.New("context to binding.BytesList: context fn Prepend: expected function") + return nil, errors.New("context to binding.BytesList: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Set"] + ctxObj4, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.BytesList: expected context to have function Set") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.BytesList: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.BytesList: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 [][]byte) error { - var arg0Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 [][]byte) error { + var farg0Val env.Object { - items := make([]env.Object, len(arg0)) - for i, it := range arg0 { + items := make([]env.Object, len(farg0)) + for i, it := range farg0 { { items := make([]env.Object, len(it)) for i, it := range it { @@ -2622,11 +2539,11 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL items[i] = *env.NewBlock(*env.NewTSeries(items)) } } - arg0Val = *env.NewBlock(*env.NewTSeries(items)) + farg0Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -2635,8 +2552,9 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BytesList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2644,8 +2562,9 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected error, string or nil", + "context to binding.BytesList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2654,30 +2573,30 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL return res } default: - return nil, errors.New("context to binding.BytesList: context fn Set: expected function") + return nil, errors.New("context to binding.BytesList: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["SetValue"] + ctxObj5, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.BytesList: expected context to have function SetValue") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.BytesList: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.BytesList: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 int, arg1 []byte) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 int, farg1 []byte) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) { - items := make([]env.Object, len(arg1)) - for i, it := range arg1 { + items := make([]env.Object, len(farg1)) + for i, it := range farg1 { items[i] = *env.NewNative(ps.Idx, it, "Go(byte)") } - arg1Val = *env.NewBlock(*env.NewTSeries(items)) + farg1Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -2686,8 +2605,9 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BytesList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2695,8 +2615,9 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected error, string or nil", + "context to binding.BytesList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2705,37 +2626,39 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL return res } default: - return nil, errors.New("context to binding.BytesList: context fn SetValue: expected function") + return nil, errors.New("context to binding.BytesList: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["GetItem"] + ctxObj6, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.BytesList: expected context to have function GetItem") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.BytesList: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.BytesList: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 int) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 int) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected block for multiple return values", + "context to binding.BytesList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected block with 2 return values", + "context to binding.BytesList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2746,19 +2669,21 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: "+err.Error()+"", + "context to binding.BytesList: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.BytesList: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2766,8 +2691,9 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BytesList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2775,8 +2701,9 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected native", + "context to binding.BytesList: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2789,8 +2716,9 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BytesList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2798,8 +2726,9 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected error, string or nil", + "context to binding.BytesList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2808,27 +2737,28 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL return res0, res1 } default: - return nil, errors.New("context to binding.BytesList: context fn GetItem: expected function") + return nil, errors.New("context to binding.BytesList: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["Length"] + ctxObj7, ok := wordToObj["length"] if !ok { return nil, errors.New("context to binding.BytesList: expected context to have function Length") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.BytesList: context fn Length: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.BytesList: context fn Length: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Length = func(ctx env.RyeCtx) int { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res int - if v, ok := ps.Res.(env.Integer); ok { - res = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + res = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesList: arg 0: callback result: expected integer", + "context to binding.BytesList: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -2837,79 +2767,45 @@ func ctxTo_binding_BytesList(ps *env.ProgramState, v env.RyeCtx) (binding.BytesL return res } default: - return nil, errors.New("context to binding.BytesList: context fn Length: expected function") + return nil, errors.New("context to binding.BytesList: context fn Length: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["AddListener"] + ctxObj8, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.BytesList: expected context to have function AddListener") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.BytesList: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.BytesList: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.BytesList: context fn AddListener: expected function") + return nil, errors.New("context to binding.BytesList: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["RemoveListener"] + ctxObj9, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.BytesList: expected context to have function RemoveListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.BytesList: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.BytesList: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.BytesList: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.BytesList: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -2977,29 +2873,29 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT impl := &iface_binding_BytesTree{ self: v, } - ctxObj0, ok := wordToObj["Append"] + ctxObj0, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.BytesTree: expected context to have function Append") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 3 { - return nil, errors.New("context to binding.BytesTree: context fn Append: function has invalid number of arguments (expected 3)") + return nil, errors.New("context to binding.BytesTree: context fn Append: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 string, arg1 string, arg2 []byte) error { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) + impl.fn_Append = func(ctx env.RyeCtx, farg0 string, farg1 string, farg2 []byte) error { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) { - items := make([]env.Object, len(arg2)) - for i, it := range arg2 { + items := make([]env.Object, len(farg2)) + for i, it := range farg2 { items[i] = *env.NewNative(ps.Idx, it, "Go(byte)") } - arg2Val = *env.NewBlock(*env.NewTSeries(items)) + farg2Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val, farg2Val) var res error switch v := ps.Res.(type) { case env.String: @@ -3008,8 +2904,9 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BytesTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3017,8 +2914,9 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected error, string or nil", + "context to binding.BytesTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3027,16 +2925,16 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT return res } default: - return nil, errors.New("context to binding.BytesTree: context fn Append: expected function") + return nil, errors.New("context to binding.BytesTree: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Get"] + ctxObj1, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.BytesTree: expected context to have function Get") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.BytesTree: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.BytesTree: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) (map[string][]string, map[string][]byte, error) { actualFn := fn @@ -3047,16 +2945,18 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT var res2 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected block for multiple return values", + "context to binding.BytesTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } if len(res.Series.S) != 3 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected block with 3 return values", + "context to binding.BytesTree: arg 0: callback result: "+"expected block with 3 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3065,8 +2965,9 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT switch v := res.Series.S[0].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.BytesTree: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3075,11 +2976,12 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT res0 = make(map[string][]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: map key: expected string", + "context to binding.BytesTree: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3090,32 +2992,23 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: map value: block item: expected string", + "context to binding.BytesTree: arg 0: callback result: "+"map value: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: map value: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.BytesTree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3123,8 +3016,9 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.BytesTree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3141,32 +3035,23 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: map value: block item: expected string", + "context to binding.BytesTree: arg 0: callback result: "+"map value: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: map value: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.BytesTree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3174,8 +3059,9 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.BytesTree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3183,21 +3069,11 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT } res0[mapK] = mapV } - case env.Native: - var ok bool - res0, ok = v.Value.(map[string][]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected native of type map[string][]string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BytesTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3205,8 +3081,9 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected native, block, dict or nil", + "context to binding.BytesTree: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3215,8 +3092,9 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT switch v := res.Series.S[1].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.BytesTree: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3225,11 +3103,12 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT res1 = make(map[string][]byte, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: map key: expected string", + "context to binding.BytesTree: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3242,40 +3121,32 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - mapV[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + mapV[i] = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: map value: block item: expected native of type byte", + "context to binding.BytesTree: arg 0: callback result: "+"map value: "+"block item: "+"expected native of type byte, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: map value: block item: expected native", + "context to binding.BytesTree: arg 0: callback result: "+"map value: "+"block item: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]byte) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: map value: expected native of type []byte", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.BytesTree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3283,8 +3154,9 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.BytesTree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3303,40 +3175,32 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - mapV[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + mapV[i] = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: map value: block item: expected native of type byte", + "context to binding.BytesTree: arg 0: callback result: "+"map value: "+"block item: "+"expected native of type byte, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: map value: block item: expected native", + "context to binding.BytesTree: arg 0: callback result: "+"map value: "+"block item: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]byte) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: map value: expected native of type []byte", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.BytesTree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3344,8 +3208,9 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.BytesTree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3353,21 +3218,11 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT } res1[mapK] = mapV } - case env.Native: - var ok bool - res1, ok = v.Value.(map[string][]byte) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected native of type map[string][]byte", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BytesTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3375,8 +3230,9 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected native, block, dict or nil", + "context to binding.BytesTree: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3389,8 +3245,9 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT res2 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BytesTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3398,8 +3255,9 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT } res2 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected error, string or nil", + "context to binding.BytesTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3408,37 +3266,39 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT return res0, res1, res2 } default: - return nil, errors.New("context to binding.BytesTree: context fn Get: expected function") + return nil, errors.New("context to binding.BytesTree: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["GetValue"] + ctxObj2, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.BytesTree: expected context to have function GetValue") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.BytesTree: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.BytesTree: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 string) ([]byte, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 string) ([]byte, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 []byte var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected block for multiple return values", + "context to binding.BytesTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected block with 2 return values", + "context to binding.BytesTree: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3450,40 +3310,32 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - res0[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + res0[i] = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: block item: expected native of type byte", + "context to binding.BytesTree: arg 0: callback result: "+"block item: "+"expected native of type byte, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: block item: expected native", + "context to binding.BytesTree: arg 0: callback result: "+"block item: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } } - case env.Native: - var ok bool - res0, ok = v.Value.([]byte) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected native of type []byte", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BytesTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3491,8 +3343,9 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected block, native or nil", + "context to binding.BytesTree: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3505,8 +3358,9 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BytesTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3514,8 +3368,9 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected error, string or nil", + "context to binding.BytesTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3524,31 +3379,31 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT return res0, res1 } default: - return nil, errors.New("context to binding.BytesTree: context fn GetValue: expected function") + return nil, errors.New("context to binding.BytesTree: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Prepend"] + ctxObj3, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.BytesTree: expected context to have function Prepend") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 3 { - return nil, errors.New("context to binding.BytesTree: context fn Prepend: function has invalid number of arguments (expected 3)") + return nil, errors.New("context to binding.BytesTree: context fn Prepend: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 string, arg1 string, arg2 []byte) error { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 string, farg1 string, farg2 []byte) error { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) { - items := make([]env.Object, len(arg2)) - for i, it := range arg2 { + items := make([]env.Object, len(farg2)) + for i, it := range farg2 { items[i] = *env.NewNative(ps.Idx, it, "Go(byte)") } - arg2Val = *env.NewBlock(*env.NewTSeries(items)) + farg2Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val, farg2Val) var res error switch v := ps.Res.(type) { case env.String: @@ -3557,8 +3412,9 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BytesTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3566,8 +3422,9 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected error, string or nil", + "context to binding.BytesTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3576,22 +3433,22 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT return res } default: - return nil, errors.New("context to binding.BytesTree: context fn Prepend: expected function") + return nil, errors.New("context to binding.BytesTree: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Set"] + ctxObj4, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.BytesTree: expected context to have function Set") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.BytesTree: context fn Set: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.BytesTree: context fn Set: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 map[string][]string, arg1 map[string][]byte) error { - var arg0Val, arg1Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 map[string][]string, farg1 map[string][]byte) error { + var farg0Val, farg1Val env.Object { - data := make(map[string]any, len(arg0)) - for mKey, mVal := range arg0 { + data := make(map[string]any, len(farg0)) + for mKey, mVal := range farg0 { var dVal env.Object { items := make([]env.Object, len(mVal)) @@ -3602,11 +3459,11 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT } data[mKey] = dVal } - arg0Val = *env.NewDict(data) + farg0Val = *env.NewDict(data) } { - data := make(map[string]any, len(arg1)) - for mKey, mVal := range arg1 { + data := make(map[string]any, len(farg1)) + for mKey, mVal := range farg1 { var dVal env.Object { items := make([]env.Object, len(mVal)) @@ -3617,11 +3474,11 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT } data[mKey] = dVal } - arg1Val = *env.NewDict(data) + farg1Val = *env.NewDict(data) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -3630,8 +3487,9 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BytesTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3639,8 +3497,9 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected error, string or nil", + "context to binding.BytesTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3649,30 +3508,30 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT return res } default: - return nil, errors.New("context to binding.BytesTree: context fn Set: expected function") + return nil, errors.New("context to binding.BytesTree: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["SetValue"] + ctxObj5, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.BytesTree: expected context to have function SetValue") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.BytesTree: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.BytesTree: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 string, arg1 []byte) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 string, farg1 []byte) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) { - items := make([]env.Object, len(arg1)) - for i, it := range arg1 { + items := make([]env.Object, len(farg1)) + for i, it := range farg1 { items[i] = *env.NewNative(ps.Idx, it, "Go(byte)") } - arg1Val = *env.NewBlock(*env.NewTSeries(items)) + farg1Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -3681,8 +3540,9 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BytesTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3690,8 +3550,9 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected error, string or nil", + "context to binding.BytesTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3700,37 +3561,39 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT return res } default: - return nil, errors.New("context to binding.BytesTree: context fn SetValue: expected function") + return nil, errors.New("context to binding.BytesTree: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["GetItem"] + ctxObj6, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.BytesTree: expected context to have function GetItem") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.BytesTree: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.BytesTree: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 string) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 string) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected block for multiple return values", + "context to binding.BytesTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected block with 2 return values", + "context to binding.BytesTree: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3741,19 +3604,21 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: "+err.Error()+"", + "context to binding.BytesTree: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.BytesTree: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3761,8 +3626,9 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BytesTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3770,8 +3636,9 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected native", + "context to binding.BytesTree: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3784,8 +3651,9 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BytesTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3793,8 +3661,9 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected error, string or nil", + "context to binding.BytesTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3803,54 +3672,45 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT return res0, res1 } default: - return nil, errors.New("context to binding.BytesTree: context fn GetItem: expected function") + return nil, errors.New("context to binding.BytesTree: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["ChildIDs"] + ctxObj7, ok := wordToObj["child-i-ds"] if !ok { return nil, errors.New("context to binding.BytesTree: expected context to have function ChildIDs") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.BytesTree: context fn ChildIDs: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.BytesTree: context fn ChildIDs: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_ChildIDs = func(ctx env.RyeCtx, arg0 string) []string { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_ChildIDs = func(ctx env.RyeCtx, farg0 string) []string { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res []string switch v := ps.Res.(type) { case env.Block: res = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - res[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + res[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: block item: expected string", + "context to binding.BytesTree: arg 0: callback result: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.BytesTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3858,8 +3718,9 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.BytesTree: arg 0: callback result: expected block, native or nil", + "context to binding.BytesTree: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -3868,79 +3729,45 @@ func ctxTo_binding_BytesTree(ps *env.ProgramState, v env.RyeCtx) (binding.BytesT return res } default: - return nil, errors.New("context to binding.BytesTree: context fn ChildIDs: expected function") + return nil, errors.New("context to binding.BytesTree: context fn ChildIDs: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["AddListener"] + ctxObj8, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.BytesTree: expected context to have function AddListener") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.BytesTree: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.BytesTree: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.BytesTree: context fn AddListener: expected function") + return nil, errors.New("context to binding.BytesTree: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["RemoveListener"] + ctxObj9, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.BytesTree: expected context to have function RemoveListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.BytesTree: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.BytesTree: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.BytesTree: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.BytesTree: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -3976,77 +3803,43 @@ func ctxTo_binding_DataItem(ps *env.ProgramState, v env.RyeCtx) (binding.DataIte impl := &iface_binding_DataItem{ self: v, } - ctxObj0, ok := wordToObj["AddListener"] + ctxObj0, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.DataItem: expected context to have function AddListener") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.DataItem: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.DataItem: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.DataItem: context fn AddListener: expected function") + return nil, errors.New("context to binding.DataItem: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["RemoveListener"] + ctxObj1, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.DataItem: expected context to have function RemoveListener") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.DataItem: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.DataItem: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.DataItem: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.DataItem: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -4090,35 +3883,37 @@ func ctxTo_binding_DataList(ps *env.ProgramState, v env.RyeCtx) (binding.DataLis impl := &iface_binding_DataList{ self: v, } - ctxObj0, ok := wordToObj["GetItem"] + ctxObj0, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.DataList: expected context to have function GetItem") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.DataList: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.DataList: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 int) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 int) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataList: arg 0: callback result: expected block for multiple return values", + "context to binding.DataList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataList: arg 0: callback result: expected block with 2 return values", + "context to binding.DataList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -4129,19 +3924,21 @@ func ctxTo_binding_DataList(ps *env.ProgramState, v env.RyeCtx) (binding.DataLis var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataList: arg 0: callback result: "+err.Error()+"", + "context to binding.DataList: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataList: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.DataList: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -4149,8 +3946,9 @@ func ctxTo_binding_DataList(ps *env.ProgramState, v env.RyeCtx) (binding.DataLis } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.DataList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -4158,8 +3956,9 @@ func ctxTo_binding_DataList(ps *env.ProgramState, v env.RyeCtx) (binding.DataLis } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataList: arg 0: callback result: expected native", + "context to binding.DataList: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -4172,8 +3971,9 @@ func ctxTo_binding_DataList(ps *env.ProgramState, v env.RyeCtx) (binding.DataLis res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.DataList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -4181,8 +3981,9 @@ func ctxTo_binding_DataList(ps *env.ProgramState, v env.RyeCtx) (binding.DataLis } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataList: arg 0: callback result: expected error, string or nil", + "context to binding.DataList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -4191,27 +3992,28 @@ func ctxTo_binding_DataList(ps *env.ProgramState, v env.RyeCtx) (binding.DataLis return res0, res1 } default: - return nil, errors.New("context to binding.DataList: context fn GetItem: expected function") + return nil, errors.New("context to binding.DataList: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Length"] + ctxObj1, ok := wordToObj["length"] if !ok { return nil, errors.New("context to binding.DataList: expected context to have function Length") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.DataList: context fn Length: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.DataList: context fn Length: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Length = func(ctx env.RyeCtx) int { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res int - if v, ok := ps.Res.(env.Integer); ok { - res = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + res = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataList: arg 0: callback result: expected integer", + "context to binding.DataList: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -4220,79 +4022,45 @@ func ctxTo_binding_DataList(ps *env.ProgramState, v env.RyeCtx) (binding.DataLis return res } default: - return nil, errors.New("context to binding.DataList: context fn Length: expected function") + return nil, errors.New("context to binding.DataList: context fn Length: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["AddListener"] + ctxObj2, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.DataList: expected context to have function AddListener") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.DataList: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.DataList: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.DataList: context fn AddListener: expected function") + return nil, errors.New("context to binding.DataList: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["RemoveListener"] + ctxObj3, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.DataList: expected context to have function RemoveListener") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.DataList: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.DataList: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.DataList: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.DataList: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -4324,14 +4092,14 @@ func ctxTo_binding_DataListener(ps *env.ProgramState, v env.RyeCtx) (binding.Dat impl := &iface_binding_DataListener{ self: v, } - ctxObj0, ok := wordToObj["DataChanged"] + ctxObj0, ok := wordToObj["data-changed"] if !ok { return nil, errors.New("context to binding.DataListener: expected context to have function DataChanged") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.DataListener: context fn DataChanged: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.DataListener: context fn DataChanged: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_DataChanged = func(ctx env.RyeCtx) { actualFn := fn @@ -4339,7 +4107,7 @@ func ctxTo_binding_DataListener(ps *env.ProgramState, v env.RyeCtx) (binding.Dat evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to binding.DataListener: context fn DataChanged: expected function") + return nil, errors.New("context to binding.DataListener: context fn DataChanged: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -4383,35 +4151,37 @@ func ctxTo_binding_DataMap(ps *env.ProgramState, v env.RyeCtx) (binding.DataMap, impl := &iface_binding_DataMap{ self: v, } - ctxObj0, ok := wordToObj["GetItem"] + ctxObj0, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.DataMap: expected context to have function GetItem") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.DataMap: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.DataMap: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 string) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 string) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataMap: arg 0: callback result: expected block for multiple return values", + "context to binding.DataMap: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataMap: arg 0: callback result: expected block with 2 return values", + "context to binding.DataMap: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -4422,19 +4192,21 @@ func ctxTo_binding_DataMap(ps *env.ProgramState, v env.RyeCtx) (binding.DataMap, var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataMap: arg 0: callback result: "+err.Error()+"", + "context to binding.DataMap: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataMap: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.DataMap: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -4442,8 +4214,9 @@ func ctxTo_binding_DataMap(ps *env.ProgramState, v env.RyeCtx) (binding.DataMap, } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataMap: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.DataMap: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -4451,8 +4224,9 @@ func ctxTo_binding_DataMap(ps *env.ProgramState, v env.RyeCtx) (binding.DataMap, } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataMap: arg 0: callback result: expected native", + "context to binding.DataMap: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -4465,8 +4239,9 @@ func ctxTo_binding_DataMap(ps *env.ProgramState, v env.RyeCtx) (binding.DataMap, res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataMap: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.DataMap: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -4474,8 +4249,9 @@ func ctxTo_binding_DataMap(ps *env.ProgramState, v env.RyeCtx) (binding.DataMap, } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataMap: arg 0: callback result: expected error, string or nil", + "context to binding.DataMap: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -4484,16 +4260,16 @@ func ctxTo_binding_DataMap(ps *env.ProgramState, v env.RyeCtx) (binding.DataMap, return res0, res1 } default: - return nil, errors.New("context to binding.DataMap: context fn GetItem: expected function") + return nil, errors.New("context to binding.DataMap: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Keys"] + ctxObj1, ok := wordToObj["keys"] if !ok { return nil, errors.New("context to binding.DataMap: expected context to have function Keys") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.DataMap: context fn Keys: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.DataMap: context fn Keys: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Keys = func(ctx env.RyeCtx) []string { actualFn := fn @@ -4504,32 +4280,23 @@ func ctxTo_binding_DataMap(ps *env.ProgramState, v env.RyeCtx) (binding.DataMap, case env.Block: res = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - res[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + res[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataMap: arg 0: callback result: block item: expected string", + "context to binding.DataMap: arg 0: callback result: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataMap: arg 0: callback result: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataMap: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.DataMap: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -4537,8 +4304,9 @@ func ctxTo_binding_DataMap(ps *env.ProgramState, v env.RyeCtx) (binding.DataMap, } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataMap: arg 0: callback result: expected block, native or nil", + "context to binding.DataMap: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -4547,79 +4315,45 @@ func ctxTo_binding_DataMap(ps *env.ProgramState, v env.RyeCtx) (binding.DataMap, return res } default: - return nil, errors.New("context to binding.DataMap: context fn Keys: expected function") + return nil, errors.New("context to binding.DataMap: context fn Keys: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["AddListener"] + ctxObj2, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.DataMap: expected context to have function AddListener") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.DataMap: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.DataMap: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.DataMap: context fn AddListener: expected function") + return nil, errors.New("context to binding.DataMap: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["RemoveListener"] + ctxObj3, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.DataMap: expected context to have function RemoveListener") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.DataMap: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.DataMap: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.DataMap: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.DataMap: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -4663,35 +4397,37 @@ func ctxTo_binding_DataTree(ps *env.ProgramState, v env.RyeCtx) (binding.DataTre impl := &iface_binding_DataTree{ self: v, } - ctxObj0, ok := wordToObj["GetItem"] + ctxObj0, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.DataTree: expected context to have function GetItem") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.DataTree: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.DataTree: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 string) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 string) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataTree: arg 0: callback result: expected block for multiple return values", + "context to binding.DataTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataTree: arg 0: callback result: expected block with 2 return values", + "context to binding.DataTree: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -4702,19 +4438,21 @@ func ctxTo_binding_DataTree(ps *env.ProgramState, v env.RyeCtx) (binding.DataTre var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataTree: arg 0: callback result: "+err.Error()+"", + "context to binding.DataTree: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataTree: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.DataTree: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -4722,8 +4460,9 @@ func ctxTo_binding_DataTree(ps *env.ProgramState, v env.RyeCtx) (binding.DataTre } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.DataTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -4731,8 +4470,9 @@ func ctxTo_binding_DataTree(ps *env.ProgramState, v env.RyeCtx) (binding.DataTre } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataTree: arg 0: callback result: expected native", + "context to binding.DataTree: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -4745,8 +4485,9 @@ func ctxTo_binding_DataTree(ps *env.ProgramState, v env.RyeCtx) (binding.DataTre res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.DataTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -4754,8 +4495,9 @@ func ctxTo_binding_DataTree(ps *env.ProgramState, v env.RyeCtx) (binding.DataTre } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataTree: arg 0: callback result: expected error, string or nil", + "context to binding.DataTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -4764,54 +4506,45 @@ func ctxTo_binding_DataTree(ps *env.ProgramState, v env.RyeCtx) (binding.DataTre return res0, res1 } default: - return nil, errors.New("context to binding.DataTree: context fn GetItem: expected function") + return nil, errors.New("context to binding.DataTree: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["ChildIDs"] + ctxObj1, ok := wordToObj["child-i-ds"] if !ok { return nil, errors.New("context to binding.DataTree: expected context to have function ChildIDs") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.DataTree: context fn ChildIDs: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.DataTree: context fn ChildIDs: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_ChildIDs = func(ctx env.RyeCtx, arg0 string) []string { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_ChildIDs = func(ctx env.RyeCtx, farg0 string) []string { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res []string switch v := ps.Res.(type) { case env.Block: res = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - res[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + res[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataTree: arg 0: callback result: block item: expected string", + "context to binding.DataTree: arg 0: callback result: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataTree: arg 0: callback result: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.DataTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -4819,8 +4552,9 @@ func ctxTo_binding_DataTree(ps *env.ProgramState, v env.RyeCtx) (binding.DataTre } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.DataTree: arg 0: callback result: expected block, native or nil", + "context to binding.DataTree: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -4829,79 +4563,45 @@ func ctxTo_binding_DataTree(ps *env.ProgramState, v env.RyeCtx) (binding.DataTre return res } default: - return nil, errors.New("context to binding.DataTree: context fn ChildIDs: expected function") + return nil, errors.New("context to binding.DataTree: context fn ChildIDs: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["AddListener"] + ctxObj2, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.DataTree: expected context to have function AddListener") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.DataTree: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.DataTree: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.DataTree: context fn AddListener: expected function") + return nil, errors.New("context to binding.DataTree: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["RemoveListener"] + ctxObj3, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.DataTree: expected context to have function RemoveListener") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.DataTree: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.DataTree: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.DataTree: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.DataTree: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -4949,14 +4649,14 @@ func ctxTo_binding_ExternalBool(ps *env.ProgramState, v env.RyeCtx) (binding.Ext impl := &iface_binding_ExternalBool{ self: v, } - ctxObj0, ok := wordToObj["Reload"] + ctxObj0, ok := wordToObj["reload"] if !ok { return nil, errors.New("context to binding.ExternalBool: expected context to have function Reload") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalBool: context fn Reload: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalBool: context fn Reload: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Reload = func(ctx env.RyeCtx) error { actualFn := fn @@ -4970,8 +4670,9 @@ func ctxTo_binding_ExternalBool(ps *env.ProgramState, v env.RyeCtx) (binding.Ext res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBool: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBool: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -4979,8 +4680,9 @@ func ctxTo_binding_ExternalBool(ps *env.ProgramState, v env.RyeCtx) (binding.Ext } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBool: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBool: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -4989,16 +4691,16 @@ func ctxTo_binding_ExternalBool(ps *env.ProgramState, v env.RyeCtx) (binding.Ext return res } default: - return nil, errors.New("context to binding.ExternalBool: context fn Reload: expected function") + return nil, errors.New("context to binding.ExternalBool: context fn Reload: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Get"] + ctxObj1, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.ExternalBool: expected context to have function Get") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalBool: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalBool: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) (bool, error) { actualFn := fn @@ -5008,26 +4710,29 @@ func ctxTo_binding_ExternalBool(ps *env.ProgramState, v env.RyeCtx) (binding.Ext var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBool: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalBool: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBool: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalBool: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = v.Value != 0 + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBool: arg 0: callback result: expected integer", + "context to binding.ExternalBool: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5040,8 +4745,9 @@ func ctxTo_binding_ExternalBool(ps *env.ProgramState, v env.RyeCtx) (binding.Ext res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBool: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBool: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5049,8 +4755,9 @@ func ctxTo_binding_ExternalBool(ps *env.ProgramState, v env.RyeCtx) (binding.Ext } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBool: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBool: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5059,23 +4766,23 @@ func ctxTo_binding_ExternalBool(ps *env.ProgramState, v env.RyeCtx) (binding.Ext return res0, res1 } default: - return nil, errors.New("context to binding.ExternalBool: context fn Get: expected function") + return nil, errors.New("context to binding.ExternalBool: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Set"] + ctxObj2, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.ExternalBool: expected context to have function Set") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBool: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBool: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 bool) error { - var arg0Val env.Object - arg0Val = *env.NewInteger(boolToInt64(arg0)) + impl.fn_Set = func(ctx env.RyeCtx, farg0 bool) error { + var farg0Val env.Object + farg0Val = *env.NewInteger(boolToInt64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -5084,8 +4791,9 @@ func ctxTo_binding_ExternalBool(ps *env.ProgramState, v env.RyeCtx) (binding.Ext res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBool: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBool: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5093,8 +4801,9 @@ func ctxTo_binding_ExternalBool(ps *env.ProgramState, v env.RyeCtx) (binding.Ext } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBool: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBool: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5103,79 +4812,45 @@ func ctxTo_binding_ExternalBool(ps *env.ProgramState, v env.RyeCtx) (binding.Ext return res } default: - return nil, errors.New("context to binding.ExternalBool: context fn Set: expected function") + return nil, errors.New("context to binding.ExternalBool: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["AddListener"] + ctxObj3, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.ExternalBool: expected context to have function AddListener") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBool: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBool: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalBool: context fn AddListener: expected function") + return nil, errors.New("context to binding.ExternalBool: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["RemoveListener"] + ctxObj4, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.ExternalBool: expected context to have function RemoveListener") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBool: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBool: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalBool: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.ExternalBool: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -5247,14 +4922,14 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding impl := &iface_binding_ExternalBoolList{ self: v, } - ctxObj0, ok := wordToObj["Reload"] + ctxObj0, ok := wordToObj["reload"] if !ok { return nil, errors.New("context to binding.ExternalBoolList: expected context to have function Reload") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalBoolList: context fn Reload: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalBoolList: context fn Reload: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Reload = func(ctx env.RyeCtx) error { actualFn := fn @@ -5268,8 +4943,9 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBoolList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5277,8 +4953,9 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBoolList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5287,23 +4964,23 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding return res } default: - return nil, errors.New("context to binding.ExternalBoolList: context fn Reload: expected function") + return nil, errors.New("context to binding.ExternalBoolList: context fn Reload: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Append"] + ctxObj1, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.ExternalBoolList: expected context to have function Append") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBoolList: context fn Append: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBoolList: context fn Append: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 bool) error { - var arg0Val env.Object - arg0Val = *env.NewInteger(boolToInt64(arg0)) + impl.fn_Append = func(ctx env.RyeCtx, farg0 bool) error { + var farg0Val env.Object + farg0Val = *env.NewInteger(boolToInt64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -5312,8 +4989,9 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBoolList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5321,8 +4999,9 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBoolList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5331,16 +5010,16 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding return res } default: - return nil, errors.New("context to binding.ExternalBoolList: context fn Append: expected function") + return nil, errors.New("context to binding.ExternalBoolList: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Get"] + ctxObj2, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.ExternalBoolList: expected context to have function Get") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalBoolList: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalBoolList: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) ([]bool, error) { actualFn := fn @@ -5350,16 +5029,18 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalBoolList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalBoolList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5369,32 +5050,23 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding case env.Block: res0 = make([]bool, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.Integer); ok { - res0[i] = v.Value != 0 + if vc, ok := it.(env.Integer); ok { + res0[i] = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: block item: expected integer", + "context to binding.ExternalBoolList: arg 0: callback result: "+"block item: "+"expected integer, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } } - case env.Native: - var ok bool - res0, ok = v.Value.([]bool) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected native of type []bool", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBoolList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5402,8 +5074,9 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected block, native or nil", + "context to binding.ExternalBoolList: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5416,8 +5089,9 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBoolList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5425,8 +5099,9 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBoolList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5435,47 +5110,50 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding return res0, res1 } default: - return nil, errors.New("context to binding.ExternalBoolList: context fn Get: expected function") + return nil, errors.New("context to binding.ExternalBoolList: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["GetValue"] + ctxObj3, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.ExternalBoolList: expected context to have function GetValue") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBoolList: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBoolList: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 int) (bool, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 int) (bool, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 bool var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalBoolList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalBoolList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = v.Value != 0 + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected integer", + "context to binding.ExternalBoolList: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5488,8 +5166,9 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBoolList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5497,8 +5176,9 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBoolList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5507,23 +5187,23 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding return res0, res1 } default: - return nil, errors.New("context to binding.ExternalBoolList: context fn GetValue: expected function") + return nil, errors.New("context to binding.ExternalBoolList: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Prepend"] + ctxObj4, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.ExternalBoolList: expected context to have function Prepend") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBoolList: context fn Prepend: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBoolList: context fn Prepend: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 bool) error { - var arg0Val env.Object - arg0Val = *env.NewInteger(boolToInt64(arg0)) + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 bool) error { + var farg0Val env.Object + farg0Val = *env.NewInteger(boolToInt64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -5532,8 +5212,9 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBoolList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5541,8 +5222,9 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBoolList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5551,29 +5233,29 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding return res } default: - return nil, errors.New("context to binding.ExternalBoolList: context fn Prepend: expected function") + return nil, errors.New("context to binding.ExternalBoolList: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["Set"] + ctxObj5, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.ExternalBoolList: expected context to have function Set") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBoolList: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBoolList: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 []bool) error { - var arg0Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 []bool) error { + var farg0Val env.Object { - items := make([]env.Object, len(arg0)) - for i, it := range arg0 { + items := make([]env.Object, len(farg0)) + for i, it := range farg0 { items[i] = *env.NewInteger(boolToInt64(it)) } - arg0Val = *env.NewBlock(*env.NewTSeries(items)) + farg0Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -5582,8 +5264,9 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBoolList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5591,8 +5274,9 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBoolList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5601,24 +5285,24 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding return res } default: - return nil, errors.New("context to binding.ExternalBoolList: context fn Set: expected function") + return nil, errors.New("context to binding.ExternalBoolList: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["SetValue"] + ctxObj6, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.ExternalBoolList: expected context to have function SetValue") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.ExternalBoolList: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.ExternalBoolList: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 int, arg1 bool) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) - arg1Val = *env.NewInteger(boolToInt64(arg1)) + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 int, farg1 bool) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) + farg1Val = *env.NewInteger(boolToInt64(farg1)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -5627,8 +5311,9 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBoolList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5636,8 +5321,9 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBoolList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5646,37 +5332,39 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding return res } default: - return nil, errors.New("context to binding.ExternalBoolList: context fn SetValue: expected function") + return nil, errors.New("context to binding.ExternalBoolList: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["GetItem"] + ctxObj7, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.ExternalBoolList: expected context to have function GetItem") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBoolList: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBoolList: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 int) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 int) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalBoolList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalBoolList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5687,19 +5375,21 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: "+err.Error()+"", + "context to binding.ExternalBoolList: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.ExternalBoolList: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5707,8 +5397,9 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBoolList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5716,8 +5407,9 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected native", + "context to binding.ExternalBoolList: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5730,8 +5422,9 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBoolList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5739,8 +5432,9 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBoolList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5749,27 +5443,28 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding return res0, res1 } default: - return nil, errors.New("context to binding.ExternalBoolList: context fn GetItem: expected function") + return nil, errors.New("context to binding.ExternalBoolList: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["Length"] + ctxObj8, ok := wordToObj["length"] if !ok { return nil, errors.New("context to binding.ExternalBoolList: expected context to have function Length") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalBoolList: context fn Length: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalBoolList: context fn Length: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Length = func(ctx env.RyeCtx) int { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res int - if v, ok := ps.Res.(env.Integer); ok { - res = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + res = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolList: arg 0: callback result: expected integer", + "context to binding.ExternalBoolList: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5778,79 +5473,45 @@ func ctxTo_binding_ExternalBoolList(ps *env.ProgramState, v env.RyeCtx) (binding return res } default: - return nil, errors.New("context to binding.ExternalBoolList: context fn Length: expected function") + return nil, errors.New("context to binding.ExternalBoolList: context fn Length: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["AddListener"] + ctxObj9, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.ExternalBoolList: expected context to have function AddListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBoolList: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBoolList: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalBoolList: context fn AddListener: expected function") + return nil, errors.New("context to binding.ExternalBoolList: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj10, ok := wordToObj["RemoveListener"] + ctxObj10, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.ExternalBoolList: expected context to have function RemoveListener") } switch fn := ctxObj10.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBoolList: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBoolList: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalBoolList: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.ExternalBoolList: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -5922,14 +5583,14 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding impl := &iface_binding_ExternalBoolTree{ self: v, } - ctxObj0, ok := wordToObj["Reload"] + ctxObj0, ok := wordToObj["reload"] if !ok { return nil, errors.New("context to binding.ExternalBoolTree: expected context to have function Reload") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalBoolTree: context fn Reload: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalBoolTree: context fn Reload: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Reload = func(ctx env.RyeCtx) error { actualFn := fn @@ -5943,8 +5604,9 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5952,8 +5614,9 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5962,25 +5625,25 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding return res } default: - return nil, errors.New("context to binding.ExternalBoolTree: context fn Reload: expected function") + return nil, errors.New("context to binding.ExternalBoolTree: context fn Reload: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Append"] + ctxObj1, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.ExternalBoolTree: expected context to have function Append") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 3 { - return nil, errors.New("context to binding.ExternalBoolTree: context fn Append: function has invalid number of arguments (expected 3)") + return nil, errors.New("context to binding.ExternalBoolTree: context fn Append: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 string, arg1 string, arg2 bool) error { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) - arg2Val = *env.NewInteger(boolToInt64(arg2)) + impl.fn_Append = func(ctx env.RyeCtx, farg0 string, farg1 string, farg2 bool) error { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) + farg2Val = *env.NewInteger(boolToInt64(farg2)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val, farg2Val) var res error switch v := ps.Res.(type) { case env.String: @@ -5989,8 +5652,9 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -5998,8 +5662,9 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6008,16 +5673,16 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding return res } default: - return nil, errors.New("context to binding.ExternalBoolTree: context fn Append: expected function") + return nil, errors.New("context to binding.ExternalBoolTree: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Get"] + ctxObj2, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.ExternalBoolTree: expected context to have function Get") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalBoolTree: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalBoolTree: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) (map[string][]string, map[string]bool, error) { actualFn := fn @@ -6028,16 +5693,18 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding var res2 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } if len(res.Series.S) != 3 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected block with 3 return values", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected block with 3 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6046,8 +5713,9 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding switch v := res.Series.S[0].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6056,11 +5724,12 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding res0 = make(map[string][]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: map key: expected string", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6071,32 +5740,23 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: map value: block item: expected string", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"map value: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: map value: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6104,8 +5764,9 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6122,32 +5783,23 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: map value: block item: expected string", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"map value: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: map value: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6155,8 +5807,9 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6164,21 +5817,11 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding } res0[mapK] = mapV } - case env.Native: - var ok bool - res0, ok = v.Value.(map[string][]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected native of type map[string][]string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6186,8 +5829,9 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected native, block, dict or nil", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6196,8 +5840,9 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding switch v := res.Series.S[1].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6206,22 +5851,24 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding res1 = make(map[string]bool, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: map key: expected string", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } var mapV bool - if v, ok := v.Series.S[i+1].(env.Integer); ok { - mapV = v.Value != 0 + if vc, ok := v.Series.S[i+1].(env.Integer); ok { + mapV = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: map value: expected integer", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"map value: "+"expected integer, but got "+objectDebugString(ps.Idx, v.Series.S[i+1]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6234,11 +5881,12 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding for dictK, dictV := range v.Data { mapK := dictK var mapV bool - if v, ok := dictV.(env.Integer); ok { - mapV = v.Value != 0 + if vc, ok := dictV.(env.Integer); ok { + mapV = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: map value: expected integer", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"map value: "+"expected integer, but got "+objectDebugString(ps.Idx, dictV), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6246,21 +5894,11 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding } res1[mapK] = mapV } - case env.Native: - var ok bool - res1, ok = v.Value.(map[string]bool) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected native of type map[string]bool", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6268,8 +5906,9 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected native, block, dict or nil", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6282,8 +5921,9 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding res2 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6291,8 +5931,9 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding } res2 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6301,47 +5942,50 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding return res0, res1, res2 } default: - return nil, errors.New("context to binding.ExternalBoolTree: context fn Get: expected function") + return nil, errors.New("context to binding.ExternalBoolTree: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["GetValue"] + ctxObj3, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.ExternalBoolTree: expected context to have function GetValue") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBoolTree: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBoolTree: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 string) (bool, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 string) (bool, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 bool var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = v.Value != 0 + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected integer", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6354,8 +5998,9 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6363,8 +6008,9 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6373,25 +6019,25 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding return res0, res1 } default: - return nil, errors.New("context to binding.ExternalBoolTree: context fn GetValue: expected function") + return nil, errors.New("context to binding.ExternalBoolTree: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Prepend"] + ctxObj4, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.ExternalBoolTree: expected context to have function Prepend") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 3 { - return nil, errors.New("context to binding.ExternalBoolTree: context fn Prepend: function has invalid number of arguments (expected 3)") + return nil, errors.New("context to binding.ExternalBoolTree: context fn Prepend: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 string, arg1 string, arg2 bool) error { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) - arg2Val = *env.NewInteger(boolToInt64(arg2)) + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 string, farg1 string, farg2 bool) error { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) + farg2Val = *env.NewInteger(boolToInt64(farg2)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val, farg2Val) var res error switch v := ps.Res.(type) { case env.String: @@ -6400,8 +6046,9 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6409,8 +6056,9 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6419,22 +6067,22 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding return res } default: - return nil, errors.New("context to binding.ExternalBoolTree: context fn Prepend: expected function") + return nil, errors.New("context to binding.ExternalBoolTree: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["Set"] + ctxObj5, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.ExternalBoolTree: expected context to have function Set") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.ExternalBoolTree: context fn Set: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.ExternalBoolTree: context fn Set: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 map[string][]string, arg1 map[string]bool) error { - var arg0Val, arg1Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 map[string][]string, farg1 map[string]bool) error { + var farg0Val, farg1Val env.Object { - data := make(map[string]any, len(arg0)) - for mKey, mVal := range arg0 { + data := make(map[string]any, len(farg0)) + for mKey, mVal := range farg0 { var dVal env.Object { items := make([]env.Object, len(mVal)) @@ -6445,20 +6093,20 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding } data[mKey] = dVal } - arg0Val = *env.NewDict(data) + farg0Val = *env.NewDict(data) } { - data := make(map[string]any, len(arg1)) - for mKey, mVal := range arg1 { + data := make(map[string]any, len(farg1)) + for mKey, mVal := range farg1 { var dVal env.Object dVal = *env.NewInteger(boolToInt64(mVal)) data[mKey] = dVal } - arg1Val = *env.NewDict(data) + farg1Val = *env.NewDict(data) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -6467,8 +6115,9 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6476,8 +6125,9 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6486,24 +6136,24 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding return res } default: - return nil, errors.New("context to binding.ExternalBoolTree: context fn Set: expected function") + return nil, errors.New("context to binding.ExternalBoolTree: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["SetValue"] + ctxObj6, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.ExternalBoolTree: expected context to have function SetValue") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.ExternalBoolTree: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.ExternalBoolTree: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 string, arg1 bool) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewInteger(boolToInt64(arg1)) + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 string, farg1 bool) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewInteger(boolToInt64(farg1)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -6512,8 +6162,9 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6521,8 +6172,9 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6531,37 +6183,39 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding return res } default: - return nil, errors.New("context to binding.ExternalBoolTree: context fn SetValue: expected function") + return nil, errors.New("context to binding.ExternalBoolTree: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["GetItem"] + ctxObj7, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.ExternalBoolTree: expected context to have function GetItem") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBoolTree: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBoolTree: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 string) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 string) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6572,19 +6226,21 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: "+err.Error()+"", + "context to binding.ExternalBoolTree: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6592,8 +6248,9 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6601,8 +6258,9 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected native", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6615,8 +6273,9 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6624,8 +6283,9 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6634,54 +6294,45 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding return res0, res1 } default: - return nil, errors.New("context to binding.ExternalBoolTree: context fn GetItem: expected function") + return nil, errors.New("context to binding.ExternalBoolTree: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["ChildIDs"] + ctxObj8, ok := wordToObj["child-i-ds"] if !ok { return nil, errors.New("context to binding.ExternalBoolTree: expected context to have function ChildIDs") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBoolTree: context fn ChildIDs: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBoolTree: context fn ChildIDs: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_ChildIDs = func(ctx env.RyeCtx, arg0 string) []string { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_ChildIDs = func(ctx env.RyeCtx, farg0 string) []string { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res []string switch v := ps.Res.(type) { case env.Block: res = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - res[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + res[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: block item: expected string", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6689,8 +6340,9 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBoolTree: arg 0: callback result: expected block, native or nil", + "context to binding.ExternalBoolTree: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6699,79 +6351,45 @@ func ctxTo_binding_ExternalBoolTree(ps *env.ProgramState, v env.RyeCtx) (binding return res } default: - return nil, errors.New("context to binding.ExternalBoolTree: context fn ChildIDs: expected function") + return nil, errors.New("context to binding.ExternalBoolTree: context fn ChildIDs: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["AddListener"] + ctxObj9, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.ExternalBoolTree: expected context to have function AddListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBoolTree: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBoolTree: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalBoolTree: context fn AddListener: expected function") + return nil, errors.New("context to binding.ExternalBoolTree: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj10, ok := wordToObj["RemoveListener"] + ctxObj10, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.ExternalBoolTree: expected context to have function RemoveListener") } switch fn := ctxObj10.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBoolTree: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBoolTree: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalBoolTree: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.ExternalBoolTree: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -6819,14 +6437,14 @@ func ctxTo_binding_ExternalBytes(ps *env.ProgramState, v env.RyeCtx) (binding.Ex impl := &iface_binding_ExternalBytes{ self: v, } - ctxObj0, ok := wordToObj["Reload"] + ctxObj0, ok := wordToObj["reload"] if !ok { return nil, errors.New("context to binding.ExternalBytes: expected context to have function Reload") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalBytes: context fn Reload: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalBytes: context fn Reload: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Reload = func(ctx env.RyeCtx) error { actualFn := fn @@ -6840,8 +6458,9 @@ func ctxTo_binding_ExternalBytes(ps *env.ProgramState, v env.RyeCtx) (binding.Ex res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytes: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBytes: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6849,8 +6468,9 @@ func ctxTo_binding_ExternalBytes(ps *env.ProgramState, v env.RyeCtx) (binding.Ex } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytes: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBytes: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6859,16 +6479,16 @@ func ctxTo_binding_ExternalBytes(ps *env.ProgramState, v env.RyeCtx) (binding.Ex return res } default: - return nil, errors.New("context to binding.ExternalBytes: context fn Reload: expected function") + return nil, errors.New("context to binding.ExternalBytes: context fn Reload: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Get"] + ctxObj1, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.ExternalBytes: expected context to have function Get") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalBytes: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalBytes: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) ([]byte, error) { actualFn := fn @@ -6878,16 +6498,18 @@ func ctxTo_binding_ExternalBytes(ps *env.ProgramState, v env.RyeCtx) (binding.Ex var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytes: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalBytes: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytes: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalBytes: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6899,40 +6521,32 @@ func ctxTo_binding_ExternalBytes(ps *env.ProgramState, v env.RyeCtx) (binding.Ex for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - res0[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + res0[i] = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytes: arg 0: callback result: block item: expected native of type byte", + "context to binding.ExternalBytes: arg 0: callback result: "+"block item: "+"expected native of type byte, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytes: arg 0: callback result: block item: expected native", + "context to binding.ExternalBytes: arg 0: callback result: "+"block item: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } } - case env.Native: - var ok bool - res0, ok = v.Value.([]byte) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytes: arg 0: callback result: expected native of type []byte", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytes: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBytes: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6940,8 +6554,9 @@ func ctxTo_binding_ExternalBytes(ps *env.ProgramState, v env.RyeCtx) (binding.Ex } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytes: arg 0: callback result: expected block, native or nil", + "context to binding.ExternalBytes: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6954,8 +6569,9 @@ func ctxTo_binding_ExternalBytes(ps *env.ProgramState, v env.RyeCtx) (binding.Ex res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytes: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBytes: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6963,8 +6579,9 @@ func ctxTo_binding_ExternalBytes(ps *env.ProgramState, v env.RyeCtx) (binding.Ex } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytes: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBytes: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -6973,29 +6590,29 @@ func ctxTo_binding_ExternalBytes(ps *env.ProgramState, v env.RyeCtx) (binding.Ex return res0, res1 } default: - return nil, errors.New("context to binding.ExternalBytes: context fn Get: expected function") + return nil, errors.New("context to binding.ExternalBytes: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Set"] + ctxObj2, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.ExternalBytes: expected context to have function Set") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBytes: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBytes: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 []byte) error { - var arg0Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 []byte) error { + var farg0Val env.Object { - items := make([]env.Object, len(arg0)) - for i, it := range arg0 { + items := make([]env.Object, len(farg0)) + for i, it := range farg0 { items[i] = *env.NewNative(ps.Idx, it, "Go(byte)") } - arg0Val = *env.NewBlock(*env.NewTSeries(items)) + farg0Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -7004,8 +6621,9 @@ func ctxTo_binding_ExternalBytes(ps *env.ProgramState, v env.RyeCtx) (binding.Ex res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytes: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBytes: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7013,8 +6631,9 @@ func ctxTo_binding_ExternalBytes(ps *env.ProgramState, v env.RyeCtx) (binding.Ex } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytes: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBytes: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7023,79 +6642,45 @@ func ctxTo_binding_ExternalBytes(ps *env.ProgramState, v env.RyeCtx) (binding.Ex return res } default: - return nil, errors.New("context to binding.ExternalBytes: context fn Set: expected function") + return nil, errors.New("context to binding.ExternalBytes: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["AddListener"] + ctxObj3, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.ExternalBytes: expected context to have function AddListener") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBytes: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBytes: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalBytes: context fn AddListener: expected function") + return nil, errors.New("context to binding.ExternalBytes: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["RemoveListener"] + ctxObj4, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.ExternalBytes: expected context to have function RemoveListener") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBytes: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBytes: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalBytes: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.ExternalBytes: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -7167,14 +6752,14 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin impl := &iface_binding_ExternalBytesList{ self: v, } - ctxObj0, ok := wordToObj["Reload"] + ctxObj0, ok := wordToObj["reload"] if !ok { return nil, errors.New("context to binding.ExternalBytesList: expected context to have function Reload") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalBytesList: context fn Reload: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalBytesList: context fn Reload: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Reload = func(ctx env.RyeCtx) error { actualFn := fn @@ -7188,8 +6773,9 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7197,8 +6783,9 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7207,29 +6794,29 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin return res } default: - return nil, errors.New("context to binding.ExternalBytesList: context fn Reload: expected function") + return nil, errors.New("context to binding.ExternalBytesList: context fn Reload: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Append"] + ctxObj1, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.ExternalBytesList: expected context to have function Append") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBytesList: context fn Append: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBytesList: context fn Append: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 []byte) error { - var arg0Val env.Object + impl.fn_Append = func(ctx env.RyeCtx, farg0 []byte) error { + var farg0Val env.Object { - items := make([]env.Object, len(arg0)) - for i, it := range arg0 { + items := make([]env.Object, len(farg0)) + for i, it := range farg0 { items[i] = *env.NewNative(ps.Idx, it, "Go(byte)") } - arg0Val = *env.NewBlock(*env.NewTSeries(items)) + farg0Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -7238,8 +6825,9 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7247,8 +6835,9 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7257,16 +6846,16 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin return res } default: - return nil, errors.New("context to binding.ExternalBytesList: context fn Append: expected function") + return nil, errors.New("context to binding.ExternalBytesList: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Get"] + ctxObj2, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.ExternalBytesList: expected context to have function Get") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalBytesList: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalBytesList: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) ([][]byte, error) { actualFn := fn @@ -7276,16 +6865,18 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7301,40 +6892,32 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - res0[i][i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + res0[i][i] = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: block item: block item: expected native of type byte", + "context to binding.ExternalBytesList: arg 0: callback result: "+"block item: "+"block item: "+"expected native of type byte, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: block item: block item: expected native", + "context to binding.ExternalBytesList: arg 0: callback result: "+"block item: "+"block item: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } } - case env.Native: - var ok bool - res0[i], ok = v.Value.([]byte) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: block item: expected native of type []byte", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: block item: expected integer to be 0 or nil", + "context to binding.ExternalBytesList: arg 0: callback result: "+"block item: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7342,29 +6925,20 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin } res0[i] = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: block item: expected block, native or nil", + "context to binding.ExternalBytesList: arg 0: callback result: "+"block item: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } } - case env.Native: - var ok bool - res0, ok = v.Value.([][]byte) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected native of type [][]byte", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7372,8 +6946,9 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected block, native or nil", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7386,8 +6961,9 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7395,8 +6971,9 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7405,37 +6982,39 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin return res0, res1 } default: - return nil, errors.New("context to binding.ExternalBytesList: context fn Get: expected function") + return nil, errors.New("context to binding.ExternalBytesList: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["GetValue"] + ctxObj3, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.ExternalBytesList: expected context to have function GetValue") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBytesList: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBytesList: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 int) ([]byte, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 int) ([]byte, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 []byte var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7447,40 +7026,32 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - res0[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + res0[i] = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: block item: expected native of type byte", + "context to binding.ExternalBytesList: arg 0: callback result: "+"block item: "+"expected native of type byte, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: block item: expected native", + "context to binding.ExternalBytesList: arg 0: callback result: "+"block item: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } } - case env.Native: - var ok bool - res0, ok = v.Value.([]byte) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected native of type []byte", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7488,8 +7059,9 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected block, native or nil", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7502,8 +7074,9 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7511,8 +7084,9 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7521,29 +7095,29 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin return res0, res1 } default: - return nil, errors.New("context to binding.ExternalBytesList: context fn GetValue: expected function") + return nil, errors.New("context to binding.ExternalBytesList: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Prepend"] + ctxObj4, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.ExternalBytesList: expected context to have function Prepend") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBytesList: context fn Prepend: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBytesList: context fn Prepend: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 []byte) error { - var arg0Val env.Object + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 []byte) error { + var farg0Val env.Object { - items := make([]env.Object, len(arg0)) - for i, it := range arg0 { + items := make([]env.Object, len(farg0)) + for i, it := range farg0 { items[i] = *env.NewNative(ps.Idx, it, "Go(byte)") } - arg0Val = *env.NewBlock(*env.NewTSeries(items)) + farg0Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -7552,8 +7126,9 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7561,8 +7136,9 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7571,22 +7147,22 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin return res } default: - return nil, errors.New("context to binding.ExternalBytesList: context fn Prepend: expected function") + return nil, errors.New("context to binding.ExternalBytesList: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["Set"] + ctxObj5, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.ExternalBytesList: expected context to have function Set") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBytesList: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBytesList: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 [][]byte) error { - var arg0Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 [][]byte) error { + var farg0Val env.Object { - items := make([]env.Object, len(arg0)) - for i, it := range arg0 { + items := make([]env.Object, len(farg0)) + for i, it := range farg0 { { items := make([]env.Object, len(it)) for i, it := range it { @@ -7595,11 +7171,11 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin items[i] = *env.NewBlock(*env.NewTSeries(items)) } } - arg0Val = *env.NewBlock(*env.NewTSeries(items)) + farg0Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -7608,8 +7184,9 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7617,8 +7194,9 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7627,30 +7205,30 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin return res } default: - return nil, errors.New("context to binding.ExternalBytesList: context fn Set: expected function") + return nil, errors.New("context to binding.ExternalBytesList: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["SetValue"] + ctxObj6, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.ExternalBytesList: expected context to have function SetValue") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.ExternalBytesList: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.ExternalBytesList: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 int, arg1 []byte) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 int, farg1 []byte) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) { - items := make([]env.Object, len(arg1)) - for i, it := range arg1 { + items := make([]env.Object, len(farg1)) + for i, it := range farg1 { items[i] = *env.NewNative(ps.Idx, it, "Go(byte)") } - arg1Val = *env.NewBlock(*env.NewTSeries(items)) + farg1Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -7659,8 +7237,9 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7668,8 +7247,9 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7678,37 +7258,39 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin return res } default: - return nil, errors.New("context to binding.ExternalBytesList: context fn SetValue: expected function") + return nil, errors.New("context to binding.ExternalBytesList: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["GetItem"] + ctxObj7, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.ExternalBytesList: expected context to have function GetItem") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBytesList: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBytesList: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 int) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 int) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7719,19 +7301,21 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: "+err.Error()+"", + "context to binding.ExternalBytesList: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7739,8 +7323,9 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7748,8 +7333,9 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected native", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7762,8 +7348,9 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7771,8 +7358,9 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7781,27 +7369,28 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin return res0, res1 } default: - return nil, errors.New("context to binding.ExternalBytesList: context fn GetItem: expected function") + return nil, errors.New("context to binding.ExternalBytesList: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["Length"] + ctxObj8, ok := wordToObj["length"] if !ok { return nil, errors.New("context to binding.ExternalBytesList: expected context to have function Length") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalBytesList: context fn Length: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalBytesList: context fn Length: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Length = func(ctx env.RyeCtx) int { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res int - if v, ok := ps.Res.(env.Integer); ok { - res = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + res = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesList: arg 0: callback result: expected integer", + "context to binding.ExternalBytesList: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7810,79 +7399,45 @@ func ctxTo_binding_ExternalBytesList(ps *env.ProgramState, v env.RyeCtx) (bindin return res } default: - return nil, errors.New("context to binding.ExternalBytesList: context fn Length: expected function") + return nil, errors.New("context to binding.ExternalBytesList: context fn Length: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["AddListener"] + ctxObj9, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.ExternalBytesList: expected context to have function AddListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBytesList: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBytesList: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalBytesList: context fn AddListener: expected function") + return nil, errors.New("context to binding.ExternalBytesList: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj10, ok := wordToObj["RemoveListener"] + ctxObj10, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.ExternalBytesList: expected context to have function RemoveListener") } switch fn := ctxObj10.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBytesList: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBytesList: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalBytesList: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.ExternalBytesList: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -7954,14 +7509,14 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin impl := &iface_binding_ExternalBytesTree{ self: v, } - ctxObj0, ok := wordToObj["Reload"] + ctxObj0, ok := wordToObj["reload"] if !ok { return nil, errors.New("context to binding.ExternalBytesTree: expected context to have function Reload") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalBytesTree: context fn Reload: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalBytesTree: context fn Reload: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Reload = func(ctx env.RyeCtx) error { actualFn := fn @@ -7975,8 +7530,9 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7984,8 +7540,9 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -7994,31 +7551,31 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin return res } default: - return nil, errors.New("context to binding.ExternalBytesTree: context fn Reload: expected function") + return nil, errors.New("context to binding.ExternalBytesTree: context fn Reload: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Append"] + ctxObj1, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.ExternalBytesTree: expected context to have function Append") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 3 { - return nil, errors.New("context to binding.ExternalBytesTree: context fn Append: function has invalid number of arguments (expected 3)") + return nil, errors.New("context to binding.ExternalBytesTree: context fn Append: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 string, arg1 string, arg2 []byte) error { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) + impl.fn_Append = func(ctx env.RyeCtx, farg0 string, farg1 string, farg2 []byte) error { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) { - items := make([]env.Object, len(arg2)) - for i, it := range arg2 { + items := make([]env.Object, len(farg2)) + for i, it := range farg2 { items[i] = *env.NewNative(ps.Idx, it, "Go(byte)") } - arg2Val = *env.NewBlock(*env.NewTSeries(items)) + farg2Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val, farg2Val) var res error switch v := ps.Res.(type) { case env.String: @@ -8027,8 +7584,9 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8036,8 +7594,9 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8046,16 +7605,16 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin return res } default: - return nil, errors.New("context to binding.ExternalBytesTree: context fn Append: expected function") + return nil, errors.New("context to binding.ExternalBytesTree: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Get"] + ctxObj2, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.ExternalBytesTree: expected context to have function Get") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalBytesTree: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalBytesTree: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) (map[string][]string, map[string][]byte, error) { actualFn := fn @@ -8066,16 +7625,18 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin var res2 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } if len(res.Series.S) != 3 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected block with 3 return values", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected block with 3 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8084,8 +7645,9 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin switch v := res.Series.S[0].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8094,11 +7656,12 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin res0 = make(map[string][]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: map key: expected string", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8109,32 +7672,23 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: map value: block item: expected string", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"map value: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: map value: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8142,8 +7696,9 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8160,32 +7715,23 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: map value: block item: expected string", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"map value: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: map value: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8193,8 +7739,9 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8202,21 +7749,11 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin } res0[mapK] = mapV } - case env.Native: - var ok bool - res0, ok = v.Value.(map[string][]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected native of type map[string][]string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8224,8 +7761,9 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected native, block, dict or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8234,8 +7772,9 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin switch v := res.Series.S[1].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8244,11 +7783,12 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin res1 = make(map[string][]byte, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: map key: expected string", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8261,40 +7801,32 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - mapV[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + mapV[i] = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: map value: block item: expected native of type byte", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"map value: "+"block item: "+"expected native of type byte, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: map value: block item: expected native", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"map value: "+"block item: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]byte) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: map value: expected native of type []byte", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8302,8 +7834,9 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8322,40 +7855,32 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - mapV[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + mapV[i] = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: map value: block item: expected native of type byte", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"map value: "+"block item: "+"expected native of type byte, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: map value: block item: expected native", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"map value: "+"block item: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]byte) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: map value: expected native of type []byte", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8363,8 +7888,9 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8372,21 +7898,11 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin } res1[mapK] = mapV } - case env.Native: - var ok bool - res1, ok = v.Value.(map[string][]byte) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected native of type map[string][]byte", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8394,8 +7910,9 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected native, block, dict or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8408,8 +7925,9 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin res2 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8417,8 +7935,9 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin } res2 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8427,37 +7946,39 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin return res0, res1, res2 } default: - return nil, errors.New("context to binding.ExternalBytesTree: context fn Get: expected function") + return nil, errors.New("context to binding.ExternalBytesTree: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["GetValue"] + ctxObj3, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.ExternalBytesTree: expected context to have function GetValue") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBytesTree: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBytesTree: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 string) ([]byte, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 string) ([]byte, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 []byte var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8469,40 +7990,32 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - res0[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + res0[i] = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: block item: expected native of type byte", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"block item: "+"expected native of type byte, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: block item: expected native", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"block item: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } } - case env.Native: - var ok bool - res0, ok = v.Value.([]byte) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected native of type []byte", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8510,8 +8023,9 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected block, native or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8524,8 +8038,9 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8533,8 +8048,9 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8543,31 +8059,31 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin return res0, res1 } default: - return nil, errors.New("context to binding.ExternalBytesTree: context fn GetValue: expected function") + return nil, errors.New("context to binding.ExternalBytesTree: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Prepend"] + ctxObj4, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.ExternalBytesTree: expected context to have function Prepend") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 3 { - return nil, errors.New("context to binding.ExternalBytesTree: context fn Prepend: function has invalid number of arguments (expected 3)") + return nil, errors.New("context to binding.ExternalBytesTree: context fn Prepend: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 string, arg1 string, arg2 []byte) error { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 string, farg1 string, farg2 []byte) error { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) { - items := make([]env.Object, len(arg2)) - for i, it := range arg2 { + items := make([]env.Object, len(farg2)) + for i, it := range farg2 { items[i] = *env.NewNative(ps.Idx, it, "Go(byte)") } - arg2Val = *env.NewBlock(*env.NewTSeries(items)) + farg2Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val, farg2Val) var res error switch v := ps.Res.(type) { case env.String: @@ -8576,8 +8092,9 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8585,8 +8102,9 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8595,22 +8113,22 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin return res } default: - return nil, errors.New("context to binding.ExternalBytesTree: context fn Prepend: expected function") + return nil, errors.New("context to binding.ExternalBytesTree: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["Set"] + ctxObj5, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.ExternalBytesTree: expected context to have function Set") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.ExternalBytesTree: context fn Set: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.ExternalBytesTree: context fn Set: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 map[string][]string, arg1 map[string][]byte) error { - var arg0Val, arg1Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 map[string][]string, farg1 map[string][]byte) error { + var farg0Val, farg1Val env.Object { - data := make(map[string]any, len(arg0)) - for mKey, mVal := range arg0 { + data := make(map[string]any, len(farg0)) + for mKey, mVal := range farg0 { var dVal env.Object { items := make([]env.Object, len(mVal)) @@ -8621,11 +8139,11 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin } data[mKey] = dVal } - arg0Val = *env.NewDict(data) + farg0Val = *env.NewDict(data) } { - data := make(map[string]any, len(arg1)) - for mKey, mVal := range arg1 { + data := make(map[string]any, len(farg1)) + for mKey, mVal := range farg1 { var dVal env.Object { items := make([]env.Object, len(mVal)) @@ -8636,11 +8154,11 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin } data[mKey] = dVal } - arg1Val = *env.NewDict(data) + farg1Val = *env.NewDict(data) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -8649,8 +8167,9 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8658,8 +8177,9 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8668,30 +8188,30 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin return res } default: - return nil, errors.New("context to binding.ExternalBytesTree: context fn Set: expected function") + return nil, errors.New("context to binding.ExternalBytesTree: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["SetValue"] + ctxObj6, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.ExternalBytesTree: expected context to have function SetValue") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.ExternalBytesTree: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.ExternalBytesTree: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 string, arg1 []byte) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 string, farg1 []byte) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) { - items := make([]env.Object, len(arg1)) - for i, it := range arg1 { + items := make([]env.Object, len(farg1)) + for i, it := range farg1 { items[i] = *env.NewNative(ps.Idx, it, "Go(byte)") } - arg1Val = *env.NewBlock(*env.NewTSeries(items)) + farg1Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -8700,8 +8220,9 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8709,8 +8230,9 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8719,37 +8241,39 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin return res } default: - return nil, errors.New("context to binding.ExternalBytesTree: context fn SetValue: expected function") + return nil, errors.New("context to binding.ExternalBytesTree: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["GetItem"] + ctxObj7, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.ExternalBytesTree: expected context to have function GetItem") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBytesTree: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBytesTree: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 string) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 string) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8760,19 +8284,21 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: "+err.Error()+"", + "context to binding.ExternalBytesTree: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8780,8 +8306,9 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8789,8 +8316,9 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected native", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8803,8 +8331,9 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8812,8 +8341,9 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8822,54 +8352,45 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin return res0, res1 } default: - return nil, errors.New("context to binding.ExternalBytesTree: context fn GetItem: expected function") + return nil, errors.New("context to binding.ExternalBytesTree: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["ChildIDs"] + ctxObj8, ok := wordToObj["child-i-ds"] if !ok { return nil, errors.New("context to binding.ExternalBytesTree: expected context to have function ChildIDs") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBytesTree: context fn ChildIDs: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBytesTree: context fn ChildIDs: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_ChildIDs = func(ctx env.RyeCtx, arg0 string) []string { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_ChildIDs = func(ctx env.RyeCtx, farg0 string) []string { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res []string switch v := ps.Res.(type) { case env.Block: res = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - res[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + res[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: block item: expected string", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8877,8 +8398,9 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalBytesTree: arg 0: callback result: expected block, native or nil", + "context to binding.ExternalBytesTree: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -8887,79 +8409,45 @@ func ctxTo_binding_ExternalBytesTree(ps *env.ProgramState, v env.RyeCtx) (bindin return res } default: - return nil, errors.New("context to binding.ExternalBytesTree: context fn ChildIDs: expected function") + return nil, errors.New("context to binding.ExternalBytesTree: context fn ChildIDs: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["AddListener"] + ctxObj9, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.ExternalBytesTree: expected context to have function AddListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBytesTree: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBytesTree: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalBytesTree: context fn AddListener: expected function") + return nil, errors.New("context to binding.ExternalBytesTree: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj10, ok := wordToObj["RemoveListener"] + ctxObj10, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.ExternalBytesTree: expected context to have function RemoveListener") } switch fn := ctxObj10.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalBytesTree: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalBytesTree: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalBytesTree: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.ExternalBytesTree: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -9007,14 +8495,14 @@ func ctxTo_binding_ExternalFloat(ps *env.ProgramState, v env.RyeCtx) (binding.Ex impl := &iface_binding_ExternalFloat{ self: v, } - ctxObj0, ok := wordToObj["Reload"] + ctxObj0, ok := wordToObj["reload"] if !ok { return nil, errors.New("context to binding.ExternalFloat: expected context to have function Reload") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalFloat: context fn Reload: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalFloat: context fn Reload: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Reload = func(ctx env.RyeCtx) error { actualFn := fn @@ -9028,8 +8516,9 @@ func ctxTo_binding_ExternalFloat(ps *env.ProgramState, v env.RyeCtx) (binding.Ex res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloat: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalFloat: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9037,8 +8526,9 @@ func ctxTo_binding_ExternalFloat(ps *env.ProgramState, v env.RyeCtx) (binding.Ex } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloat: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalFloat: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9047,16 +8537,16 @@ func ctxTo_binding_ExternalFloat(ps *env.ProgramState, v env.RyeCtx) (binding.Ex return res } default: - return nil, errors.New("context to binding.ExternalFloat: context fn Reload: expected function") + return nil, errors.New("context to binding.ExternalFloat: context fn Reload: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Get"] + ctxObj1, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.ExternalFloat: expected context to have function Get") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalFloat: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalFloat: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) (float64, error) { actualFn := fn @@ -9066,26 +8556,29 @@ func ctxTo_binding_ExternalFloat(ps *env.ProgramState, v env.RyeCtx) (binding.Ex var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloat: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalFloat: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloat: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalFloat: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Decimal); ok { - res0 = float64(v.Value) + if vc, ok := res.Series.S[0].(env.Decimal); ok { + res0 = float64(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloat: arg 0: callback result: expected decimal", + "context to binding.ExternalFloat: arg 0: callback result: "+"expected decimal, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9098,8 +8591,9 @@ func ctxTo_binding_ExternalFloat(ps *env.ProgramState, v env.RyeCtx) (binding.Ex res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloat: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalFloat: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9107,8 +8601,9 @@ func ctxTo_binding_ExternalFloat(ps *env.ProgramState, v env.RyeCtx) (binding.Ex } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloat: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalFloat: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9117,23 +8612,23 @@ func ctxTo_binding_ExternalFloat(ps *env.ProgramState, v env.RyeCtx) (binding.Ex return res0, res1 } default: - return nil, errors.New("context to binding.ExternalFloat: context fn Get: expected function") + return nil, errors.New("context to binding.ExternalFloat: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Set"] + ctxObj2, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.ExternalFloat: expected context to have function Set") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalFloat: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalFloat: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 float64) error { - var arg0Val env.Object - arg0Val = *env.NewDecimal(float64(arg0)) + impl.fn_Set = func(ctx env.RyeCtx, farg0 float64) error { + var farg0Val env.Object + farg0Val = *env.NewDecimal(float64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -9142,8 +8637,9 @@ func ctxTo_binding_ExternalFloat(ps *env.ProgramState, v env.RyeCtx) (binding.Ex res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloat: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalFloat: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9151,8 +8647,9 @@ func ctxTo_binding_ExternalFloat(ps *env.ProgramState, v env.RyeCtx) (binding.Ex } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloat: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalFloat: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9161,79 +8658,45 @@ func ctxTo_binding_ExternalFloat(ps *env.ProgramState, v env.RyeCtx) (binding.Ex return res } default: - return nil, errors.New("context to binding.ExternalFloat: context fn Set: expected function") + return nil, errors.New("context to binding.ExternalFloat: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["AddListener"] + ctxObj3, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.ExternalFloat: expected context to have function AddListener") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalFloat: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalFloat: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalFloat: context fn AddListener: expected function") + return nil, errors.New("context to binding.ExternalFloat: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["RemoveListener"] + ctxObj4, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.ExternalFloat: expected context to have function RemoveListener") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalFloat: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalFloat: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalFloat: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.ExternalFloat: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -9305,14 +8768,14 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin impl := &iface_binding_ExternalFloatList{ self: v, } - ctxObj0, ok := wordToObj["Reload"] + ctxObj0, ok := wordToObj["reload"] if !ok { return nil, errors.New("context to binding.ExternalFloatList: expected context to have function Reload") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalFloatList: context fn Reload: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalFloatList: context fn Reload: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Reload = func(ctx env.RyeCtx) error { actualFn := fn @@ -9326,8 +8789,9 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalFloatList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9335,8 +8799,9 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalFloatList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9345,23 +8810,23 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin return res } default: - return nil, errors.New("context to binding.ExternalFloatList: context fn Reload: expected function") + return nil, errors.New("context to binding.ExternalFloatList: context fn Reload: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Append"] + ctxObj1, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.ExternalFloatList: expected context to have function Append") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalFloatList: context fn Append: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalFloatList: context fn Append: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 float64) error { - var arg0Val env.Object - arg0Val = *env.NewDecimal(float64(arg0)) + impl.fn_Append = func(ctx env.RyeCtx, farg0 float64) error { + var farg0Val env.Object + farg0Val = *env.NewDecimal(float64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -9370,8 +8835,9 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalFloatList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9379,8 +8845,9 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalFloatList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9389,16 +8856,16 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin return res } default: - return nil, errors.New("context to binding.ExternalFloatList: context fn Append: expected function") + return nil, errors.New("context to binding.ExternalFloatList: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Get"] + ctxObj2, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.ExternalFloatList: expected context to have function Get") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalFloatList: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalFloatList: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) ([]float64, error) { actualFn := fn @@ -9408,16 +8875,18 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalFloatList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalFloatList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9427,32 +8896,23 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin case env.Block: res0 = make([]float64, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.Decimal); ok { - res0[i] = float64(v.Value) + if vc, ok := it.(env.Decimal); ok { + res0[i] = float64(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: block item: expected decimal", + "context to binding.ExternalFloatList: arg 0: callback result: "+"block item: "+"expected decimal, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } } - case env.Native: - var ok bool - res0, ok = v.Value.([]float64) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected native of type []float64", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalFloatList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9460,8 +8920,9 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected block, native or nil", + "context to binding.ExternalFloatList: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9474,8 +8935,9 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalFloatList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9483,8 +8945,9 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalFloatList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9493,47 +8956,50 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin return res0, res1 } default: - return nil, errors.New("context to binding.ExternalFloatList: context fn Get: expected function") + return nil, errors.New("context to binding.ExternalFloatList: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["GetValue"] + ctxObj3, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.ExternalFloatList: expected context to have function GetValue") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalFloatList: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalFloatList: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 int) (float64, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 int) (float64, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 float64 var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalFloatList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalFloatList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Decimal); ok { - res0 = float64(v.Value) + if vc, ok := res.Series.S[0].(env.Decimal); ok { + res0 = float64(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected decimal", + "context to binding.ExternalFloatList: arg 0: callback result: "+"expected decimal, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9546,8 +9012,9 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalFloatList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9555,8 +9022,9 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalFloatList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9565,23 +9033,23 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin return res0, res1 } default: - return nil, errors.New("context to binding.ExternalFloatList: context fn GetValue: expected function") + return nil, errors.New("context to binding.ExternalFloatList: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Prepend"] + ctxObj4, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.ExternalFloatList: expected context to have function Prepend") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalFloatList: context fn Prepend: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalFloatList: context fn Prepend: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 float64) error { - var arg0Val env.Object - arg0Val = *env.NewDecimal(float64(arg0)) + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 float64) error { + var farg0Val env.Object + farg0Val = *env.NewDecimal(float64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -9590,8 +9058,9 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalFloatList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9599,8 +9068,9 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalFloatList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9609,29 +9079,29 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin return res } default: - return nil, errors.New("context to binding.ExternalFloatList: context fn Prepend: expected function") + return nil, errors.New("context to binding.ExternalFloatList: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["Set"] + ctxObj5, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.ExternalFloatList: expected context to have function Set") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalFloatList: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalFloatList: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 []float64) error { - var arg0Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 []float64) error { + var farg0Val env.Object { - items := make([]env.Object, len(arg0)) - for i, it := range arg0 { + items := make([]env.Object, len(farg0)) + for i, it := range farg0 { items[i] = *env.NewDecimal(float64(it)) } - arg0Val = *env.NewBlock(*env.NewTSeries(items)) + farg0Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -9640,8 +9110,9 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalFloatList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9649,8 +9120,9 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalFloatList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9659,24 +9131,24 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin return res } default: - return nil, errors.New("context to binding.ExternalFloatList: context fn Set: expected function") + return nil, errors.New("context to binding.ExternalFloatList: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["SetValue"] + ctxObj6, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.ExternalFloatList: expected context to have function SetValue") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.ExternalFloatList: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.ExternalFloatList: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 int, arg1 float64) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) - arg1Val = *env.NewDecimal(float64(arg1)) + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 int, farg1 float64) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) + farg1Val = *env.NewDecimal(float64(farg1)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -9685,8 +9157,9 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalFloatList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9694,8 +9167,9 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalFloatList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9704,37 +9178,39 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin return res } default: - return nil, errors.New("context to binding.ExternalFloatList: context fn SetValue: expected function") + return nil, errors.New("context to binding.ExternalFloatList: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["GetItem"] + ctxObj7, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.ExternalFloatList: expected context to have function GetItem") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalFloatList: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalFloatList: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 int) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 int) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalFloatList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalFloatList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9745,19 +9221,21 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: "+err.Error()+"", + "context to binding.ExternalFloatList: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.ExternalFloatList: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9765,8 +9243,9 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalFloatList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9774,8 +9253,9 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected native", + "context to binding.ExternalFloatList: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9788,8 +9268,9 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalFloatList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9797,8 +9278,9 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalFloatList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9807,27 +9289,28 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin return res0, res1 } default: - return nil, errors.New("context to binding.ExternalFloatList: context fn GetItem: expected function") + return nil, errors.New("context to binding.ExternalFloatList: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["Length"] + ctxObj8, ok := wordToObj["length"] if !ok { return nil, errors.New("context to binding.ExternalFloatList: expected context to have function Length") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalFloatList: context fn Length: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalFloatList: context fn Length: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Length = func(ctx env.RyeCtx) int { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res int - if v, ok := ps.Res.(env.Integer); ok { - res = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + res = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatList: arg 0: callback result: expected integer", + "context to binding.ExternalFloatList: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -9836,79 +9319,45 @@ func ctxTo_binding_ExternalFloatList(ps *env.ProgramState, v env.RyeCtx) (bindin return res } default: - return nil, errors.New("context to binding.ExternalFloatList: context fn Length: expected function") + return nil, errors.New("context to binding.ExternalFloatList: context fn Length: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["AddListener"] + ctxObj9, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.ExternalFloatList: expected context to have function AddListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalFloatList: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalFloatList: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalFloatList: context fn AddListener: expected function") + return nil, errors.New("context to binding.ExternalFloatList: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj10, ok := wordToObj["RemoveListener"] + ctxObj10, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.ExternalFloatList: expected context to have function RemoveListener") } switch fn := ctxObj10.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalFloatList: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalFloatList: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalFloatList: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.ExternalFloatList: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -9980,14 +9429,14 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin impl := &iface_binding_ExternalFloatTree{ self: v, } - ctxObj0, ok := wordToObj["Reload"] + ctxObj0, ok := wordToObj["reload"] if !ok { return nil, errors.New("context to binding.ExternalFloatTree: expected context to have function Reload") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalFloatTree: context fn Reload: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalFloatTree: context fn Reload: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Reload = func(ctx env.RyeCtx) error { actualFn := fn @@ -10001,8 +9450,9 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10010,8 +9460,9 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10020,25 +9471,25 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin return res } default: - return nil, errors.New("context to binding.ExternalFloatTree: context fn Reload: expected function") + return nil, errors.New("context to binding.ExternalFloatTree: context fn Reload: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Append"] + ctxObj1, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.ExternalFloatTree: expected context to have function Append") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 3 { - return nil, errors.New("context to binding.ExternalFloatTree: context fn Append: function has invalid number of arguments (expected 3)") + return nil, errors.New("context to binding.ExternalFloatTree: context fn Append: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 string, arg1 string, arg2 float64) error { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) - arg2Val = *env.NewDecimal(float64(arg2)) + impl.fn_Append = func(ctx env.RyeCtx, farg0 string, farg1 string, farg2 float64) error { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) + farg2Val = *env.NewDecimal(float64(farg2)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val, farg2Val) var res error switch v := ps.Res.(type) { case env.String: @@ -10047,8 +9498,9 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10056,8 +9508,9 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10066,16 +9519,16 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin return res } default: - return nil, errors.New("context to binding.ExternalFloatTree: context fn Append: expected function") + return nil, errors.New("context to binding.ExternalFloatTree: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Get"] + ctxObj2, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.ExternalFloatTree: expected context to have function Get") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalFloatTree: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalFloatTree: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) (map[string][]string, map[string]float64, error) { actualFn := fn @@ -10086,16 +9539,18 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin var res2 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } if len(res.Series.S) != 3 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected block with 3 return values", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected block with 3 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10104,8 +9559,9 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin switch v := res.Series.S[0].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10114,11 +9570,12 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin res0 = make(map[string][]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: map key: expected string", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10129,32 +9586,23 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: map value: block item: expected string", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"map value: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: map value: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10162,8 +9610,9 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10180,32 +9629,23 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: map value: block item: expected string", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"map value: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: map value: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10213,8 +9653,9 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10222,21 +9663,11 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin } res0[mapK] = mapV } - case env.Native: - var ok bool - res0, ok = v.Value.(map[string][]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected native of type map[string][]string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10244,8 +9675,9 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected native, block, dict or nil", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10254,8 +9686,9 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin switch v := res.Series.S[1].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10264,22 +9697,24 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin res1 = make(map[string]float64, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: map key: expected string", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } var mapV float64 - if v, ok := v.Series.S[i+1].(env.Decimal); ok { - mapV = float64(v.Value) + if vc, ok := v.Series.S[i+1].(env.Decimal); ok { + mapV = float64(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: map value: expected decimal", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"map value: "+"expected decimal, but got "+objectDebugString(ps.Idx, v.Series.S[i+1]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10292,11 +9727,12 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin for dictK, dictV := range v.Data { mapK := dictK var mapV float64 - if v, ok := dictV.(env.Decimal); ok { - mapV = float64(v.Value) + if vc, ok := dictV.(env.Decimal); ok { + mapV = float64(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: map value: expected decimal", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"map value: "+"expected decimal, but got "+objectDebugString(ps.Idx, dictV), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10304,21 +9740,11 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin } res1[mapK] = mapV } - case env.Native: - var ok bool - res1, ok = v.Value.(map[string]float64) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected native of type map[string]float64", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10326,8 +9752,9 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected native, block, dict or nil", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10340,8 +9767,9 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin res2 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10349,8 +9777,9 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin } res2 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10359,47 +9788,50 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin return res0, res1, res2 } default: - return nil, errors.New("context to binding.ExternalFloatTree: context fn Get: expected function") + return nil, errors.New("context to binding.ExternalFloatTree: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["GetValue"] + ctxObj3, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.ExternalFloatTree: expected context to have function GetValue") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalFloatTree: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalFloatTree: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 string) (float64, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 string) (float64, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 float64 var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Decimal); ok { - res0 = float64(v.Value) + if vc, ok := res.Series.S[0].(env.Decimal); ok { + res0 = float64(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected decimal", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected decimal, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10412,8 +9844,9 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10421,8 +9854,9 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10431,25 +9865,25 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin return res0, res1 } default: - return nil, errors.New("context to binding.ExternalFloatTree: context fn GetValue: expected function") + return nil, errors.New("context to binding.ExternalFloatTree: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Prepend"] + ctxObj4, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.ExternalFloatTree: expected context to have function Prepend") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 3 { - return nil, errors.New("context to binding.ExternalFloatTree: context fn Prepend: function has invalid number of arguments (expected 3)") + return nil, errors.New("context to binding.ExternalFloatTree: context fn Prepend: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 string, arg1 string, arg2 float64) error { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) - arg2Val = *env.NewDecimal(float64(arg2)) + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 string, farg1 string, farg2 float64) error { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) + farg2Val = *env.NewDecimal(float64(farg2)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val, farg2Val) var res error switch v := ps.Res.(type) { case env.String: @@ -10458,8 +9892,9 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10467,8 +9902,9 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10477,22 +9913,22 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin return res } default: - return nil, errors.New("context to binding.ExternalFloatTree: context fn Prepend: expected function") + return nil, errors.New("context to binding.ExternalFloatTree: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["Set"] + ctxObj5, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.ExternalFloatTree: expected context to have function Set") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.ExternalFloatTree: context fn Set: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.ExternalFloatTree: context fn Set: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 map[string][]string, arg1 map[string]float64) error { - var arg0Val, arg1Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 map[string][]string, farg1 map[string]float64) error { + var farg0Val, farg1Val env.Object { - data := make(map[string]any, len(arg0)) - for mKey, mVal := range arg0 { + data := make(map[string]any, len(farg0)) + for mKey, mVal := range farg0 { var dVal env.Object { items := make([]env.Object, len(mVal)) @@ -10503,20 +9939,20 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin } data[mKey] = dVal } - arg0Val = *env.NewDict(data) + farg0Val = *env.NewDict(data) } { - data := make(map[string]any, len(arg1)) - for mKey, mVal := range arg1 { + data := make(map[string]any, len(farg1)) + for mKey, mVal := range farg1 { var dVal env.Object dVal = *env.NewDecimal(float64(mVal)) data[mKey] = dVal } - arg1Val = *env.NewDict(data) + farg1Val = *env.NewDict(data) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -10525,8 +9961,9 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10534,8 +9971,9 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10544,24 +9982,24 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin return res } default: - return nil, errors.New("context to binding.ExternalFloatTree: context fn Set: expected function") + return nil, errors.New("context to binding.ExternalFloatTree: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["SetValue"] + ctxObj6, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.ExternalFloatTree: expected context to have function SetValue") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.ExternalFloatTree: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.ExternalFloatTree: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 string, arg1 float64) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewDecimal(float64(arg1)) + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 string, farg1 float64) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewDecimal(float64(farg1)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -10570,8 +10008,9 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10579,8 +10018,9 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10589,37 +10029,39 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin return res } default: - return nil, errors.New("context to binding.ExternalFloatTree: context fn SetValue: expected function") + return nil, errors.New("context to binding.ExternalFloatTree: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["GetItem"] + ctxObj7, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.ExternalFloatTree: expected context to have function GetItem") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalFloatTree: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalFloatTree: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 string) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 string) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10630,19 +10072,21 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: "+err.Error()+"", + "context to binding.ExternalFloatTree: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10650,8 +10094,9 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10659,8 +10104,9 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected native", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10673,8 +10119,9 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10682,8 +10129,9 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10692,54 +10140,45 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin return res0, res1 } default: - return nil, errors.New("context to binding.ExternalFloatTree: context fn GetItem: expected function") + return nil, errors.New("context to binding.ExternalFloatTree: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["ChildIDs"] + ctxObj8, ok := wordToObj["child-i-ds"] if !ok { return nil, errors.New("context to binding.ExternalFloatTree: expected context to have function ChildIDs") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalFloatTree: context fn ChildIDs: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalFloatTree: context fn ChildIDs: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_ChildIDs = func(ctx env.RyeCtx, arg0 string) []string { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_ChildIDs = func(ctx env.RyeCtx, farg0 string) []string { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res []string switch v := ps.Res.(type) { case env.Block: res = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - res[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + res[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: block item: expected string", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10747,8 +10186,9 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalFloatTree: arg 0: callback result: expected block, native or nil", + "context to binding.ExternalFloatTree: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10757,79 +10197,45 @@ func ctxTo_binding_ExternalFloatTree(ps *env.ProgramState, v env.RyeCtx) (bindin return res } default: - return nil, errors.New("context to binding.ExternalFloatTree: context fn ChildIDs: expected function") + return nil, errors.New("context to binding.ExternalFloatTree: context fn ChildIDs: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["AddListener"] + ctxObj9, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.ExternalFloatTree: expected context to have function AddListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalFloatTree: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalFloatTree: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalFloatTree: context fn AddListener: expected function") + return nil, errors.New("context to binding.ExternalFloatTree: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj10, ok := wordToObj["RemoveListener"] + ctxObj10, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.ExternalFloatTree: expected context to have function RemoveListener") } switch fn := ctxObj10.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalFloatTree: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalFloatTree: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalFloatTree: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.ExternalFloatTree: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -10877,14 +10283,14 @@ func ctxTo_binding_ExternalInt(ps *env.ProgramState, v env.RyeCtx) (binding.Exte impl := &iface_binding_ExternalInt{ self: v, } - ctxObj0, ok := wordToObj["Reload"] + ctxObj0, ok := wordToObj["reload"] if !ok { return nil, errors.New("context to binding.ExternalInt: expected context to have function Reload") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalInt: context fn Reload: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalInt: context fn Reload: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Reload = func(ctx env.RyeCtx) error { actualFn := fn @@ -10898,8 +10304,9 @@ func ctxTo_binding_ExternalInt(ps *env.ProgramState, v env.RyeCtx) (binding.Exte res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalInt: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalInt: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10907,8 +10314,9 @@ func ctxTo_binding_ExternalInt(ps *env.ProgramState, v env.RyeCtx) (binding.Exte } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalInt: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalInt: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10917,16 +10325,16 @@ func ctxTo_binding_ExternalInt(ps *env.ProgramState, v env.RyeCtx) (binding.Exte return res } default: - return nil, errors.New("context to binding.ExternalInt: context fn Reload: expected function") + return nil, errors.New("context to binding.ExternalInt: context fn Reload: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Get"] + ctxObj1, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.ExternalInt: expected context to have function Get") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalInt: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalInt: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) (int, error) { actualFn := fn @@ -10936,26 +10344,29 @@ func ctxTo_binding_ExternalInt(ps *env.ProgramState, v env.RyeCtx) (binding.Exte var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalInt: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalInt: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalInt: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalInt: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = int(v.Value) + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalInt: arg 0: callback result: expected integer", + "context to binding.ExternalInt: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10968,8 +10379,9 @@ func ctxTo_binding_ExternalInt(ps *env.ProgramState, v env.RyeCtx) (binding.Exte res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalInt: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalInt: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10977,8 +10389,9 @@ func ctxTo_binding_ExternalInt(ps *env.ProgramState, v env.RyeCtx) (binding.Exte } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalInt: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalInt: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -10987,23 +10400,23 @@ func ctxTo_binding_ExternalInt(ps *env.ProgramState, v env.RyeCtx) (binding.Exte return res0, res1 } default: - return nil, errors.New("context to binding.ExternalInt: context fn Get: expected function") + return nil, errors.New("context to binding.ExternalInt: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Set"] + ctxObj2, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.ExternalInt: expected context to have function Set") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalInt: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalInt: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 int) error { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_Set = func(ctx env.RyeCtx, farg0 int) error { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -11012,8 +10425,9 @@ func ctxTo_binding_ExternalInt(ps *env.ProgramState, v env.RyeCtx) (binding.Exte res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalInt: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalInt: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11021,8 +10435,9 @@ func ctxTo_binding_ExternalInt(ps *env.ProgramState, v env.RyeCtx) (binding.Exte } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalInt: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalInt: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11031,79 +10446,45 @@ func ctxTo_binding_ExternalInt(ps *env.ProgramState, v env.RyeCtx) (binding.Exte return res } default: - return nil, errors.New("context to binding.ExternalInt: context fn Set: expected function") + return nil, errors.New("context to binding.ExternalInt: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["AddListener"] + ctxObj3, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.ExternalInt: expected context to have function AddListener") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalInt: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalInt: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalInt: context fn AddListener: expected function") + return nil, errors.New("context to binding.ExternalInt: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["RemoveListener"] + ctxObj4, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.ExternalInt: expected context to have function RemoveListener") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalInt: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalInt: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalInt: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.ExternalInt: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -11175,14 +10556,14 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. impl := &iface_binding_ExternalIntList{ self: v, } - ctxObj0, ok := wordToObj["Reload"] + ctxObj0, ok := wordToObj["reload"] if !ok { return nil, errors.New("context to binding.ExternalIntList: expected context to have function Reload") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalIntList: context fn Reload: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalIntList: context fn Reload: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Reload = func(ctx env.RyeCtx) error { actualFn := fn @@ -11196,8 +10577,9 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalIntList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11205,8 +10587,9 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalIntList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11215,23 +10598,23 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. return res } default: - return nil, errors.New("context to binding.ExternalIntList: context fn Reload: expected function") + return nil, errors.New("context to binding.ExternalIntList: context fn Reload: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Append"] + ctxObj1, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.ExternalIntList: expected context to have function Append") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalIntList: context fn Append: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalIntList: context fn Append: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 int) error { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_Append = func(ctx env.RyeCtx, farg0 int) error { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -11240,8 +10623,9 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalIntList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11249,8 +10633,9 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalIntList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11259,16 +10644,16 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. return res } default: - return nil, errors.New("context to binding.ExternalIntList: context fn Append: expected function") + return nil, errors.New("context to binding.ExternalIntList: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Get"] + ctxObj2, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.ExternalIntList: expected context to have function Get") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalIntList: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalIntList: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) ([]int, error) { actualFn := fn @@ -11278,16 +10663,18 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalIntList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalIntList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11297,32 +10684,23 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. case env.Block: res0 = make([]int, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.Integer); ok { - res0[i] = int(v.Value) + if vc, ok := it.(env.Integer); ok { + res0[i] = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: block item: expected integer", + "context to binding.ExternalIntList: arg 0: callback result: "+"block item: "+"expected integer, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } } - case env.Native: - var ok bool - res0, ok = v.Value.([]int) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected native of type []int", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalIntList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11330,8 +10708,9 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected block, native or nil", + "context to binding.ExternalIntList: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11344,8 +10723,9 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalIntList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11353,8 +10733,9 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalIntList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11363,47 +10744,50 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. return res0, res1 } default: - return nil, errors.New("context to binding.ExternalIntList: context fn Get: expected function") + return nil, errors.New("context to binding.ExternalIntList: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["GetValue"] + ctxObj3, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.ExternalIntList: expected context to have function GetValue") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalIntList: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalIntList: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 int) (int, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 int) (int, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 int var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalIntList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalIntList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = int(v.Value) + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected integer", + "context to binding.ExternalIntList: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11416,8 +10800,9 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalIntList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11425,8 +10810,9 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalIntList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11435,23 +10821,23 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. return res0, res1 } default: - return nil, errors.New("context to binding.ExternalIntList: context fn GetValue: expected function") + return nil, errors.New("context to binding.ExternalIntList: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Prepend"] + ctxObj4, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.ExternalIntList: expected context to have function Prepend") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalIntList: context fn Prepend: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalIntList: context fn Prepend: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 int) error { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 int) error { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -11460,8 +10846,9 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalIntList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11469,8 +10856,9 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalIntList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11479,29 +10867,29 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. return res } default: - return nil, errors.New("context to binding.ExternalIntList: context fn Prepend: expected function") + return nil, errors.New("context to binding.ExternalIntList: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["Set"] + ctxObj5, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.ExternalIntList: expected context to have function Set") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalIntList: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalIntList: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 []int) error { - var arg0Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 []int) error { + var farg0Val env.Object { - items := make([]env.Object, len(arg0)) - for i, it := range arg0 { + items := make([]env.Object, len(farg0)) + for i, it := range farg0 { items[i] = *env.NewInteger(int64(it)) } - arg0Val = *env.NewBlock(*env.NewTSeries(items)) + farg0Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -11510,8 +10898,9 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalIntList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11519,8 +10908,9 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalIntList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11529,24 +10919,24 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. return res } default: - return nil, errors.New("context to binding.ExternalIntList: context fn Set: expected function") + return nil, errors.New("context to binding.ExternalIntList: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["SetValue"] + ctxObj6, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.ExternalIntList: expected context to have function SetValue") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.ExternalIntList: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.ExternalIntList: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 int, arg1 int) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) - arg1Val = *env.NewInteger(int64(arg1)) + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 int, farg1 int) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) + farg1Val = *env.NewInteger(int64(farg1)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -11555,8 +10945,9 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalIntList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11564,8 +10955,9 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalIntList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11574,37 +10966,39 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. return res } default: - return nil, errors.New("context to binding.ExternalIntList: context fn SetValue: expected function") + return nil, errors.New("context to binding.ExternalIntList: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["GetItem"] + ctxObj7, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.ExternalIntList: expected context to have function GetItem") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalIntList: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalIntList: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 int) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 int) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalIntList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalIntList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11615,19 +11009,21 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: "+err.Error()+"", + "context to binding.ExternalIntList: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.ExternalIntList: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11635,8 +11031,9 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalIntList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11644,8 +11041,9 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected native", + "context to binding.ExternalIntList: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11658,8 +11056,9 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalIntList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11667,8 +11066,9 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalIntList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11677,27 +11077,28 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. return res0, res1 } default: - return nil, errors.New("context to binding.ExternalIntList: context fn GetItem: expected function") + return nil, errors.New("context to binding.ExternalIntList: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["Length"] + ctxObj8, ok := wordToObj["length"] if !ok { return nil, errors.New("context to binding.ExternalIntList: expected context to have function Length") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalIntList: context fn Length: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalIntList: context fn Length: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Length = func(ctx env.RyeCtx) int { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res int - if v, ok := ps.Res.(env.Integer); ok { - res = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + res = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntList: arg 0: callback result: expected integer", + "context to binding.ExternalIntList: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11706,79 +11107,45 @@ func ctxTo_binding_ExternalIntList(ps *env.ProgramState, v env.RyeCtx) (binding. return res } default: - return nil, errors.New("context to binding.ExternalIntList: context fn Length: expected function") + return nil, errors.New("context to binding.ExternalIntList: context fn Length: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["AddListener"] + ctxObj9, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.ExternalIntList: expected context to have function AddListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalIntList: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalIntList: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalIntList: context fn AddListener: expected function") + return nil, errors.New("context to binding.ExternalIntList: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj10, ok := wordToObj["RemoveListener"] + ctxObj10, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.ExternalIntList: expected context to have function RemoveListener") } switch fn := ctxObj10.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalIntList: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalIntList: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalIntList: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.ExternalIntList: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -11850,14 +11217,14 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. impl := &iface_binding_ExternalIntTree{ self: v, } - ctxObj0, ok := wordToObj["Reload"] + ctxObj0, ok := wordToObj["reload"] if !ok { return nil, errors.New("context to binding.ExternalIntTree: expected context to have function Reload") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalIntTree: context fn Reload: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalIntTree: context fn Reload: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Reload = func(ctx env.RyeCtx) error { actualFn := fn @@ -11871,8 +11238,9 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11880,8 +11248,9 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11890,25 +11259,25 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. return res } default: - return nil, errors.New("context to binding.ExternalIntTree: context fn Reload: expected function") + return nil, errors.New("context to binding.ExternalIntTree: context fn Reload: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Append"] + ctxObj1, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.ExternalIntTree: expected context to have function Append") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 3 { - return nil, errors.New("context to binding.ExternalIntTree: context fn Append: function has invalid number of arguments (expected 3)") + return nil, errors.New("context to binding.ExternalIntTree: context fn Append: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 string, arg1 string, arg2 int) error { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) - arg2Val = *env.NewInteger(int64(arg2)) + impl.fn_Append = func(ctx env.RyeCtx, farg0 string, farg1 string, farg2 int) error { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) + farg2Val = *env.NewInteger(int64(farg2)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val, farg2Val) var res error switch v := ps.Res.(type) { case env.String: @@ -11917,8 +11286,9 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11926,8 +11296,9 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11936,16 +11307,16 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. return res } default: - return nil, errors.New("context to binding.ExternalIntTree: context fn Append: expected function") + return nil, errors.New("context to binding.ExternalIntTree: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Get"] + ctxObj2, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.ExternalIntTree: expected context to have function Get") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalIntTree: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalIntTree: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) (map[string][]string, map[string]int, error) { actualFn := fn @@ -11956,16 +11327,18 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. var res2 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } if len(res.Series.S) != 3 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected block with 3 return values", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected block with 3 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11974,8 +11347,9 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. switch v := res.Series.S[0].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11984,11 +11358,12 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. res0 = make(map[string][]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: map key: expected string", + "context to binding.ExternalIntTree: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -11999,32 +11374,23 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: map value: block item: expected string", + "context to binding.ExternalIntTree: arg 0: callback result: "+"map value: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: map value: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.ExternalIntTree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12032,8 +11398,9 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.ExternalIntTree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12050,32 +11417,23 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: map value: block item: expected string", + "context to binding.ExternalIntTree: arg 0: callback result: "+"map value: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: map value: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.ExternalIntTree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12083,8 +11441,9 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.ExternalIntTree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12092,21 +11451,11 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. } res0[mapK] = mapV } - case env.Native: - var ok bool - res0, ok = v.Value.(map[string][]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected native of type map[string][]string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12114,8 +11463,9 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected native, block, dict or nil", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12124,8 +11474,9 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. switch v := res.Series.S[1].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12134,22 +11485,24 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. res1 = make(map[string]int, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: map key: expected string", + "context to binding.ExternalIntTree: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } var mapV int - if v, ok := v.Series.S[i+1].(env.Integer); ok { - mapV = int(v.Value) + if vc, ok := v.Series.S[i+1].(env.Integer); ok { + mapV = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: map value: expected integer", + "context to binding.ExternalIntTree: arg 0: callback result: "+"map value: "+"expected integer, but got "+objectDebugString(ps.Idx, v.Series.S[i+1]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12162,11 +11515,12 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. for dictK, dictV := range v.Data { mapK := dictK var mapV int - if v, ok := dictV.(env.Integer); ok { - mapV = int(v.Value) + if vc, ok := dictV.(env.Integer); ok { + mapV = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: map value: expected integer", + "context to binding.ExternalIntTree: arg 0: callback result: "+"map value: "+"expected integer, but got "+objectDebugString(ps.Idx, dictV), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12174,21 +11528,11 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. } res1[mapK] = mapV } - case env.Native: - var ok bool - res1, ok = v.Value.(map[string]int) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected native of type map[string]int", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12196,8 +11540,9 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected native, block, dict or nil", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12210,8 +11555,9 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. res2 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12219,8 +11565,9 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. } res2 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12229,47 +11576,50 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. return res0, res1, res2 } default: - return nil, errors.New("context to binding.ExternalIntTree: context fn Get: expected function") + return nil, errors.New("context to binding.ExternalIntTree: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["GetValue"] + ctxObj3, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.ExternalIntTree: expected context to have function GetValue") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalIntTree: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalIntTree: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 string) (int, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 string) (int, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 int var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = int(v.Value) + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected integer", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12282,8 +11632,9 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12291,8 +11642,9 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12301,25 +11653,25 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. return res0, res1 } default: - return nil, errors.New("context to binding.ExternalIntTree: context fn GetValue: expected function") + return nil, errors.New("context to binding.ExternalIntTree: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Prepend"] + ctxObj4, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.ExternalIntTree: expected context to have function Prepend") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 3 { - return nil, errors.New("context to binding.ExternalIntTree: context fn Prepend: function has invalid number of arguments (expected 3)") + return nil, errors.New("context to binding.ExternalIntTree: context fn Prepend: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 string, arg1 string, arg2 int) error { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) - arg2Val = *env.NewInteger(int64(arg2)) + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 string, farg1 string, farg2 int) error { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) + farg2Val = *env.NewInteger(int64(farg2)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val, farg2Val) var res error switch v := ps.Res.(type) { case env.String: @@ -12328,8 +11680,9 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12337,8 +11690,9 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12347,22 +11701,22 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. return res } default: - return nil, errors.New("context to binding.ExternalIntTree: context fn Prepend: expected function") + return nil, errors.New("context to binding.ExternalIntTree: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["Set"] + ctxObj5, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.ExternalIntTree: expected context to have function Set") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.ExternalIntTree: context fn Set: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.ExternalIntTree: context fn Set: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 map[string][]string, arg1 map[string]int) error { - var arg0Val, arg1Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 map[string][]string, farg1 map[string]int) error { + var farg0Val, farg1Val env.Object { - data := make(map[string]any, len(arg0)) - for mKey, mVal := range arg0 { + data := make(map[string]any, len(farg0)) + for mKey, mVal := range farg0 { var dVal env.Object { items := make([]env.Object, len(mVal)) @@ -12373,20 +11727,20 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. } data[mKey] = dVal } - arg0Val = *env.NewDict(data) + farg0Val = *env.NewDict(data) } { - data := make(map[string]any, len(arg1)) - for mKey, mVal := range arg1 { + data := make(map[string]any, len(farg1)) + for mKey, mVal := range farg1 { var dVal env.Object dVal = *env.NewInteger(int64(mVal)) data[mKey] = dVal } - arg1Val = *env.NewDict(data) + farg1Val = *env.NewDict(data) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -12395,8 +11749,9 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12404,8 +11759,9 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12414,24 +11770,24 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. return res } default: - return nil, errors.New("context to binding.ExternalIntTree: context fn Set: expected function") + return nil, errors.New("context to binding.ExternalIntTree: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["SetValue"] + ctxObj6, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.ExternalIntTree: expected context to have function SetValue") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.ExternalIntTree: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.ExternalIntTree: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 string, arg1 int) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewInteger(int64(arg1)) + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 string, farg1 int) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewInteger(int64(farg1)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -12440,8 +11796,9 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12449,8 +11806,9 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12459,37 +11817,39 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. return res } default: - return nil, errors.New("context to binding.ExternalIntTree: context fn SetValue: expected function") + return nil, errors.New("context to binding.ExternalIntTree: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["GetItem"] + ctxObj7, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.ExternalIntTree: expected context to have function GetItem") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalIntTree: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalIntTree: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 string) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 string) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12500,19 +11860,21 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: "+err.Error()+"", + "context to binding.ExternalIntTree: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12520,8 +11882,9 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12529,8 +11892,9 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected native", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12543,8 +11907,9 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12552,8 +11917,9 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12562,54 +11928,45 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. return res0, res1 } default: - return nil, errors.New("context to binding.ExternalIntTree: context fn GetItem: expected function") + return nil, errors.New("context to binding.ExternalIntTree: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["ChildIDs"] + ctxObj8, ok := wordToObj["child-i-ds"] if !ok { return nil, errors.New("context to binding.ExternalIntTree: expected context to have function ChildIDs") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalIntTree: context fn ChildIDs: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalIntTree: context fn ChildIDs: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_ChildIDs = func(ctx env.RyeCtx, arg0 string) []string { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_ChildIDs = func(ctx env.RyeCtx, farg0 string) []string { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res []string switch v := ps.Res.(type) { case env.Block: res = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - res[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + res[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: block item: expected string", + "context to binding.ExternalIntTree: arg 0: callback result: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12617,8 +11974,9 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalIntTree: arg 0: callback result: expected block, native or nil", + "context to binding.ExternalIntTree: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12627,79 +11985,45 @@ func ctxTo_binding_ExternalIntTree(ps *env.ProgramState, v env.RyeCtx) (binding. return res } default: - return nil, errors.New("context to binding.ExternalIntTree: context fn ChildIDs: expected function") + return nil, errors.New("context to binding.ExternalIntTree: context fn ChildIDs: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["AddListener"] + ctxObj9, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.ExternalIntTree: expected context to have function AddListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalIntTree: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalIntTree: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalIntTree: context fn AddListener: expected function") + return nil, errors.New("context to binding.ExternalIntTree: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj10, ok := wordToObj["RemoveListener"] + ctxObj10, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.ExternalIntTree: expected context to have function RemoveListener") } switch fn := ctxObj10.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalIntTree: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalIntTree: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalIntTree: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.ExternalIntTree: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -12747,14 +12071,14 @@ func ctxTo_binding_ExternalRune(ps *env.ProgramState, v env.RyeCtx) (binding.Ext impl := &iface_binding_ExternalRune{ self: v, } - ctxObj0, ok := wordToObj["Reload"] + ctxObj0, ok := wordToObj["reload"] if !ok { return nil, errors.New("context to binding.ExternalRune: expected context to have function Reload") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalRune: context fn Reload: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalRune: context fn Reload: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Reload = func(ctx env.RyeCtx) error { actualFn := fn @@ -12768,8 +12092,9 @@ func ctxTo_binding_ExternalRune(ps *env.ProgramState, v env.RyeCtx) (binding.Ext res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRune: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalRune: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12777,8 +12102,9 @@ func ctxTo_binding_ExternalRune(ps *env.ProgramState, v env.RyeCtx) (binding.Ext } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRune: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalRune: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12787,16 +12113,16 @@ func ctxTo_binding_ExternalRune(ps *env.ProgramState, v env.RyeCtx) (binding.Ext return res } default: - return nil, errors.New("context to binding.ExternalRune: context fn Reload: expected function") + return nil, errors.New("context to binding.ExternalRune: context fn Reload: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Get"] + ctxObj1, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.ExternalRune: expected context to have function Get") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalRune: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalRune: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) (rune, error) { actualFn := fn @@ -12806,16 +12132,18 @@ func ctxTo_binding_ExternalRune(ps *env.ProgramState, v env.RyeCtx) (binding.Ext var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRune: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalRune: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRune: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalRune: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12823,19 +12151,21 @@ func ctxTo_binding_ExternalRune(ps *env.ProgramState, v env.RyeCtx) (binding.Ext } switch v := res.Series.S[0].(type) { case env.Native: - var ok bool - res0, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRune: arg 0: callback result: expected native of type rune", + "context to binding.ExternalRune: arg 0: callback result: "+"expected native of type rune, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRune: arg 0: callback result: expected native", + "context to binding.ExternalRune: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12848,8 +12178,9 @@ func ctxTo_binding_ExternalRune(ps *env.ProgramState, v env.RyeCtx) (binding.Ext res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRune: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalRune: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12857,8 +12188,9 @@ func ctxTo_binding_ExternalRune(ps *env.ProgramState, v env.RyeCtx) (binding.Ext } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRune: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalRune: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12867,23 +12199,23 @@ func ctxTo_binding_ExternalRune(ps *env.ProgramState, v env.RyeCtx) (binding.Ext return res0, res1 } default: - return nil, errors.New("context to binding.ExternalRune: context fn Get: expected function") + return nil, errors.New("context to binding.ExternalRune: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Set"] + ctxObj2, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.ExternalRune: expected context to have function Set") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalRune: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalRune: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 rune) error { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(rune)") + impl.fn_Set = func(ctx env.RyeCtx, farg0 rune) error { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(rune)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -12892,8 +12224,9 @@ func ctxTo_binding_ExternalRune(ps *env.ProgramState, v env.RyeCtx) (binding.Ext res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRune: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalRune: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12901,8 +12234,9 @@ func ctxTo_binding_ExternalRune(ps *env.ProgramState, v env.RyeCtx) (binding.Ext } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRune: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalRune: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -12911,79 +12245,45 @@ func ctxTo_binding_ExternalRune(ps *env.ProgramState, v env.RyeCtx) (binding.Ext return res } default: - return nil, errors.New("context to binding.ExternalRune: context fn Set: expected function") + return nil, errors.New("context to binding.ExternalRune: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["AddListener"] + ctxObj3, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.ExternalRune: expected context to have function AddListener") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalRune: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalRune: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalRune: context fn AddListener: expected function") + return nil, errors.New("context to binding.ExternalRune: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["RemoveListener"] + ctxObj4, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.ExternalRune: expected context to have function RemoveListener") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalRune: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalRune: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalRune: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.ExternalRune: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -13055,14 +12355,14 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding impl := &iface_binding_ExternalRuneList{ self: v, } - ctxObj0, ok := wordToObj["Reload"] + ctxObj0, ok := wordToObj["reload"] if !ok { return nil, errors.New("context to binding.ExternalRuneList: expected context to have function Reload") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalRuneList: context fn Reload: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalRuneList: context fn Reload: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Reload = func(ctx env.RyeCtx) error { actualFn := fn @@ -13076,8 +12376,9 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13085,8 +12386,9 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13095,23 +12397,23 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding return res } default: - return nil, errors.New("context to binding.ExternalRuneList: context fn Reload: expected function") + return nil, errors.New("context to binding.ExternalRuneList: context fn Reload: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Append"] + ctxObj1, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.ExternalRuneList: expected context to have function Append") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalRuneList: context fn Append: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalRuneList: context fn Append: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 rune) error { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(rune)") + impl.fn_Append = func(ctx env.RyeCtx, farg0 rune) error { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(rune)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -13120,8 +12422,9 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13129,8 +12432,9 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13139,16 +12443,16 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding return res } default: - return nil, errors.New("context to binding.ExternalRuneList: context fn Append: expected function") + return nil, errors.New("context to binding.ExternalRuneList: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Get"] + ctxObj2, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.ExternalRuneList: expected context to have function Get") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalRuneList: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalRuneList: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) ([]rune, error) { actualFn := fn @@ -13158,16 +12462,18 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13179,40 +12485,32 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - res0[i], ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + res0[i] = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: block item: expected native of type rune", + "context to binding.ExternalRuneList: arg 0: callback result: "+"block item: "+"expected native of type rune, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: block item: expected native", + "context to binding.ExternalRuneList: arg 0: callback result: "+"block item: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } } - case env.Native: - var ok bool - res0, ok = v.Value.([]rune) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected native of type []rune", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13220,8 +12518,9 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected block, native or nil", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13234,8 +12533,9 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13243,8 +12543,9 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13253,37 +12554,39 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding return res0, res1 } default: - return nil, errors.New("context to binding.ExternalRuneList: context fn Get: expected function") + return nil, errors.New("context to binding.ExternalRuneList: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["GetValue"] + ctxObj3, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.ExternalRuneList: expected context to have function GetValue") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalRuneList: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalRuneList: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 int) (rune, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 int) (rune, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 rune var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13291,19 +12594,21 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding } switch v := res.Series.S[0].(type) { case env.Native: - var ok bool - res0, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected native of type rune", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected native of type rune, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected native", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13316,8 +12621,9 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13325,8 +12631,9 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13335,23 +12642,23 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding return res0, res1 } default: - return nil, errors.New("context to binding.ExternalRuneList: context fn GetValue: expected function") + return nil, errors.New("context to binding.ExternalRuneList: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Prepend"] + ctxObj4, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.ExternalRuneList: expected context to have function Prepend") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalRuneList: context fn Prepend: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalRuneList: context fn Prepend: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 rune) error { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(rune)") + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 rune) error { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(rune)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -13360,8 +12667,9 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13369,8 +12677,9 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13379,29 +12688,29 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding return res } default: - return nil, errors.New("context to binding.ExternalRuneList: context fn Prepend: expected function") + return nil, errors.New("context to binding.ExternalRuneList: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["Set"] + ctxObj5, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.ExternalRuneList: expected context to have function Set") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalRuneList: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalRuneList: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 []rune) error { - var arg0Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 []rune) error { + var farg0Val env.Object { - items := make([]env.Object, len(arg0)) - for i, it := range arg0 { + items := make([]env.Object, len(farg0)) + for i, it := range farg0 { items[i] = *env.NewNative(ps.Idx, it, "Go(rune)") } - arg0Val = *env.NewBlock(*env.NewTSeries(items)) + farg0Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -13410,8 +12719,9 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13419,8 +12729,9 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13429,24 +12740,24 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding return res } default: - return nil, errors.New("context to binding.ExternalRuneList: context fn Set: expected function") + return nil, errors.New("context to binding.ExternalRuneList: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["SetValue"] + ctxObj6, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.ExternalRuneList: expected context to have function SetValue") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.ExternalRuneList: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.ExternalRuneList: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 int, arg1 rune) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) - arg1Val = *env.NewNative(ps.Idx, arg1, "Go(rune)") + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 int, farg1 rune) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) + farg1Val = *env.NewNative(ps.Idx, farg1, "Go(rune)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -13455,8 +12766,9 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13464,8 +12776,9 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13474,37 +12787,39 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding return res } default: - return nil, errors.New("context to binding.ExternalRuneList: context fn SetValue: expected function") + return nil, errors.New("context to binding.ExternalRuneList: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["GetItem"] + ctxObj7, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.ExternalRuneList: expected context to have function GetItem") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalRuneList: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalRuneList: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 int) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 int) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13515,19 +12830,21 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: "+err.Error()+"", + "context to binding.ExternalRuneList: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13535,8 +12852,9 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13544,8 +12862,9 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected native", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13558,8 +12877,9 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13567,8 +12887,9 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13577,27 +12898,28 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding return res0, res1 } default: - return nil, errors.New("context to binding.ExternalRuneList: context fn GetItem: expected function") + return nil, errors.New("context to binding.ExternalRuneList: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["Length"] + ctxObj8, ok := wordToObj["length"] if !ok { return nil, errors.New("context to binding.ExternalRuneList: expected context to have function Length") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalRuneList: context fn Length: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalRuneList: context fn Length: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Length = func(ctx env.RyeCtx) int { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res int - if v, ok := ps.Res.(env.Integer); ok { - res = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + res = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneList: arg 0: callback result: expected integer", + "context to binding.ExternalRuneList: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13606,79 +12928,45 @@ func ctxTo_binding_ExternalRuneList(ps *env.ProgramState, v env.RyeCtx) (binding return res } default: - return nil, errors.New("context to binding.ExternalRuneList: context fn Length: expected function") + return nil, errors.New("context to binding.ExternalRuneList: context fn Length: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["AddListener"] + ctxObj9, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.ExternalRuneList: expected context to have function AddListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalRuneList: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalRuneList: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalRuneList: context fn AddListener: expected function") + return nil, errors.New("context to binding.ExternalRuneList: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj10, ok := wordToObj["RemoveListener"] + ctxObj10, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.ExternalRuneList: expected context to have function RemoveListener") } switch fn := ctxObj10.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalRuneList: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalRuneList: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalRuneList: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.ExternalRuneList: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -13750,14 +13038,14 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding impl := &iface_binding_ExternalRuneTree{ self: v, } - ctxObj0, ok := wordToObj["Reload"] + ctxObj0, ok := wordToObj["reload"] if !ok { return nil, errors.New("context to binding.ExternalRuneTree: expected context to have function Reload") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalRuneTree: context fn Reload: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalRuneTree: context fn Reload: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Reload = func(ctx env.RyeCtx) error { actualFn := fn @@ -13771,8 +13059,9 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13780,8 +13069,9 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13790,25 +13080,25 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding return res } default: - return nil, errors.New("context to binding.ExternalRuneTree: context fn Reload: expected function") + return nil, errors.New("context to binding.ExternalRuneTree: context fn Reload: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Append"] + ctxObj1, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.ExternalRuneTree: expected context to have function Append") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 3 { - return nil, errors.New("context to binding.ExternalRuneTree: context fn Append: function has invalid number of arguments (expected 3)") + return nil, errors.New("context to binding.ExternalRuneTree: context fn Append: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 string, arg1 string, arg2 rune) error { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) - arg2Val = *env.NewNative(ps.Idx, arg2, "Go(rune)") + impl.fn_Append = func(ctx env.RyeCtx, farg0 string, farg1 string, farg2 rune) error { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) + farg2Val = *env.NewNative(ps.Idx, farg2, "Go(rune)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val, farg2Val) var res error switch v := ps.Res.(type) { case env.String: @@ -13817,8 +13107,9 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13826,8 +13117,9 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13836,16 +13128,16 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding return res } default: - return nil, errors.New("context to binding.ExternalRuneTree: context fn Append: expected function") + return nil, errors.New("context to binding.ExternalRuneTree: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Get"] + ctxObj2, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.ExternalRuneTree: expected context to have function Get") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalRuneTree: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalRuneTree: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) (map[string][]string, map[string]rune, error) { actualFn := fn @@ -13856,16 +13148,18 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding var res2 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } if len(res.Series.S) != 3 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected block with 3 return values", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected block with 3 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13874,8 +13168,9 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding switch v := res.Series.S[0].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13884,11 +13179,12 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding res0 = make(map[string][]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: map key: expected string", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13899,32 +13195,23 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: map value: block item: expected string", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"map value: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: map value: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13932,8 +13219,9 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13950,32 +13238,23 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: map value: block item: expected string", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"map value: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: map value: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13983,8 +13262,9 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -13992,21 +13272,11 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding } res0[mapK] = mapV } - case env.Native: - var ok bool - res0, ok = v.Value.(map[string][]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected native of type map[string][]string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14014,8 +13284,9 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected native, block, dict or nil", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14024,8 +13295,9 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding switch v := res.Series.S[1].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14034,11 +13306,12 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding res1 = make(map[string]rune, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: map key: expected string", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14047,19 +13320,21 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding var mapV rune switch v := v.Series.S[i+1].(type) { case env.Native: - var ok bool - mapV, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + mapV = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: map value: expected native of type rune", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"map value: "+"expected native of type rune, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: map value: expected native", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"map value: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14074,19 +13349,21 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding var mapV rune switch v := dictV.(type) { case env.Native: - var ok bool - mapV, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + mapV = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: map value: expected native of type rune", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"map value: "+"expected native of type rune, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: map value: expected native", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"map value: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14094,21 +13371,11 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding } res1[mapK] = mapV } - case env.Native: - var ok bool - res1, ok = v.Value.(map[string]rune) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected native of type map[string]rune", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14116,8 +13383,9 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected native, block, dict or nil", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14130,8 +13398,9 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding res2 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14139,8 +13408,9 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding } res2 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14149,37 +13419,39 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding return res0, res1, res2 } default: - return nil, errors.New("context to binding.ExternalRuneTree: context fn Get: expected function") + return nil, errors.New("context to binding.ExternalRuneTree: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["GetValue"] + ctxObj3, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.ExternalRuneTree: expected context to have function GetValue") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalRuneTree: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalRuneTree: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 string) (rune, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 string) (rune, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 rune var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14187,19 +13459,21 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding } switch v := res.Series.S[0].(type) { case env.Native: - var ok bool - res0, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected native of type rune", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected native of type rune, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected native", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14212,8 +13486,9 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14221,8 +13496,9 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14231,25 +13507,25 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding return res0, res1 } default: - return nil, errors.New("context to binding.ExternalRuneTree: context fn GetValue: expected function") + return nil, errors.New("context to binding.ExternalRuneTree: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Prepend"] + ctxObj4, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.ExternalRuneTree: expected context to have function Prepend") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 3 { - return nil, errors.New("context to binding.ExternalRuneTree: context fn Prepend: function has invalid number of arguments (expected 3)") + return nil, errors.New("context to binding.ExternalRuneTree: context fn Prepend: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 string, arg1 string, arg2 rune) error { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) - arg2Val = *env.NewNative(ps.Idx, arg2, "Go(rune)") + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 string, farg1 string, farg2 rune) error { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) + farg2Val = *env.NewNative(ps.Idx, farg2, "Go(rune)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val, farg2Val) var res error switch v := ps.Res.(type) { case env.String: @@ -14258,8 +13534,9 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14267,8 +13544,9 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14277,22 +13555,22 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding return res } default: - return nil, errors.New("context to binding.ExternalRuneTree: context fn Prepend: expected function") + return nil, errors.New("context to binding.ExternalRuneTree: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["Set"] + ctxObj5, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.ExternalRuneTree: expected context to have function Set") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.ExternalRuneTree: context fn Set: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.ExternalRuneTree: context fn Set: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 map[string][]string, arg1 map[string]rune) error { - var arg0Val, arg1Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 map[string][]string, farg1 map[string]rune) error { + var farg0Val, farg1Val env.Object { - data := make(map[string]any, len(arg0)) - for mKey, mVal := range arg0 { + data := make(map[string]any, len(farg0)) + for mKey, mVal := range farg0 { var dVal env.Object { items := make([]env.Object, len(mVal)) @@ -14303,20 +13581,20 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding } data[mKey] = dVal } - arg0Val = *env.NewDict(data) + farg0Val = *env.NewDict(data) } { - data := make(map[string]any, len(arg1)) - for mKey, mVal := range arg1 { + data := make(map[string]any, len(farg1)) + for mKey, mVal := range farg1 { var dVal env.Object dVal = *env.NewNative(ps.Idx, mVal, "Go(rune)") data[mKey] = dVal } - arg1Val = *env.NewDict(data) + farg1Val = *env.NewDict(data) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -14325,8 +13603,9 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14334,8 +13613,9 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14344,24 +13624,24 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding return res } default: - return nil, errors.New("context to binding.ExternalRuneTree: context fn Set: expected function") + return nil, errors.New("context to binding.ExternalRuneTree: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["SetValue"] + ctxObj6, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.ExternalRuneTree: expected context to have function SetValue") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.ExternalRuneTree: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.ExternalRuneTree: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 string, arg1 rune) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewNative(ps.Idx, arg1, "Go(rune)") + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 string, farg1 rune) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewNative(ps.Idx, farg1, "Go(rune)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -14370,8 +13650,9 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14379,8 +13660,9 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14389,37 +13671,39 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding return res } default: - return nil, errors.New("context to binding.ExternalRuneTree: context fn SetValue: expected function") + return nil, errors.New("context to binding.ExternalRuneTree: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["GetItem"] + ctxObj7, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.ExternalRuneTree: expected context to have function GetItem") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalRuneTree: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalRuneTree: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 string) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 string) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14430,19 +13714,21 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: "+err.Error()+"", + "context to binding.ExternalRuneTree: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14450,8 +13736,9 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14459,8 +13746,9 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected native", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14473,8 +13761,9 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14482,8 +13771,9 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14492,54 +13782,45 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding return res0, res1 } default: - return nil, errors.New("context to binding.ExternalRuneTree: context fn GetItem: expected function") + return nil, errors.New("context to binding.ExternalRuneTree: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["ChildIDs"] + ctxObj8, ok := wordToObj["child-i-ds"] if !ok { return nil, errors.New("context to binding.ExternalRuneTree: expected context to have function ChildIDs") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalRuneTree: context fn ChildIDs: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalRuneTree: context fn ChildIDs: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_ChildIDs = func(ctx env.RyeCtx, arg0 string) []string { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_ChildIDs = func(ctx env.RyeCtx, farg0 string) []string { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res []string switch v := ps.Res.(type) { case env.Block: res = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - res[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + res[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: block item: expected string", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14547,8 +13828,9 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalRuneTree: arg 0: callback result: expected block, native or nil", + "context to binding.ExternalRuneTree: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14557,79 +13839,45 @@ func ctxTo_binding_ExternalRuneTree(ps *env.ProgramState, v env.RyeCtx) (binding return res } default: - return nil, errors.New("context to binding.ExternalRuneTree: context fn ChildIDs: expected function") + return nil, errors.New("context to binding.ExternalRuneTree: context fn ChildIDs: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["AddListener"] + ctxObj9, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.ExternalRuneTree: expected context to have function AddListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalRuneTree: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalRuneTree: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalRuneTree: context fn AddListener: expected function") + return nil, errors.New("context to binding.ExternalRuneTree: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj10, ok := wordToObj["RemoveListener"] + ctxObj10, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.ExternalRuneTree: expected context to have function RemoveListener") } switch fn := ctxObj10.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalRuneTree: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalRuneTree: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalRuneTree: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.ExternalRuneTree: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -14677,14 +13925,14 @@ func ctxTo_binding_ExternalString(ps *env.ProgramState, v env.RyeCtx) (binding.E impl := &iface_binding_ExternalString{ self: v, } - ctxObj0, ok := wordToObj["Reload"] + ctxObj0, ok := wordToObj["reload"] if !ok { return nil, errors.New("context to binding.ExternalString: expected context to have function Reload") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalString: context fn Reload: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalString: context fn Reload: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Reload = func(ctx env.RyeCtx) error { actualFn := fn @@ -14698,8 +13946,9 @@ func ctxTo_binding_ExternalString(ps *env.ProgramState, v env.RyeCtx) (binding.E res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalString: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalString: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14707,8 +13956,9 @@ func ctxTo_binding_ExternalString(ps *env.ProgramState, v env.RyeCtx) (binding.E } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalString: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalString: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14717,16 +13967,16 @@ func ctxTo_binding_ExternalString(ps *env.ProgramState, v env.RyeCtx) (binding.E return res } default: - return nil, errors.New("context to binding.ExternalString: context fn Reload: expected function") + return nil, errors.New("context to binding.ExternalString: context fn Reload: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Get"] + ctxObj1, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.ExternalString: expected context to have function Get") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalString: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalString: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) (string, error) { actualFn := fn @@ -14736,26 +13986,29 @@ func ctxTo_binding_ExternalString(ps *env.ProgramState, v env.RyeCtx) (binding.E var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalString: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalString: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalString: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalString: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.String); ok { - res0 = string(v.Value) + if vc, ok := res.Series.S[0].(env.String); ok { + res0 = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalString: arg 0: callback result: expected string", + "context to binding.ExternalString: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14768,8 +14021,9 @@ func ctxTo_binding_ExternalString(ps *env.ProgramState, v env.RyeCtx) (binding.E res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalString: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalString: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14777,8 +14031,9 @@ func ctxTo_binding_ExternalString(ps *env.ProgramState, v env.RyeCtx) (binding.E } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalString: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalString: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14787,23 +14042,23 @@ func ctxTo_binding_ExternalString(ps *env.ProgramState, v env.RyeCtx) (binding.E return res0, res1 } default: - return nil, errors.New("context to binding.ExternalString: context fn Get: expected function") + return nil, errors.New("context to binding.ExternalString: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Set"] + ctxObj2, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.ExternalString: expected context to have function Set") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalString: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalString: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 string) error { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_Set = func(ctx env.RyeCtx, farg0 string) error { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -14812,8 +14067,9 @@ func ctxTo_binding_ExternalString(ps *env.ProgramState, v env.RyeCtx) (binding.E res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalString: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalString: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14821,8 +14077,9 @@ func ctxTo_binding_ExternalString(ps *env.ProgramState, v env.RyeCtx) (binding.E } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalString: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalString: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -14831,79 +14088,45 @@ func ctxTo_binding_ExternalString(ps *env.ProgramState, v env.RyeCtx) (binding.E return res } default: - return nil, errors.New("context to binding.ExternalString: context fn Set: expected function") + return nil, errors.New("context to binding.ExternalString: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["AddListener"] + ctxObj3, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.ExternalString: expected context to have function AddListener") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalString: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalString: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalString: context fn AddListener: expected function") + return nil, errors.New("context to binding.ExternalString: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["RemoveListener"] + ctxObj4, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.ExternalString: expected context to have function RemoveListener") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalString: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalString: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalString: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.ExternalString: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -14975,14 +14198,14 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi impl := &iface_binding_ExternalStringList{ self: v, } - ctxObj0, ok := wordToObj["Reload"] + ctxObj0, ok := wordToObj["reload"] if !ok { return nil, errors.New("context to binding.ExternalStringList: expected context to have function Reload") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalStringList: context fn Reload: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalStringList: context fn Reload: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Reload = func(ctx env.RyeCtx) error { actualFn := fn @@ -14996,8 +14219,9 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalStringList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15005,8 +14229,9 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalStringList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15015,23 +14240,23 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi return res } default: - return nil, errors.New("context to binding.ExternalStringList: context fn Reload: expected function") + return nil, errors.New("context to binding.ExternalStringList: context fn Reload: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Append"] + ctxObj1, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.ExternalStringList: expected context to have function Append") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalStringList: context fn Append: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalStringList: context fn Append: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 string) error { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_Append = func(ctx env.RyeCtx, farg0 string) error { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -15040,8 +14265,9 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalStringList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15049,8 +14275,9 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalStringList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15059,16 +14286,16 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi return res } default: - return nil, errors.New("context to binding.ExternalStringList: context fn Append: expected function") + return nil, errors.New("context to binding.ExternalStringList: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Get"] + ctxObj2, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.ExternalStringList: expected context to have function Get") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalStringList: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalStringList: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) ([]string, error) { actualFn := fn @@ -15078,16 +14305,18 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalStringList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalStringList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15097,32 +14326,23 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi case env.Block: res0 = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - res0[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + res0[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: block item: expected string", + "context to binding.ExternalStringList: arg 0: callback result: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } } - case env.Native: - var ok bool - res0, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalStringList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15130,8 +14350,9 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected block, native or nil", + "context to binding.ExternalStringList: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15144,8 +14365,9 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalStringList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15153,8 +14375,9 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalStringList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15163,47 +14386,50 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi return res0, res1 } default: - return nil, errors.New("context to binding.ExternalStringList: context fn Get: expected function") + return nil, errors.New("context to binding.ExternalStringList: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["GetValue"] + ctxObj3, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.ExternalStringList: expected context to have function GetValue") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalStringList: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalStringList: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 int) (string, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 int) (string, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 string var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalStringList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalStringList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.String); ok { - res0 = string(v.Value) + if vc, ok := res.Series.S[0].(env.String); ok { + res0 = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected string", + "context to binding.ExternalStringList: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15216,8 +14442,9 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalStringList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15225,8 +14452,9 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalStringList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15235,23 +14463,23 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi return res0, res1 } default: - return nil, errors.New("context to binding.ExternalStringList: context fn GetValue: expected function") + return nil, errors.New("context to binding.ExternalStringList: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Prepend"] + ctxObj4, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.ExternalStringList: expected context to have function Prepend") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalStringList: context fn Prepend: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalStringList: context fn Prepend: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 string) error { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 string) error { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -15260,8 +14488,9 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalStringList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15269,8 +14498,9 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalStringList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15279,29 +14509,29 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi return res } default: - return nil, errors.New("context to binding.ExternalStringList: context fn Prepend: expected function") + return nil, errors.New("context to binding.ExternalStringList: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["Set"] + ctxObj5, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.ExternalStringList: expected context to have function Set") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalStringList: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalStringList: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 []string) error { - var arg0Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 []string) error { + var farg0Val env.Object { - items := make([]env.Object, len(arg0)) - for i, it := range arg0 { + items := make([]env.Object, len(farg0)) + for i, it := range farg0 { items[i] = *env.NewString(it) } - arg0Val = *env.NewBlock(*env.NewTSeries(items)) + farg0Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -15310,8 +14540,9 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalStringList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15319,8 +14550,9 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalStringList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15329,24 +14561,24 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi return res } default: - return nil, errors.New("context to binding.ExternalStringList: context fn Set: expected function") + return nil, errors.New("context to binding.ExternalStringList: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["SetValue"] + ctxObj6, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.ExternalStringList: expected context to have function SetValue") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.ExternalStringList: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.ExternalStringList: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 int, arg1 string) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) - arg1Val = *env.NewString(arg1) + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 int, farg1 string) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) + farg1Val = *env.NewString(farg1) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -15355,8 +14587,9 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalStringList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15364,8 +14597,9 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalStringList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15374,37 +14608,39 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi return res } default: - return nil, errors.New("context to binding.ExternalStringList: context fn SetValue: expected function") + return nil, errors.New("context to binding.ExternalStringList: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["GetItem"] + ctxObj7, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.ExternalStringList: expected context to have function GetItem") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalStringList: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalStringList: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 int) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 int) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalStringList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalStringList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15415,19 +14651,21 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: "+err.Error()+"", + "context to binding.ExternalStringList: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.ExternalStringList: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15435,8 +14673,9 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalStringList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15444,8 +14683,9 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected native", + "context to binding.ExternalStringList: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15458,8 +14698,9 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalStringList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15467,8 +14708,9 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalStringList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15477,27 +14719,28 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi return res0, res1 } default: - return nil, errors.New("context to binding.ExternalStringList: context fn GetItem: expected function") + return nil, errors.New("context to binding.ExternalStringList: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["Length"] + ctxObj8, ok := wordToObj["length"] if !ok { return nil, errors.New("context to binding.ExternalStringList: expected context to have function Length") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalStringList: context fn Length: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalStringList: context fn Length: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Length = func(ctx env.RyeCtx) int { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res int - if v, ok := ps.Res.(env.Integer); ok { - res = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + res = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringList: arg 0: callback result: expected integer", + "context to binding.ExternalStringList: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15506,79 +14749,45 @@ func ctxTo_binding_ExternalStringList(ps *env.ProgramState, v env.RyeCtx) (bindi return res } default: - return nil, errors.New("context to binding.ExternalStringList: context fn Length: expected function") + return nil, errors.New("context to binding.ExternalStringList: context fn Length: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["AddListener"] + ctxObj9, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.ExternalStringList: expected context to have function AddListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalStringList: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalStringList: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalStringList: context fn AddListener: expected function") + return nil, errors.New("context to binding.ExternalStringList: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj10, ok := wordToObj["RemoveListener"] + ctxObj10, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.ExternalStringList: expected context to have function RemoveListener") } switch fn := ctxObj10.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalStringList: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalStringList: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalStringList: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.ExternalStringList: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -15650,14 +14859,14 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi impl := &iface_binding_ExternalStringTree{ self: v, } - ctxObj0, ok := wordToObj["Reload"] + ctxObj0, ok := wordToObj["reload"] if !ok { return nil, errors.New("context to binding.ExternalStringTree: expected context to have function Reload") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalStringTree: context fn Reload: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalStringTree: context fn Reload: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Reload = func(ctx env.RyeCtx) error { actualFn := fn @@ -15671,8 +14880,9 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15680,8 +14890,9 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15690,25 +14901,25 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi return res } default: - return nil, errors.New("context to binding.ExternalStringTree: context fn Reload: expected function") + return nil, errors.New("context to binding.ExternalStringTree: context fn Reload: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Append"] + ctxObj1, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.ExternalStringTree: expected context to have function Append") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 3 { - return nil, errors.New("context to binding.ExternalStringTree: context fn Append: function has invalid number of arguments (expected 3)") + return nil, errors.New("context to binding.ExternalStringTree: context fn Append: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 string, arg1 string, arg2 string) error { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) - arg2Val = *env.NewString(arg2) + impl.fn_Append = func(ctx env.RyeCtx, farg0 string, farg1 string, farg2 string) error { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) + farg2Val = *env.NewString(farg2) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val, farg2Val) var res error switch v := ps.Res.(type) { case env.String: @@ -15717,8 +14928,9 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15726,8 +14938,9 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15736,16 +14949,16 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi return res } default: - return nil, errors.New("context to binding.ExternalStringTree: context fn Append: expected function") + return nil, errors.New("context to binding.ExternalStringTree: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Get"] + ctxObj2, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.ExternalStringTree: expected context to have function Get") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalStringTree: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalStringTree: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) (map[string][]string, map[string]string, error) { actualFn := fn @@ -15756,16 +14969,18 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi var res2 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } if len(res.Series.S) != 3 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected block with 3 return values", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected block with 3 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15774,8 +14989,9 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi switch v := res.Series.S[0].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15784,11 +15000,12 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi res0 = make(map[string][]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: map key: expected string", + "context to binding.ExternalStringTree: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15799,32 +15016,23 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: map value: block item: expected string", + "context to binding.ExternalStringTree: arg 0: callback result: "+"map value: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: map value: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.ExternalStringTree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15832,8 +15040,9 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.ExternalStringTree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15850,32 +15059,23 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: map value: block item: expected string", + "context to binding.ExternalStringTree: arg 0: callback result: "+"map value: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: map value: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.ExternalStringTree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15883,8 +15083,9 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.ExternalStringTree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15892,21 +15093,11 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi } res0[mapK] = mapV } - case env.Native: - var ok bool - res0, ok = v.Value.(map[string][]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected native of type map[string][]string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15914,8 +15105,9 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected native, block, dict or nil", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15924,8 +15116,9 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi switch v := res.Series.S[1].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15934,22 +15127,24 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi res1 = make(map[string]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: map key: expected string", + "context to binding.ExternalStringTree: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } var mapV string - if v, ok := v.Series.S[i+1].(env.String); ok { - mapV = string(v.Value) + if vc, ok := v.Series.S[i+1].(env.String); ok { + mapV = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: map value: expected string", + "context to binding.ExternalStringTree: arg 0: callback result: "+"map value: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+1]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15962,11 +15157,12 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi for dictK, dictV := range v.Data { mapK := dictK var mapV string - if v, ok := dictV.(env.String); ok { - mapV = string(v.Value) + if vc, ok := dictV.(env.String); ok { + mapV = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: map value: expected string", + "context to binding.ExternalStringTree: arg 0: callback result: "+"map value: "+"expected string, but got "+objectDebugString(ps.Idx, dictV), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15974,21 +15170,11 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi } res1[mapK] = mapV } - case env.Native: - var ok bool - res1, ok = v.Value.(map[string]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected native of type map[string]string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -15996,8 +15182,9 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected native, block, dict or nil", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16010,8 +15197,9 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi res2 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16019,8 +15207,9 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi } res2 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16029,47 +15218,50 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi return res0, res1, res2 } default: - return nil, errors.New("context to binding.ExternalStringTree: context fn Get: expected function") + return nil, errors.New("context to binding.ExternalStringTree: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["GetValue"] + ctxObj3, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.ExternalStringTree: expected context to have function GetValue") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalStringTree: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalStringTree: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 string) (string, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 string) (string, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 string var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.String); ok { - res0 = string(v.Value) + if vc, ok := res.Series.S[0].(env.String); ok { + res0 = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected string", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16082,8 +15274,9 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16091,8 +15284,9 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16101,25 +15295,25 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi return res0, res1 } default: - return nil, errors.New("context to binding.ExternalStringTree: context fn GetValue: expected function") + return nil, errors.New("context to binding.ExternalStringTree: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Prepend"] + ctxObj4, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.ExternalStringTree: expected context to have function Prepend") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 3 { - return nil, errors.New("context to binding.ExternalStringTree: context fn Prepend: function has invalid number of arguments (expected 3)") + return nil, errors.New("context to binding.ExternalStringTree: context fn Prepend: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 string, arg1 string, arg2 string) error { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) - arg2Val = *env.NewString(arg2) + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 string, farg1 string, farg2 string) error { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) + farg2Val = *env.NewString(farg2) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val, farg2Val) var res error switch v := ps.Res.(type) { case env.String: @@ -16128,8 +15322,9 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16137,8 +15332,9 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16147,22 +15343,22 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi return res } default: - return nil, errors.New("context to binding.ExternalStringTree: context fn Prepend: expected function") + return nil, errors.New("context to binding.ExternalStringTree: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["Set"] + ctxObj5, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.ExternalStringTree: expected context to have function Set") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.ExternalStringTree: context fn Set: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.ExternalStringTree: context fn Set: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 map[string][]string, arg1 map[string]string) error { - var arg0Val, arg1Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 map[string][]string, farg1 map[string]string) error { + var farg0Val, farg1Val env.Object { - data := make(map[string]any, len(arg0)) - for mKey, mVal := range arg0 { + data := make(map[string]any, len(farg0)) + for mKey, mVal := range farg0 { var dVal env.Object { items := make([]env.Object, len(mVal)) @@ -16173,20 +15369,20 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi } data[mKey] = dVal } - arg0Val = *env.NewDict(data) + farg0Val = *env.NewDict(data) } { - data := make(map[string]any, len(arg1)) - for mKey, mVal := range arg1 { + data := make(map[string]any, len(farg1)) + for mKey, mVal := range farg1 { var dVal env.Object dVal = *env.NewString(mVal) data[mKey] = dVal } - arg1Val = *env.NewDict(data) + farg1Val = *env.NewDict(data) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -16195,8 +15391,9 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16204,8 +15401,9 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16214,24 +15412,24 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi return res } default: - return nil, errors.New("context to binding.ExternalStringTree: context fn Set: expected function") + return nil, errors.New("context to binding.ExternalStringTree: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["SetValue"] + ctxObj6, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.ExternalStringTree: expected context to have function SetValue") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.ExternalStringTree: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.ExternalStringTree: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 string, arg1 string) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 string, farg1 string) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -16240,8 +15438,9 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16249,8 +15448,9 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16259,37 +15459,39 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi return res } default: - return nil, errors.New("context to binding.ExternalStringTree: context fn SetValue: expected function") + return nil, errors.New("context to binding.ExternalStringTree: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["GetItem"] + ctxObj7, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.ExternalStringTree: expected context to have function GetItem") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalStringTree: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalStringTree: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 string) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 string) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16300,19 +15502,21 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: "+err.Error()+"", + "context to binding.ExternalStringTree: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16320,8 +15524,9 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16329,8 +15534,9 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected native", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16343,8 +15549,9 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16352,8 +15559,9 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16362,54 +15570,45 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi return res0, res1 } default: - return nil, errors.New("context to binding.ExternalStringTree: context fn GetItem: expected function") + return nil, errors.New("context to binding.ExternalStringTree: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["ChildIDs"] + ctxObj8, ok := wordToObj["child-i-ds"] if !ok { return nil, errors.New("context to binding.ExternalStringTree: expected context to have function ChildIDs") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalStringTree: context fn ChildIDs: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalStringTree: context fn ChildIDs: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_ChildIDs = func(ctx env.RyeCtx, arg0 string) []string { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_ChildIDs = func(ctx env.RyeCtx, farg0 string) []string { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res []string switch v := ps.Res.(type) { case env.Block: res = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - res[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + res[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: block item: expected string", + "context to binding.ExternalStringTree: arg 0: callback result: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16417,8 +15616,9 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalStringTree: arg 0: callback result: expected block, native or nil", + "context to binding.ExternalStringTree: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16427,79 +15627,45 @@ func ctxTo_binding_ExternalStringTree(ps *env.ProgramState, v env.RyeCtx) (bindi return res } default: - return nil, errors.New("context to binding.ExternalStringTree: context fn ChildIDs: expected function") + return nil, errors.New("context to binding.ExternalStringTree: context fn ChildIDs: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["AddListener"] + ctxObj9, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.ExternalStringTree: expected context to have function AddListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalStringTree: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalStringTree: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalStringTree: context fn AddListener: expected function") + return nil, errors.New("context to binding.ExternalStringTree: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj10, ok := wordToObj["RemoveListener"] + ctxObj10, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.ExternalStringTree: expected context to have function RemoveListener") } switch fn := ctxObj10.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalStringTree: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalStringTree: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalStringTree: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.ExternalStringTree: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -16547,14 +15713,14 @@ func ctxTo_binding_ExternalURI(ps *env.ProgramState, v env.RyeCtx) (binding.Exte impl := &iface_binding_ExternalURI{ self: v, } - ctxObj0, ok := wordToObj["Reload"] + ctxObj0, ok := wordToObj["reload"] if !ok { return nil, errors.New("context to binding.ExternalURI: expected context to have function Reload") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalURI: context fn Reload: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalURI: context fn Reload: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Reload = func(ctx env.RyeCtx) error { actualFn := fn @@ -16568,8 +15734,9 @@ func ctxTo_binding_ExternalURI(ps *env.ProgramState, v env.RyeCtx) (binding.Exte res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURI: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalURI: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16577,8 +15744,9 @@ func ctxTo_binding_ExternalURI(ps *env.ProgramState, v env.RyeCtx) (binding.Exte } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURI: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalURI: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16587,16 +15755,16 @@ func ctxTo_binding_ExternalURI(ps *env.ProgramState, v env.RyeCtx) (binding.Exte return res } default: - return nil, errors.New("context to binding.ExternalURI: context fn Reload: expected function") + return nil, errors.New("context to binding.ExternalURI: context fn Reload: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Get"] + ctxObj1, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.ExternalURI: expected context to have function Get") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalURI: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalURI: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) (fyne.URI, error) { actualFn := fn @@ -16606,16 +15774,18 @@ func ctxTo_binding_ExternalURI(ps *env.ProgramState, v env.RyeCtx) (binding.Exte var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURI: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalURI: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURI: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalURI: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16626,19 +15796,21 @@ func ctxTo_binding_ExternalURI(ps *env.ProgramState, v env.RyeCtx) (binding.Exte var err error res0, err = ctxTo_fyne_URI(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURI: arg 0: callback result: "+err.Error()+"", + "context to binding.ExternalURI: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURI: arg 0: callback result: expected native of type fyne.URI", + "context to binding.ExternalURI: arg 0: callback result: "+"expected native of type fyne.URI, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16646,8 +15818,9 @@ func ctxTo_binding_ExternalURI(ps *env.ProgramState, v env.RyeCtx) (binding.Exte } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURI: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalURI: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16655,8 +15828,9 @@ func ctxTo_binding_ExternalURI(ps *env.ProgramState, v env.RyeCtx) (binding.Exte } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURI: arg 0: callback result: expected native", + "context to binding.ExternalURI: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16669,8 +15843,9 @@ func ctxTo_binding_ExternalURI(ps *env.ProgramState, v env.RyeCtx) (binding.Exte res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURI: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalURI: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16678,8 +15853,9 @@ func ctxTo_binding_ExternalURI(ps *env.ProgramState, v env.RyeCtx) (binding.Exte } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURI: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalURI: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16688,40 +15864,23 @@ func ctxTo_binding_ExternalURI(ps *env.ProgramState, v env.RyeCtx) (binding.Exte return res0, res1 } default: - return nil, errors.New("context to binding.ExternalURI: context fn Get: expected function") + return nil, errors.New("context to binding.ExternalURI: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Set"] + ctxObj2, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.ExternalURI: expected context to have function Set") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalURI: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalURI: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 fyne.URI) error { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_Set = func(ctx env.RyeCtx, farg0 fyne.URI) error { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -16730,8 +15889,9 @@ func ctxTo_binding_ExternalURI(ps *env.ProgramState, v env.RyeCtx) (binding.Exte res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURI: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalURI: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16739,8 +15899,9 @@ func ctxTo_binding_ExternalURI(ps *env.ProgramState, v env.RyeCtx) (binding.Exte } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURI: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalURI: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16749,79 +15910,45 @@ func ctxTo_binding_ExternalURI(ps *env.ProgramState, v env.RyeCtx) (binding.Exte return res } default: - return nil, errors.New("context to binding.ExternalURI: context fn Set: expected function") + return nil, errors.New("context to binding.ExternalURI: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["AddListener"] + ctxObj3, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.ExternalURI: expected context to have function AddListener") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalURI: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalURI: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalURI: context fn AddListener: expected function") + return nil, errors.New("context to binding.ExternalURI: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["RemoveListener"] + ctxObj4, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.ExternalURI: expected context to have function RemoveListener") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalURI: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalURI: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalURI: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.ExternalURI: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -16893,14 +16020,14 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. impl := &iface_binding_ExternalURIList{ self: v, } - ctxObj0, ok := wordToObj["Reload"] + ctxObj0, ok := wordToObj["reload"] if !ok { return nil, errors.New("context to binding.ExternalURIList: expected context to have function Reload") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalURIList: context fn Reload: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalURIList: context fn Reload: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Reload = func(ctx env.RyeCtx) error { actualFn := fn @@ -16914,8 +16041,9 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16923,8 +16051,9 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16933,40 +16062,23 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. return res } default: - return nil, errors.New("context to binding.ExternalURIList: context fn Reload: expected function") + return nil, errors.New("context to binding.ExternalURIList: context fn Reload: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Append"] + ctxObj1, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.ExternalURIList: expected context to have function Append") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalURIList: context fn Append: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalURIList: context fn Append: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 fyne.URI) error { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_Append = func(ctx env.RyeCtx, farg0 fyne.URI) error { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -16975,8 +16087,9 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16984,8 +16097,9 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -16994,16 +16108,16 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. return res } default: - return nil, errors.New("context to binding.ExternalURIList: context fn Append: expected function") + return nil, errors.New("context to binding.ExternalURIList: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Get"] + ctxObj2, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.ExternalURIList: expected context to have function Get") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalURIList: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalURIList: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) ([]fyne.URI, error) { actualFn := fn @@ -17013,16 +16127,18 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17037,19 +16153,21 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. var err error res0[i], err = ctxTo_fyne_URI(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: block item: "+err.Error()+"", + "context to binding.ExternalURIList: arg 0: callback result: "+"block item: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0[i], ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + res0[i] = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: block item: expected native of type fyne.URI", + "context to binding.ExternalURIList: arg 0: callback result: "+"block item: "+"expected native of type fyne.URI, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17057,8 +16175,9 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: block item: expected integer to be 0 or nil", + "context to binding.ExternalURIList: arg 0: callback result: "+"block item: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17066,29 +16185,20 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. } res0[i] = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: block item: expected native", + "context to binding.ExternalURIList: arg 0: callback result: "+"block item: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } } - case env.Native: - var ok bool - res0, ok = v.Value.([]fyne.URI) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected native of type []fyne.URI", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17096,8 +16206,9 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected block, native or nil", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17110,8 +16221,9 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17119,8 +16231,9 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17129,37 +16242,39 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. return res0, res1 } default: - return nil, errors.New("context to binding.ExternalURIList: context fn Get: expected function") + return nil, errors.New("context to binding.ExternalURIList: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["GetValue"] + ctxObj3, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.ExternalURIList: expected context to have function GetValue") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalURIList: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalURIList: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 int) (fyne.URI, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 int) (fyne.URI, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 fyne.URI var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17170,19 +16285,21 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. var err error res0, err = ctxTo_fyne_URI(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: "+err.Error()+"", + "context to binding.ExternalURIList: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected native of type fyne.URI", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected native of type fyne.URI, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17190,8 +16307,9 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17199,8 +16317,9 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected native", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17213,8 +16332,9 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17222,8 +16342,9 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17232,40 +16353,23 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. return res0, res1 } default: - return nil, errors.New("context to binding.ExternalURIList: context fn GetValue: expected function") + return nil, errors.New("context to binding.ExternalURIList: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Prepend"] + ctxObj4, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.ExternalURIList: expected context to have function Prepend") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalURIList: context fn Prepend: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalURIList: context fn Prepend: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 fyne.URI) error { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 fyne.URI) error { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -17274,8 +16378,9 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17283,8 +16388,9 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17293,46 +16399,29 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. return res } default: - return nil, errors.New("context to binding.ExternalURIList: context fn Prepend: expected function") + return nil, errors.New("context to binding.ExternalURIList: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["Set"] + ctxObj5, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.ExternalURIList: expected context to have function Set") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalURIList: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalURIList: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 []fyne.URI) error { - var arg0Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 []fyne.URI) error { + var farg0Val env.Object { - items := make([]env.Object, len(arg0)) - for i, it := range arg0 { - { - typ := reflect.TypeOf(it) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - items[i] = *env.NewNative(ps.Idx, it, typRyeName) - } else { - items[i] = *env.NewNative(ps.Idx, it, "Go(fyne.URI)") - } - } + items := make([]env.Object, len(farg0)) + for i, it := range farg0 { + items[i] = ifaceToNative(ps.Idx, it, "Go(fyne.URI)") } - arg0Val = *env.NewBlock(*env.NewTSeries(items)) + farg0Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -17341,8 +16430,9 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17350,8 +16440,9 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17360,41 +16451,24 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. return res } default: - return nil, errors.New("context to binding.ExternalURIList: context fn Set: expected function") + return nil, errors.New("context to binding.ExternalURIList: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["SetValue"] + ctxObj6, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.ExternalURIList: expected context to have function SetValue") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.ExternalURIList: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.ExternalURIList: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 int, arg1 fyne.URI) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) - { - typ := reflect.TypeOf(arg1) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg1Val = *env.NewNative(ps.Idx, arg1, typRyeName) - } else { - arg1Val = *env.NewNative(ps.Idx, arg1, "Go(fyne.URI)") - } - } + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 int, farg1 fyne.URI) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) + farg1Val = ifaceToNative(ps.Idx, farg1, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -17403,8 +16477,9 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17412,8 +16487,9 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17422,37 +16498,39 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. return res } default: - return nil, errors.New("context to binding.ExternalURIList: context fn SetValue: expected function") + return nil, errors.New("context to binding.ExternalURIList: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["GetItem"] + ctxObj7, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.ExternalURIList: expected context to have function GetItem") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalURIList: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalURIList: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 int) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 int) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17463,19 +16541,21 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: "+err.Error()+"", + "context to binding.ExternalURIList: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17483,8 +16563,9 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17492,8 +16573,9 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected native", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17506,8 +16588,9 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17515,8 +16598,9 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17525,27 +16609,28 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. return res0, res1 } default: - return nil, errors.New("context to binding.ExternalURIList: context fn GetItem: expected function") + return nil, errors.New("context to binding.ExternalURIList: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["Length"] + ctxObj8, ok := wordToObj["length"] if !ok { return nil, errors.New("context to binding.ExternalURIList: expected context to have function Length") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalURIList: context fn Length: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalURIList: context fn Length: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Length = func(ctx env.RyeCtx) int { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res int - if v, ok := ps.Res.(env.Integer); ok { - res = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + res = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURIList: arg 0: callback result: expected integer", + "context to binding.ExternalURIList: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17554,79 +16639,45 @@ func ctxTo_binding_ExternalURIList(ps *env.ProgramState, v env.RyeCtx) (binding. return res } default: - return nil, errors.New("context to binding.ExternalURIList: context fn Length: expected function") + return nil, errors.New("context to binding.ExternalURIList: context fn Length: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["AddListener"] + ctxObj9, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.ExternalURIList: expected context to have function AddListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalURIList: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalURIList: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalURIList: context fn AddListener: expected function") + return nil, errors.New("context to binding.ExternalURIList: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj10, ok := wordToObj["RemoveListener"] + ctxObj10, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.ExternalURIList: expected context to have function RemoveListener") } switch fn := ctxObj10.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalURIList: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalURIList: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalURIList: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.ExternalURIList: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -17698,14 +16749,14 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. impl := &iface_binding_ExternalURITree{ self: v, } - ctxObj0, ok := wordToObj["Reload"] + ctxObj0, ok := wordToObj["reload"] if !ok { return nil, errors.New("context to binding.ExternalURITree: expected context to have function Reload") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalURITree: context fn Reload: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalURITree: context fn Reload: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Reload = func(ctx env.RyeCtx) error { actualFn := fn @@ -17719,8 +16770,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17728,8 +16780,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17738,42 +16791,25 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. return res } default: - return nil, errors.New("context to binding.ExternalURITree: context fn Reload: expected function") + return nil, errors.New("context to binding.ExternalURITree: context fn Reload: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Append"] + ctxObj1, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.ExternalURITree: expected context to have function Append") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 3 { - return nil, errors.New("context to binding.ExternalURITree: context fn Append: function has invalid number of arguments (expected 3)") + return nil, errors.New("context to binding.ExternalURITree: context fn Append: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 string, arg1 string, arg2 fyne.URI) error { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) - { - typ := reflect.TypeOf(arg2) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg2Val = *env.NewNative(ps.Idx, arg2, typRyeName) - } else { - arg2Val = *env.NewNative(ps.Idx, arg2, "Go(fyne.URI)") - } - } + impl.fn_Append = func(ctx env.RyeCtx, farg0 string, farg1 string, farg2 fyne.URI) error { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) + farg2Val = ifaceToNative(ps.Idx, farg2, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val, farg2Val) var res error switch v := ps.Res.(type) { case env.String: @@ -17782,8 +16818,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17791,8 +16828,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17801,16 +16839,16 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. return res } default: - return nil, errors.New("context to binding.ExternalURITree: context fn Append: expected function") + return nil, errors.New("context to binding.ExternalURITree: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Get"] + ctxObj2, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.ExternalURITree: expected context to have function Get") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalURITree: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalURITree: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) (map[string][]string, map[string]fyne.URI, error) { actualFn := fn @@ -17821,16 +16859,18 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. var res2 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } if len(res.Series.S) != 3 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected block with 3 return values", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected block with 3 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17839,8 +16879,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. switch v := res.Series.S[0].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17849,11 +16890,12 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. res0 = make(map[string][]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: map key: expected string", + "context to binding.ExternalURITree: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17864,32 +16906,23 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: map value: block item: expected string", + "context to binding.ExternalURITree: arg 0: callback result: "+"map value: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: map value: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17897,8 +16930,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17915,32 +16949,23 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: map value: block item: expected string", + "context to binding.ExternalURITree: arg 0: callback result: "+"map value: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: map value: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17948,8 +16973,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17957,21 +16983,11 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. } res0[mapK] = mapV } - case env.Native: - var ok bool - res0, ok = v.Value.(map[string][]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected native of type map[string][]string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17979,8 +16995,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected native, block, dict or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17989,8 +17006,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. switch v := res.Series.S[1].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -17999,11 +17017,12 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. res1 = make(map[string]fyne.URI, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: map key: expected string", + "context to binding.ExternalURITree: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18015,19 +17034,21 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. var err error mapV, err = ctxTo_fyne_URI(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: map value: "+err.Error()+"", + "context to binding.ExternalURITree: arg 0: callback result: "+"map value: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } case env.Native: - var ok bool - mapV, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + mapV = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: map value: expected native of type fyne.URI", + "context to binding.ExternalURITree: arg 0: callback result: "+"map value: "+"expected native of type fyne.URI, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18035,8 +17056,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18044,8 +17066,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: map value: expected native", + "context to binding.ExternalURITree: arg 0: callback result: "+"map value: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18063,19 +17086,21 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. var err error mapV, err = ctxTo_fyne_URI(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: map value: "+err.Error()+"", + "context to binding.ExternalURITree: arg 0: callback result: "+"map value: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } case env.Native: - var ok bool - mapV, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + mapV = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: map value: expected native of type fyne.URI", + "context to binding.ExternalURITree: arg 0: callback result: "+"map value: "+"expected native of type fyne.URI, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18083,8 +17108,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18092,8 +17118,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: map value: expected native", + "context to binding.ExternalURITree: arg 0: callback result: "+"map value: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18101,21 +17128,11 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. } res1[mapK] = mapV } - case env.Native: - var ok bool - res1, ok = v.Value.(map[string]fyne.URI) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected native of type map[string]fyne.URI", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18123,8 +17140,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected native, block, dict or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18137,8 +17155,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. res2 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18146,8 +17165,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. } res2 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18156,37 +17176,39 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. return res0, res1, res2 } default: - return nil, errors.New("context to binding.ExternalURITree: context fn Get: expected function") + return nil, errors.New("context to binding.ExternalURITree: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["GetValue"] + ctxObj3, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.ExternalURITree: expected context to have function GetValue") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalURITree: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalURITree: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 string) (fyne.URI, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 string) (fyne.URI, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 fyne.URI var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18197,19 +17219,21 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. var err error res0, err = ctxTo_fyne_URI(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: "+err.Error()+"", + "context to binding.ExternalURITree: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected native of type fyne.URI", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected native of type fyne.URI, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18217,8 +17241,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18226,8 +17251,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected native", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18240,8 +17266,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18249,8 +17276,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18259,42 +17287,25 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. return res0, res1 } default: - return nil, errors.New("context to binding.ExternalURITree: context fn GetValue: expected function") + return nil, errors.New("context to binding.ExternalURITree: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Prepend"] + ctxObj4, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.ExternalURITree: expected context to have function Prepend") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 3 { - return nil, errors.New("context to binding.ExternalURITree: context fn Prepend: function has invalid number of arguments (expected 3)") + return nil, errors.New("context to binding.ExternalURITree: context fn Prepend: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 string, arg1 string, arg2 fyne.URI) error { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) - { - typ := reflect.TypeOf(arg2) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg2Val = *env.NewNative(ps.Idx, arg2, typRyeName) - } else { - arg2Val = *env.NewNative(ps.Idx, arg2, "Go(fyne.URI)") - } - } + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 string, farg1 string, farg2 fyne.URI) error { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) + farg2Val = ifaceToNative(ps.Idx, farg2, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val, farg2Val) var res error switch v := ps.Res.(type) { case env.String: @@ -18303,8 +17314,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18312,8 +17324,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18322,22 +17335,22 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. return res } default: - return nil, errors.New("context to binding.ExternalURITree: context fn Prepend: expected function") + return nil, errors.New("context to binding.ExternalURITree: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["Set"] + ctxObj5, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.ExternalURITree: expected context to have function Set") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.ExternalURITree: context fn Set: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.ExternalURITree: context fn Set: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 map[string][]string, arg1 map[string]fyne.URI) error { - var arg0Val, arg1Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 map[string][]string, farg1 map[string]fyne.URI) error { + var farg0Val, farg1Val env.Object { - data := make(map[string]any, len(arg0)) - for mKey, mVal := range arg0 { + data := make(map[string]any, len(farg0)) + for mKey, mVal := range farg0 { var dVal env.Object { items := make([]env.Object, len(mVal)) @@ -18348,37 +17361,20 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. } data[mKey] = dVal } - arg0Val = *env.NewDict(data) + farg0Val = *env.NewDict(data) } { - data := make(map[string]any, len(arg1)) - for mKey, mVal := range arg1 { + data := make(map[string]any, len(farg1)) + for mKey, mVal := range farg1 { var dVal env.Object - { - typ := reflect.TypeOf(mVal) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - dVal = *env.NewNative(ps.Idx, mVal, typRyeName) - } else { - dVal = *env.NewNative(ps.Idx, mVal, "Go(fyne.URI)") - } - } + dVal = ifaceToNative(ps.Idx, mVal, "Go(fyne.URI)") data[mKey] = dVal } - arg1Val = *env.NewDict(data) + farg1Val = *env.NewDict(data) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -18387,8 +17383,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18396,8 +17393,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18406,41 +17404,24 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. return res } default: - return nil, errors.New("context to binding.ExternalURITree: context fn Set: expected function") + return nil, errors.New("context to binding.ExternalURITree: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["SetValue"] + ctxObj6, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.ExternalURITree: expected context to have function SetValue") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.ExternalURITree: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.ExternalURITree: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 string, arg1 fyne.URI) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) - { - typ := reflect.TypeOf(arg1) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg1Val = *env.NewNative(ps.Idx, arg1, typRyeName) - } else { - arg1Val = *env.NewNative(ps.Idx, arg1, "Go(fyne.URI)") - } - } + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 string, farg1 fyne.URI) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = ifaceToNative(ps.Idx, farg1, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -18449,8 +17430,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18458,8 +17440,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18468,37 +17451,39 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. return res } default: - return nil, errors.New("context to binding.ExternalURITree: context fn SetValue: expected function") + return nil, errors.New("context to binding.ExternalURITree: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["GetItem"] + ctxObj7, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.ExternalURITree: expected context to have function GetItem") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalURITree: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalURITree: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 string) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 string) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18509,19 +17494,21 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: "+err.Error()+"", + "context to binding.ExternalURITree: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18529,8 +17516,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18538,8 +17526,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected native", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18552,8 +17541,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18561,8 +17551,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18571,54 +17562,45 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. return res0, res1 } default: - return nil, errors.New("context to binding.ExternalURITree: context fn GetItem: expected function") + return nil, errors.New("context to binding.ExternalURITree: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["ChildIDs"] + ctxObj8, ok := wordToObj["child-i-ds"] if !ok { return nil, errors.New("context to binding.ExternalURITree: expected context to have function ChildIDs") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalURITree: context fn ChildIDs: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalURITree: context fn ChildIDs: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_ChildIDs = func(ctx env.RyeCtx, arg0 string) []string { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_ChildIDs = func(ctx env.RyeCtx, farg0 string) []string { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res []string switch v := ps.Res.(type) { case env.Block: res = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - res[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + res[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: block item: expected string", + "context to binding.ExternalURITree: arg 0: callback result: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18626,8 +17608,9 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalURITree: arg 0: callback result: expected block, native or nil", + "context to binding.ExternalURITree: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18636,79 +17619,45 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. return res } default: - return nil, errors.New("context to binding.ExternalURITree: context fn ChildIDs: expected function") + return nil, errors.New("context to binding.ExternalURITree: context fn ChildIDs: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["AddListener"] + ctxObj9, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.ExternalURITree: expected context to have function AddListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalURITree: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalURITree: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalURITree: context fn AddListener: expected function") + return nil, errors.New("context to binding.ExternalURITree: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj10, ok := wordToObj["RemoveListener"] + ctxObj10, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.ExternalURITree: expected context to have function RemoveListener") } switch fn := ctxObj10.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalURITree: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalURITree: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalURITree: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.ExternalURITree: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -18716,8 +17665,8 @@ func ctxTo_binding_ExternalURITree(ps *env.ProgramState, v env.RyeCtx) (binding. type iface_binding_ExternalUntyped struct { self env.RyeCtx fn_Reload func(self env.RyeCtx) error - fn_Get func(self env.RyeCtx) (any, error) - fn_Set func(self env.RyeCtx, arg0 any) error + fn_Get func(self env.RyeCtx) (interface{}, error) + fn_Set func(self env.RyeCtx, arg0 interface{}) error fn_AddListener func(self env.RyeCtx, arg0 binding.DataListener) fn_RemoveListener func(self env.RyeCtx, arg0 binding.DataListener) } @@ -18725,10 +17674,10 @@ type iface_binding_ExternalUntyped struct { func (self *iface_binding_ExternalUntyped) Reload() error { return self.fn_Reload(self.self) } -func (self *iface_binding_ExternalUntyped) Get() (any, error) { +func (self *iface_binding_ExternalUntyped) Get() (interface{}, error) { return self.fn_Get(self.self) } -func (self *iface_binding_ExternalUntyped) Set(arg0 any) error { +func (self *iface_binding_ExternalUntyped) Set(arg0 interface{}) error { return self.fn_Set(self.self, arg0) } func (self *iface_binding_ExternalUntyped) AddListener(arg0 binding.DataListener) { @@ -18756,14 +17705,14 @@ func ctxTo_binding_ExternalUntyped(ps *env.ProgramState, v env.RyeCtx) (binding. impl := &iface_binding_ExternalUntyped{ self: v, } - ctxObj0, ok := wordToObj["Reload"] + ctxObj0, ok := wordToObj["reload"] if !ok { return nil, errors.New("context to binding.ExternalUntyped: expected context to have function Reload") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalUntyped: context fn Reload: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalUntyped: context fn Reload: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Reload = func(ctx env.RyeCtx) error { actualFn := fn @@ -18777,8 +17726,9 @@ func ctxTo_binding_ExternalUntyped(ps *env.ProgramState, v env.RyeCtx) (binding. res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntyped: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalUntyped: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18786,8 +17736,9 @@ func ctxTo_binding_ExternalUntyped(ps *env.ProgramState, v env.RyeCtx) (binding. } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntyped: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalUntyped: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18796,35 +17747,37 @@ func ctxTo_binding_ExternalUntyped(ps *env.ProgramState, v env.RyeCtx) (binding. return res } default: - return nil, errors.New("context to binding.ExternalUntyped: context fn Reload: expected function") + return nil, errors.New("context to binding.ExternalUntyped: context fn Reload: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Get"] + ctxObj1, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.ExternalUntyped: expected context to have function Get") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalUntyped: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalUntyped: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Get = func(ctx env.RyeCtx) (any, error) { + impl.fn_Get = func(ctx env.RyeCtx) (interface{}, error) { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) - var res0 any + var res0 interface{} var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntyped: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalUntyped: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntyped: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalUntyped: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18832,19 +17785,21 @@ func ctxTo_binding_ExternalUntyped(ps *env.ProgramState, v env.RyeCtx) (binding. } switch v := res.Series.S[0].(type) { case env.Native: - var ok bool - res0, ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntyped: arg 0: callback result: expected native of type any", + "context to binding.ExternalUntyped: arg 0: callback result: "+"expected native of type interface{}, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntyped: arg 0: callback result: expected native", + "context to binding.ExternalUntyped: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18857,8 +17812,9 @@ func ctxTo_binding_ExternalUntyped(ps *env.ProgramState, v env.RyeCtx) (binding. res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntyped: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalUntyped: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18866,8 +17822,9 @@ func ctxTo_binding_ExternalUntyped(ps *env.ProgramState, v env.RyeCtx) (binding. } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntyped: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalUntyped: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18876,23 +17833,23 @@ func ctxTo_binding_ExternalUntyped(ps *env.ProgramState, v env.RyeCtx) (binding. return res0, res1 } default: - return nil, errors.New("context to binding.ExternalUntyped: context fn Get: expected function") + return nil, errors.New("context to binding.ExternalUntyped: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Set"] + ctxObj2, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.ExternalUntyped: expected context to have function Set") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalUntyped: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalUntyped: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 any) error { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(any)") + impl.fn_Set = func(ctx env.RyeCtx, farg0 interface{}) error { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(interface{})") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -18901,8 +17858,9 @@ func ctxTo_binding_ExternalUntyped(ps *env.ProgramState, v env.RyeCtx) (binding. res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntyped: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalUntyped: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18910,8 +17868,9 @@ func ctxTo_binding_ExternalUntyped(ps *env.ProgramState, v env.RyeCtx) (binding. } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntyped: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalUntyped: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -18920,79 +17879,45 @@ func ctxTo_binding_ExternalUntyped(ps *env.ProgramState, v env.RyeCtx) (binding. return res } default: - return nil, errors.New("context to binding.ExternalUntyped: context fn Set: expected function") + return nil, errors.New("context to binding.ExternalUntyped: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["AddListener"] + ctxObj3, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.ExternalUntyped: expected context to have function AddListener") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalUntyped: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalUntyped: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalUntyped: context fn AddListener: expected function") + return nil, errors.New("context to binding.ExternalUntyped: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["RemoveListener"] + ctxObj4, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.ExternalUntyped: expected context to have function RemoveListener") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalUntyped: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalUntyped: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalUntyped: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.ExternalUntyped: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -19000,12 +17925,12 @@ func ctxTo_binding_ExternalUntyped(ps *env.ProgramState, v env.RyeCtx) (binding. type iface_binding_ExternalUntypedList struct { self env.RyeCtx fn_Reload func(self env.RyeCtx) error - fn_Append func(self env.RyeCtx, arg0 any) error - fn_Get func(self env.RyeCtx) ([]any, error) - fn_GetValue func(self env.RyeCtx, arg0 int) (any, error) - fn_Prepend func(self env.RyeCtx, arg0 any) error - fn_Set func(self env.RyeCtx, arg0 []any) error - fn_SetValue func(self env.RyeCtx, arg0 int, arg1 any) error + fn_Append func(self env.RyeCtx, arg0 interface{}) error + fn_Get func(self env.RyeCtx) ([]interface{}, error) + fn_GetValue func(self env.RyeCtx, arg0 int) (interface{}, error) + fn_Prepend func(self env.RyeCtx, arg0 interface{}) error + fn_Set func(self env.RyeCtx, arg0 []interface{}) error + fn_SetValue func(self env.RyeCtx, arg0 int, arg1 interface{}) error fn_GetItem func(self env.RyeCtx, arg0 int) (binding.DataItem, error) fn_Length func(self env.RyeCtx) int fn_AddListener func(self env.RyeCtx, arg0 binding.DataListener) @@ -19015,22 +17940,22 @@ type iface_binding_ExternalUntypedList struct { func (self *iface_binding_ExternalUntypedList) Reload() error { return self.fn_Reload(self.self) } -func (self *iface_binding_ExternalUntypedList) Append(arg0 any) error { +func (self *iface_binding_ExternalUntypedList) Append(arg0 interface{}) error { return self.fn_Append(self.self, arg0) } -func (self *iface_binding_ExternalUntypedList) Get() ([]any, error) { +func (self *iface_binding_ExternalUntypedList) Get() ([]interface{}, error) { return self.fn_Get(self.self) } -func (self *iface_binding_ExternalUntypedList) GetValue(arg0 int) (any, error) { +func (self *iface_binding_ExternalUntypedList) GetValue(arg0 int) (interface{}, error) { return self.fn_GetValue(self.self, arg0) } -func (self *iface_binding_ExternalUntypedList) Prepend(arg0 any) error { +func (self *iface_binding_ExternalUntypedList) Prepend(arg0 interface{}) error { return self.fn_Prepend(self.self, arg0) } -func (self *iface_binding_ExternalUntypedList) Set(arg0 []any) error { +func (self *iface_binding_ExternalUntypedList) Set(arg0 []interface{}) error { return self.fn_Set(self.self, arg0) } -func (self *iface_binding_ExternalUntypedList) SetValue(arg0 int, arg1 any) error { +func (self *iface_binding_ExternalUntypedList) SetValue(arg0 int, arg1 interface{}) error { return self.fn_SetValue(self.self, arg0, arg1) } func (self *iface_binding_ExternalUntypedList) GetItem(arg0 int) (binding.DataItem, error) { @@ -19064,14 +17989,14 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind impl := &iface_binding_ExternalUntypedList{ self: v, } - ctxObj0, ok := wordToObj["Reload"] + ctxObj0, ok := wordToObj["reload"] if !ok { return nil, errors.New("context to binding.ExternalUntypedList: expected context to have function Reload") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalUntypedList: context fn Reload: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalUntypedList: context fn Reload: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Reload = func(ctx env.RyeCtx) error { actualFn := fn @@ -19085,8 +18010,9 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19094,8 +18020,9 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19104,23 +18031,23 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind return res } default: - return nil, errors.New("context to binding.ExternalUntypedList: context fn Reload: expected function") + return nil, errors.New("context to binding.ExternalUntypedList: context fn Reload: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Append"] + ctxObj1, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.ExternalUntypedList: expected context to have function Append") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalUntypedList: context fn Append: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalUntypedList: context fn Append: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 any) error { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(any)") + impl.fn_Append = func(ctx env.RyeCtx, farg0 interface{}) error { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(interface{})") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -19129,8 +18056,9 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19138,8 +18066,9 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19148,35 +18077,37 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind return res } default: - return nil, errors.New("context to binding.ExternalUntypedList: context fn Append: expected function") + return nil, errors.New("context to binding.ExternalUntypedList: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Get"] + ctxObj2, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.ExternalUntypedList: expected context to have function Get") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalUntypedList: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalUntypedList: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Get = func(ctx env.RyeCtx) ([]any, error) { + impl.fn_Get = func(ctx env.RyeCtx) ([]interface{}, error) { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) - var res0 []any + var res0 []interface{} var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19184,44 +18115,36 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind } switch v := res.Series.S[0].(type) { case env.Block: - res0 = make([]any, len(v.Series.S)) + res0 = make([]interface{}, len(v.Series.S)) for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - res0[i], ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + res0[i] = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: block item: expected native of type any", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"block item: "+"expected native of type interface{}, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: block item: expected native", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"block item: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } } - case env.Native: - var ok bool - res0, ok = v.Value.([]any) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected native of type []any", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19229,8 +18152,9 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected block, native or nil", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19243,8 +18167,9 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19252,8 +18177,9 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19262,37 +18188,39 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind return res0, res1 } default: - return nil, errors.New("context to binding.ExternalUntypedList: context fn Get: expected function") + return nil, errors.New("context to binding.ExternalUntypedList: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["GetValue"] + ctxObj3, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.ExternalUntypedList: expected context to have function GetValue") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalUntypedList: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalUntypedList: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 int) (any, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 int) (interface{}, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) - var res0 any + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) + var res0 interface{} var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19300,19 +18228,21 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind } switch v := res.Series.S[0].(type) { case env.Native: - var ok bool - res0, ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected native of type any", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected native of type interface{}, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected native", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19325,8 +18255,9 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19334,8 +18265,9 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19344,23 +18276,23 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind return res0, res1 } default: - return nil, errors.New("context to binding.ExternalUntypedList: context fn GetValue: expected function") + return nil, errors.New("context to binding.ExternalUntypedList: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Prepend"] + ctxObj4, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.ExternalUntypedList: expected context to have function Prepend") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalUntypedList: context fn Prepend: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalUntypedList: context fn Prepend: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 any) error { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(any)") + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 interface{}) error { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(interface{})") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -19369,8 +18301,9 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19378,8 +18311,9 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19388,29 +18322,29 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind return res } default: - return nil, errors.New("context to binding.ExternalUntypedList: context fn Prepend: expected function") + return nil, errors.New("context to binding.ExternalUntypedList: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["Set"] + ctxObj5, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.ExternalUntypedList: expected context to have function Set") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalUntypedList: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalUntypedList: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 []any) error { - var arg0Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 []interface{}) error { + var farg0Val env.Object { - items := make([]env.Object, len(arg0)) - for i, it := range arg0 { - items[i] = *env.NewNative(ps.Idx, it, "Go(any)") + items := make([]env.Object, len(farg0)) + for i, it := range farg0 { + items[i] = *env.NewNative(ps.Idx, it, "Go(interface{})") } - arg0Val = *env.NewBlock(*env.NewTSeries(items)) + farg0Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -19419,8 +18353,9 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19428,8 +18363,9 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19438,24 +18374,24 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind return res } default: - return nil, errors.New("context to binding.ExternalUntypedList: context fn Set: expected function") + return nil, errors.New("context to binding.ExternalUntypedList: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["SetValue"] + ctxObj6, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.ExternalUntypedList: expected context to have function SetValue") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.ExternalUntypedList: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.ExternalUntypedList: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 int, arg1 any) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) - arg1Val = *env.NewNative(ps.Idx, arg1, "Go(any)") + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 int, farg1 interface{}) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) + farg1Val = *env.NewNative(ps.Idx, farg1, "Go(interface{})") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -19464,8 +18400,9 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19473,8 +18410,9 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19483,37 +18421,39 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind return res } default: - return nil, errors.New("context to binding.ExternalUntypedList: context fn SetValue: expected function") + return nil, errors.New("context to binding.ExternalUntypedList: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["GetItem"] + ctxObj7, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.ExternalUntypedList: expected context to have function GetItem") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalUntypedList: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalUntypedList: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 int) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 int) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19524,19 +18464,21 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: "+err.Error()+"", + "context to binding.ExternalUntypedList: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19544,8 +18486,9 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19553,8 +18496,9 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected native", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19567,8 +18511,9 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19576,8 +18521,9 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19586,27 +18532,28 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind return res0, res1 } default: - return nil, errors.New("context to binding.ExternalUntypedList: context fn GetItem: expected function") + return nil, errors.New("context to binding.ExternalUntypedList: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["Length"] + ctxObj8, ok := wordToObj["length"] if !ok { return nil, errors.New("context to binding.ExternalUntypedList: expected context to have function Length") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalUntypedList: context fn Length: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalUntypedList: context fn Length: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Length = func(ctx env.RyeCtx) int { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res int - if v, ok := ps.Res.(env.Integer); ok { - res = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + res = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedList: arg 0: callback result: expected integer", + "context to binding.ExternalUntypedList: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19615,79 +18562,45 @@ func ctxTo_binding_ExternalUntypedList(ps *env.ProgramState, v env.RyeCtx) (bind return res } default: - return nil, errors.New("context to binding.ExternalUntypedList: context fn Length: expected function") + return nil, errors.New("context to binding.ExternalUntypedList: context fn Length: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["AddListener"] + ctxObj9, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.ExternalUntypedList: expected context to have function AddListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalUntypedList: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalUntypedList: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalUntypedList: context fn AddListener: expected function") + return nil, errors.New("context to binding.ExternalUntypedList: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj10, ok := wordToObj["RemoveListener"] + ctxObj10, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.ExternalUntypedList: expected context to have function RemoveListener") } switch fn := ctxObj10.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalUntypedList: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalUntypedList: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalUntypedList: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.ExternalUntypedList: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -19696,10 +18609,10 @@ type iface_binding_ExternalUntypedMap struct { self env.RyeCtx fn_Reload func(self env.RyeCtx) error fn_Delete func(self env.RyeCtx, arg0 string) - fn_Get func(self env.RyeCtx) (map[string]any, error) - fn_GetValue func(self env.RyeCtx, arg0 string) (any, error) - fn_Set func(self env.RyeCtx, arg0 map[string]any) error - fn_SetValue func(self env.RyeCtx, arg0 string, arg1 any) error + fn_Get func(self env.RyeCtx) (map[string]interface{}, error) + fn_GetValue func(self env.RyeCtx, arg0 string) (interface{}, error) + fn_Set func(self env.RyeCtx, arg0 map[string]interface{}) error + fn_SetValue func(self env.RyeCtx, arg0 string, arg1 interface{}) error fn_GetItem func(self env.RyeCtx, arg0 string) (binding.DataItem, error) fn_Keys func(self env.RyeCtx) []string fn_AddListener func(self env.RyeCtx, arg0 binding.DataListener) @@ -19712,16 +18625,16 @@ func (self *iface_binding_ExternalUntypedMap) Reload() error { func (self *iface_binding_ExternalUntypedMap) Delete(arg0 string) { self.fn_Delete(self.self, arg0) } -func (self *iface_binding_ExternalUntypedMap) Get() (map[string]any, error) { +func (self *iface_binding_ExternalUntypedMap) Get() (map[string]interface{}, error) { return self.fn_Get(self.self) } -func (self *iface_binding_ExternalUntypedMap) GetValue(arg0 string) (any, error) { +func (self *iface_binding_ExternalUntypedMap) GetValue(arg0 string) (interface{}, error) { return self.fn_GetValue(self.self, arg0) } -func (self *iface_binding_ExternalUntypedMap) Set(arg0 map[string]any) error { +func (self *iface_binding_ExternalUntypedMap) Set(arg0 map[string]interface{}) error { return self.fn_Set(self.self, arg0) } -func (self *iface_binding_ExternalUntypedMap) SetValue(arg0 string, arg1 any) error { +func (self *iface_binding_ExternalUntypedMap) SetValue(arg0 string, arg1 interface{}) error { return self.fn_SetValue(self.self, arg0, arg1) } func (self *iface_binding_ExternalUntypedMap) GetItem(arg0 string) (binding.DataItem, error) { @@ -19755,14 +18668,14 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi impl := &iface_binding_ExternalUntypedMap{ self: v, } - ctxObj0, ok := wordToObj["Reload"] + ctxObj0, ok := wordToObj["reload"] if !ok { return nil, errors.New("context to binding.ExternalUntypedMap: expected context to have function Reload") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalUntypedMap: context fn Reload: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalUntypedMap: context fn Reload: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Reload = func(ctx env.RyeCtx) error { actualFn := fn @@ -19776,8 +18689,9 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19785,8 +18699,9 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19795,54 +18710,56 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi return res } default: - return nil, errors.New("context to binding.ExternalUntypedMap: context fn Reload: expected function") + return nil, errors.New("context to binding.ExternalUntypedMap: context fn Reload: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Delete"] + ctxObj1, ok := wordToObj["delete"] if !ok { return nil, errors.New("context to binding.ExternalUntypedMap: expected context to have function Delete") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalUntypedMap: context fn Delete: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalUntypedMap: context fn Delete: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Delete = func(ctx env.RyeCtx, arg0 string) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_Delete = func(ctx env.RyeCtx, farg0 string) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalUntypedMap: context fn Delete: expected function") + return nil, errors.New("context to binding.ExternalUntypedMap: context fn Delete: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Get"] + ctxObj2, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.ExternalUntypedMap: expected context to have function Get") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalUntypedMap: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalUntypedMap: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Get = func(ctx env.RyeCtx) (map[string]any, error) { + impl.fn_Get = func(ctx env.RyeCtx) (map[string]interface{}, error) { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) - var res0 map[string]any + var res0 map[string]interface{} var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19851,42 +18768,46 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi switch v := res.Series.S[0].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - res0 = make(map[string]any, len(v.Series.S)/2) + res0 = make(map[string]interface{}, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: map key: expected string", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - var mapV any + var mapV interface{} switch v := v.Series.S[i+1].(type) { case env.Native: - var ok bool - mapV, ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + mapV = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: map value: expected native of type any", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"map value: "+"expected native of type interface{}, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: map value: expected native", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"map value: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19895,25 +18816,27 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi res0[mapK] = mapV } case env.Dict: - res0 = make(map[string]any, len(v.Data)) + res0 = make(map[string]interface{}, len(v.Data)) for dictK, dictV := range v.Data { mapK := dictK - var mapV any + var mapV interface{} switch v := dictV.(type) { case env.Native: - var ok bool - mapV, ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + mapV = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: map value: expected native of type any", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"map value: "+"expected native of type interface{}, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: map value: expected native", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"map value: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19921,21 +18844,11 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi } res0[mapK] = mapV } - case env.Native: - var ok bool - res0, ok = v.Value.(map[string]any) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected native of type map[string]any", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19943,8 +18856,9 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected native, block, dict or nil", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19957,8 +18871,9 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19966,8 +18881,9 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -19976,37 +18892,39 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi return res0, res1 } default: - return nil, errors.New("context to binding.ExternalUntypedMap: context fn Get: expected function") + return nil, errors.New("context to binding.ExternalUntypedMap: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["GetValue"] + ctxObj3, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.ExternalUntypedMap: expected context to have function GetValue") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalUntypedMap: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalUntypedMap: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 string) (any, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 string) (interface{}, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) - var res0 any + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) + var res0 interface{} var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20014,19 +18932,21 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi } switch v := res.Series.S[0].(type) { case env.Native: - var ok bool - res0, ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected native of type any", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"expected native of type interface{}, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected native", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20039,8 +18959,9 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20048,8 +18969,9 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20058,31 +18980,31 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi return res0, res1 } default: - return nil, errors.New("context to binding.ExternalUntypedMap: context fn GetValue: expected function") + return nil, errors.New("context to binding.ExternalUntypedMap: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Set"] + ctxObj4, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.ExternalUntypedMap: expected context to have function Set") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalUntypedMap: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalUntypedMap: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 map[string]any) error { - var arg0Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 map[string]interface{}) error { + var farg0Val env.Object { - data := make(map[string]any, len(arg0)) - for mKey, mVal := range arg0 { + data := make(map[string]any, len(farg0)) + for mKey, mVal := range farg0 { var dVal env.Object - dVal = *env.NewNative(ps.Idx, mVal, "Go(any)") + dVal = *env.NewNative(ps.Idx, mVal, "Go(interface{})") data[mKey] = dVal } - arg0Val = *env.NewDict(data) + farg0Val = *env.NewDict(data) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -20091,8 +19013,9 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20100,8 +19023,9 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20110,24 +19034,24 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi return res } default: - return nil, errors.New("context to binding.ExternalUntypedMap: context fn Set: expected function") + return nil, errors.New("context to binding.ExternalUntypedMap: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["SetValue"] + ctxObj5, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.ExternalUntypedMap: expected context to have function SetValue") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.ExternalUntypedMap: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.ExternalUntypedMap: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 string, arg1 any) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewNative(ps.Idx, arg1, "Go(any)") + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 string, farg1 interface{}) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewNative(ps.Idx, farg1, "Go(interface{})") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -20136,8 +19060,9 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20145,8 +19070,9 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20155,37 +19081,39 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi return res } default: - return nil, errors.New("context to binding.ExternalUntypedMap: context fn SetValue: expected function") + return nil, errors.New("context to binding.ExternalUntypedMap: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["GetItem"] + ctxObj6, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.ExternalUntypedMap: expected context to have function GetItem") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalUntypedMap: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalUntypedMap: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 string) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 string) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected block for multiple return values", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected block with 2 return values", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20196,19 +19124,21 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: "+err.Error()+"", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20216,8 +19146,9 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20225,8 +19156,9 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected native", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20239,8 +19171,9 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20248,8 +19181,9 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected error, string or nil", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20258,16 +19192,16 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi return res0, res1 } default: - return nil, errors.New("context to binding.ExternalUntypedMap: context fn GetItem: expected function") + return nil, errors.New("context to binding.ExternalUntypedMap: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["Keys"] + ctxObj7, ok := wordToObj["keys"] if !ok { return nil, errors.New("context to binding.ExternalUntypedMap: expected context to have function Keys") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.ExternalUntypedMap: context fn Keys: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.ExternalUntypedMap: context fn Keys: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Keys = func(ctx env.RyeCtx) []string { actualFn := fn @@ -20278,32 +19212,23 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi case env.Block: res = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - res[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + res[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: block item: expected string", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20311,8 +19236,9 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.ExternalUntypedMap: arg 0: callback result: expected block, native or nil", + "context to binding.ExternalUntypedMap: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20321,79 +19247,45 @@ func ctxTo_binding_ExternalUntypedMap(ps *env.ProgramState, v env.RyeCtx) (bindi return res } default: - return nil, errors.New("context to binding.ExternalUntypedMap: context fn Keys: expected function") + return nil, errors.New("context to binding.ExternalUntypedMap: context fn Keys: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["AddListener"] + ctxObj8, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.ExternalUntypedMap: expected context to have function AddListener") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalUntypedMap: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalUntypedMap: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalUntypedMap: context fn AddListener: expected function") + return nil, errors.New("context to binding.ExternalUntypedMap: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["RemoveListener"] + ctxObj9, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.ExternalUntypedMap: expected context to have function RemoveListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.ExternalUntypedMap: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.ExternalUntypedMap: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.ExternalUntypedMap: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.ExternalUntypedMap: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -20437,14 +19329,14 @@ func ctxTo_binding_Float(ps *env.ProgramState, v env.RyeCtx) (binding.Float, err impl := &iface_binding_Float{ self: v, } - ctxObj0, ok := wordToObj["Get"] + ctxObj0, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.Float: expected context to have function Get") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.Float: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.Float: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) (float64, error) { actualFn := fn @@ -20454,26 +19346,29 @@ func ctxTo_binding_Float(ps *env.ProgramState, v env.RyeCtx) (binding.Float, err var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Float: arg 0: callback result: expected block for multiple return values", + "context to binding.Float: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Float: arg 0: callback result: expected block with 2 return values", + "context to binding.Float: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Decimal); ok { - res0 = float64(v.Value) + if vc, ok := res.Series.S[0].(env.Decimal); ok { + res0 = float64(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Float: arg 0: callback result: expected decimal", + "context to binding.Float: arg 0: callback result: "+"expected decimal, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20486,8 +19381,9 @@ func ctxTo_binding_Float(ps *env.ProgramState, v env.RyeCtx) (binding.Float, err res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Float: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.Float: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20495,8 +19391,9 @@ func ctxTo_binding_Float(ps *env.ProgramState, v env.RyeCtx) (binding.Float, err } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Float: arg 0: callback result: expected error, string or nil", + "context to binding.Float: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20505,23 +19402,23 @@ func ctxTo_binding_Float(ps *env.ProgramState, v env.RyeCtx) (binding.Float, err return res0, res1 } default: - return nil, errors.New("context to binding.Float: context fn Get: expected function") + return nil, errors.New("context to binding.Float: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Set"] + ctxObj1, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.Float: expected context to have function Set") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.Float: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.Float: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 float64) error { - var arg0Val env.Object - arg0Val = *env.NewDecimal(float64(arg0)) + impl.fn_Set = func(ctx env.RyeCtx, farg0 float64) error { + var farg0Val env.Object + farg0Val = *env.NewDecimal(float64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -20530,8 +19427,9 @@ func ctxTo_binding_Float(ps *env.ProgramState, v env.RyeCtx) (binding.Float, err res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Float: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.Float: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20539,8 +19437,9 @@ func ctxTo_binding_Float(ps *env.ProgramState, v env.RyeCtx) (binding.Float, err } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Float: arg 0: callback result: expected error, string or nil", + "context to binding.Float: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20549,79 +19448,45 @@ func ctxTo_binding_Float(ps *env.ProgramState, v env.RyeCtx) (binding.Float, err return res } default: - return nil, errors.New("context to binding.Float: context fn Set: expected function") + return nil, errors.New("context to binding.Float: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["AddListener"] + ctxObj2, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.Float: expected context to have function AddListener") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.Float: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.Float: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.Float: context fn AddListener: expected function") + return nil, errors.New("context to binding.Float: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["RemoveListener"] + ctxObj3, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.Float: expected context to have function RemoveListener") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.Float: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.Float: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.Float: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.Float: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -20689,21 +19554,21 @@ func ctxTo_binding_FloatList(ps *env.ProgramState, v env.RyeCtx) (binding.FloatL impl := &iface_binding_FloatList{ self: v, } - ctxObj0, ok := wordToObj["Append"] + ctxObj0, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.FloatList: expected context to have function Append") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.FloatList: context fn Append: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.FloatList: context fn Append: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 float64) error { - var arg0Val env.Object - arg0Val = *env.NewDecimal(float64(arg0)) + impl.fn_Append = func(ctx env.RyeCtx, farg0 float64) error { + var farg0Val env.Object + farg0Val = *env.NewDecimal(float64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -20712,8 +19577,9 @@ func ctxTo_binding_FloatList(ps *env.ProgramState, v env.RyeCtx) (binding.FloatL res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.FloatList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20721,8 +19587,9 @@ func ctxTo_binding_FloatList(ps *env.ProgramState, v env.RyeCtx) (binding.FloatL } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: expected error, string or nil", + "context to binding.FloatList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20731,16 +19598,16 @@ func ctxTo_binding_FloatList(ps *env.ProgramState, v env.RyeCtx) (binding.FloatL return res } default: - return nil, errors.New("context to binding.FloatList: context fn Append: expected function") + return nil, errors.New("context to binding.FloatList: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Get"] + ctxObj1, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.FloatList: expected context to have function Get") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.FloatList: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.FloatList: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) ([]float64, error) { actualFn := fn @@ -20750,16 +19617,18 @@ func ctxTo_binding_FloatList(ps *env.ProgramState, v env.RyeCtx) (binding.FloatL var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: expected block for multiple return values", + "context to binding.FloatList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: expected block with 2 return values", + "context to binding.FloatList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20769,32 +19638,23 @@ func ctxTo_binding_FloatList(ps *env.ProgramState, v env.RyeCtx) (binding.FloatL case env.Block: res0 = make([]float64, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.Decimal); ok { - res0[i] = float64(v.Value) + if vc, ok := it.(env.Decimal); ok { + res0[i] = float64(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: block item: expected decimal", + "context to binding.FloatList: arg 0: callback result: "+"block item: "+"expected decimal, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } } - case env.Native: - var ok bool - res0, ok = v.Value.([]float64) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: expected native of type []float64", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.FloatList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20802,8 +19662,9 @@ func ctxTo_binding_FloatList(ps *env.ProgramState, v env.RyeCtx) (binding.FloatL } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: expected block, native or nil", + "context to binding.FloatList: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20816,8 +19677,9 @@ func ctxTo_binding_FloatList(ps *env.ProgramState, v env.RyeCtx) (binding.FloatL res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.FloatList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20825,8 +19687,9 @@ func ctxTo_binding_FloatList(ps *env.ProgramState, v env.RyeCtx) (binding.FloatL } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: expected error, string or nil", + "context to binding.FloatList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20835,47 +19698,50 @@ func ctxTo_binding_FloatList(ps *env.ProgramState, v env.RyeCtx) (binding.FloatL return res0, res1 } default: - return nil, errors.New("context to binding.FloatList: context fn Get: expected function") + return nil, errors.New("context to binding.FloatList: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["GetValue"] + ctxObj2, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.FloatList: expected context to have function GetValue") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.FloatList: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.FloatList: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 int) (float64, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 int) (float64, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 float64 var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: expected block for multiple return values", + "context to binding.FloatList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: expected block with 2 return values", + "context to binding.FloatList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Decimal); ok { - res0 = float64(v.Value) + if vc, ok := res.Series.S[0].(env.Decimal); ok { + res0 = float64(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: expected decimal", + "context to binding.FloatList: arg 0: callback result: "+"expected decimal, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20888,8 +19754,9 @@ func ctxTo_binding_FloatList(ps *env.ProgramState, v env.RyeCtx) (binding.FloatL res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.FloatList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20897,8 +19764,9 @@ func ctxTo_binding_FloatList(ps *env.ProgramState, v env.RyeCtx) (binding.FloatL } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: expected error, string or nil", + "context to binding.FloatList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20907,23 +19775,23 @@ func ctxTo_binding_FloatList(ps *env.ProgramState, v env.RyeCtx) (binding.FloatL return res0, res1 } default: - return nil, errors.New("context to binding.FloatList: context fn GetValue: expected function") + return nil, errors.New("context to binding.FloatList: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Prepend"] + ctxObj3, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.FloatList: expected context to have function Prepend") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.FloatList: context fn Prepend: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.FloatList: context fn Prepend: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 float64) error { - var arg0Val env.Object - arg0Val = *env.NewDecimal(float64(arg0)) + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 float64) error { + var farg0Val env.Object + farg0Val = *env.NewDecimal(float64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -20932,8 +19800,9 @@ func ctxTo_binding_FloatList(ps *env.ProgramState, v env.RyeCtx) (binding.FloatL res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.FloatList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20941,8 +19810,9 @@ func ctxTo_binding_FloatList(ps *env.ProgramState, v env.RyeCtx) (binding.FloatL } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: expected error, string or nil", + "context to binding.FloatList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20951,29 +19821,29 @@ func ctxTo_binding_FloatList(ps *env.ProgramState, v env.RyeCtx) (binding.FloatL return res } default: - return nil, errors.New("context to binding.FloatList: context fn Prepend: expected function") + return nil, errors.New("context to binding.FloatList: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Set"] + ctxObj4, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.FloatList: expected context to have function Set") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.FloatList: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.FloatList: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 []float64) error { - var arg0Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 []float64) error { + var farg0Val env.Object { - items := make([]env.Object, len(arg0)) - for i, it := range arg0 { + items := make([]env.Object, len(farg0)) + for i, it := range farg0 { items[i] = *env.NewDecimal(float64(it)) } - arg0Val = *env.NewBlock(*env.NewTSeries(items)) + farg0Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -20982,8 +19852,9 @@ func ctxTo_binding_FloatList(ps *env.ProgramState, v env.RyeCtx) (binding.FloatL res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.FloatList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -20991,8 +19862,9 @@ func ctxTo_binding_FloatList(ps *env.ProgramState, v env.RyeCtx) (binding.FloatL } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: expected error, string or nil", + "context to binding.FloatList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21001,24 +19873,24 @@ func ctxTo_binding_FloatList(ps *env.ProgramState, v env.RyeCtx) (binding.FloatL return res } default: - return nil, errors.New("context to binding.FloatList: context fn Set: expected function") + return nil, errors.New("context to binding.FloatList: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["SetValue"] + ctxObj5, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.FloatList: expected context to have function SetValue") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.FloatList: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.FloatList: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 int, arg1 float64) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) - arg1Val = *env.NewDecimal(float64(arg1)) + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 int, farg1 float64) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) + farg1Val = *env.NewDecimal(float64(farg1)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -21027,8 +19899,9 @@ func ctxTo_binding_FloatList(ps *env.ProgramState, v env.RyeCtx) (binding.FloatL res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.FloatList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21036,8 +19909,9 @@ func ctxTo_binding_FloatList(ps *env.ProgramState, v env.RyeCtx) (binding.FloatL } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: expected error, string or nil", + "context to binding.FloatList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21046,37 +19920,39 @@ func ctxTo_binding_FloatList(ps *env.ProgramState, v env.RyeCtx) (binding.FloatL return res } default: - return nil, errors.New("context to binding.FloatList: context fn SetValue: expected function") + return nil, errors.New("context to binding.FloatList: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["GetItem"] + ctxObj6, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.FloatList: expected context to have function GetItem") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.FloatList: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.FloatList: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 int) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 int) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: expected block for multiple return values", + "context to binding.FloatList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: expected block with 2 return values", + "context to binding.FloatList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21087,19 +19963,21 @@ func ctxTo_binding_FloatList(ps *env.ProgramState, v env.RyeCtx) (binding.FloatL var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: "+err.Error()+"", + "context to binding.FloatList: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.FloatList: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21107,8 +19985,9 @@ func ctxTo_binding_FloatList(ps *env.ProgramState, v env.RyeCtx) (binding.FloatL } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.FloatList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21116,8 +19995,9 @@ func ctxTo_binding_FloatList(ps *env.ProgramState, v env.RyeCtx) (binding.FloatL } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: expected native", + "context to binding.FloatList: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21130,8 +20010,9 @@ func ctxTo_binding_FloatList(ps *env.ProgramState, v env.RyeCtx) (binding.FloatL res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.FloatList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21139,8 +20020,9 @@ func ctxTo_binding_FloatList(ps *env.ProgramState, v env.RyeCtx) (binding.FloatL } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: expected error, string or nil", + "context to binding.FloatList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21149,27 +20031,28 @@ func ctxTo_binding_FloatList(ps *env.ProgramState, v env.RyeCtx) (binding.FloatL return res0, res1 } default: - return nil, errors.New("context to binding.FloatList: context fn GetItem: expected function") + return nil, errors.New("context to binding.FloatList: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["Length"] + ctxObj7, ok := wordToObj["length"] if !ok { return nil, errors.New("context to binding.FloatList: expected context to have function Length") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.FloatList: context fn Length: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.FloatList: context fn Length: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Length = func(ctx env.RyeCtx) int { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res int - if v, ok := ps.Res.(env.Integer); ok { - res = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + res = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatList: arg 0: callback result: expected integer", + "context to binding.FloatList: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21178,79 +20061,45 @@ func ctxTo_binding_FloatList(ps *env.ProgramState, v env.RyeCtx) (binding.FloatL return res } default: - return nil, errors.New("context to binding.FloatList: context fn Length: expected function") + return nil, errors.New("context to binding.FloatList: context fn Length: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["AddListener"] + ctxObj8, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.FloatList: expected context to have function AddListener") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.FloatList: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.FloatList: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.FloatList: context fn AddListener: expected function") + return nil, errors.New("context to binding.FloatList: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["RemoveListener"] + ctxObj9, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.FloatList: expected context to have function RemoveListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.FloatList: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.FloatList: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.FloatList: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.FloatList: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -21318,23 +20167,23 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT impl := &iface_binding_FloatTree{ self: v, } - ctxObj0, ok := wordToObj["Append"] + ctxObj0, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.FloatTree: expected context to have function Append") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 3 { - return nil, errors.New("context to binding.FloatTree: context fn Append: function has invalid number of arguments (expected 3)") + return nil, errors.New("context to binding.FloatTree: context fn Append: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 string, arg1 string, arg2 float64) error { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) - arg2Val = *env.NewDecimal(float64(arg2)) + impl.fn_Append = func(ctx env.RyeCtx, farg0 string, farg1 string, farg2 float64) error { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) + farg2Val = *env.NewDecimal(float64(farg2)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val, farg2Val) var res error switch v := ps.Res.(type) { case env.String: @@ -21343,8 +20192,9 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.FloatTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21352,8 +20202,9 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected error, string or nil", + "context to binding.FloatTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21362,16 +20213,16 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT return res } default: - return nil, errors.New("context to binding.FloatTree: context fn Append: expected function") + return nil, errors.New("context to binding.FloatTree: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Get"] + ctxObj1, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.FloatTree: expected context to have function Get") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.FloatTree: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.FloatTree: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) (map[string][]string, map[string]float64, error) { actualFn := fn @@ -21382,16 +20233,18 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT var res2 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected block for multiple return values", + "context to binding.FloatTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } if len(res.Series.S) != 3 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected block with 3 return values", + "context to binding.FloatTree: arg 0: callback result: "+"expected block with 3 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21400,8 +20253,9 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT switch v := res.Series.S[0].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.FloatTree: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21410,11 +20264,12 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT res0 = make(map[string][]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: map key: expected string", + "context to binding.FloatTree: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21425,32 +20280,23 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: map value: block item: expected string", + "context to binding.FloatTree: arg 0: callback result: "+"map value: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: map value: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.FloatTree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21458,8 +20304,9 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.FloatTree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21476,32 +20323,23 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: map value: block item: expected string", + "context to binding.FloatTree: arg 0: callback result: "+"map value: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: map value: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.FloatTree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21509,8 +20347,9 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.FloatTree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21518,21 +20357,11 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT } res0[mapK] = mapV } - case env.Native: - var ok bool - res0, ok = v.Value.(map[string][]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected native of type map[string][]string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.FloatTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21540,8 +20369,9 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected native, block, dict or nil", + "context to binding.FloatTree: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21550,8 +20380,9 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT switch v := res.Series.S[1].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.FloatTree: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21560,22 +20391,24 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT res1 = make(map[string]float64, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: map key: expected string", + "context to binding.FloatTree: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } var mapV float64 - if v, ok := v.Series.S[i+1].(env.Decimal); ok { - mapV = float64(v.Value) + if vc, ok := v.Series.S[i+1].(env.Decimal); ok { + mapV = float64(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: map value: expected decimal", + "context to binding.FloatTree: arg 0: callback result: "+"map value: "+"expected decimal, but got "+objectDebugString(ps.Idx, v.Series.S[i+1]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21588,11 +20421,12 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT for dictK, dictV := range v.Data { mapK := dictK var mapV float64 - if v, ok := dictV.(env.Decimal); ok { - mapV = float64(v.Value) + if vc, ok := dictV.(env.Decimal); ok { + mapV = float64(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: map value: expected decimal", + "context to binding.FloatTree: arg 0: callback result: "+"map value: "+"expected decimal, but got "+objectDebugString(ps.Idx, dictV), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21600,21 +20434,11 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT } res1[mapK] = mapV } - case env.Native: - var ok bool - res1, ok = v.Value.(map[string]float64) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected native of type map[string]float64", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.FloatTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21622,8 +20446,9 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected native, block, dict or nil", + "context to binding.FloatTree: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21636,8 +20461,9 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT res2 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.FloatTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21645,8 +20471,9 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT } res2 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected error, string or nil", + "context to binding.FloatTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21655,47 +20482,50 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT return res0, res1, res2 } default: - return nil, errors.New("context to binding.FloatTree: context fn Get: expected function") + return nil, errors.New("context to binding.FloatTree: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["GetValue"] + ctxObj2, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.FloatTree: expected context to have function GetValue") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.FloatTree: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.FloatTree: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 string) (float64, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 string) (float64, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 float64 var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected block for multiple return values", + "context to binding.FloatTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected block with 2 return values", + "context to binding.FloatTree: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Decimal); ok { - res0 = float64(v.Value) + if vc, ok := res.Series.S[0].(env.Decimal); ok { + res0 = float64(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected decimal", + "context to binding.FloatTree: arg 0: callback result: "+"expected decimal, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21708,8 +20538,9 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.FloatTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21717,8 +20548,9 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected error, string or nil", + "context to binding.FloatTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21727,25 +20559,25 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT return res0, res1 } default: - return nil, errors.New("context to binding.FloatTree: context fn GetValue: expected function") + return nil, errors.New("context to binding.FloatTree: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Prepend"] + ctxObj3, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.FloatTree: expected context to have function Prepend") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 3 { - return nil, errors.New("context to binding.FloatTree: context fn Prepend: function has invalid number of arguments (expected 3)") + return nil, errors.New("context to binding.FloatTree: context fn Prepend: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 string, arg1 string, arg2 float64) error { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) - arg2Val = *env.NewDecimal(float64(arg2)) + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 string, farg1 string, farg2 float64) error { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) + farg2Val = *env.NewDecimal(float64(farg2)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val, farg2Val) var res error switch v := ps.Res.(type) { case env.String: @@ -21754,8 +20586,9 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.FloatTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21763,8 +20596,9 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected error, string or nil", + "context to binding.FloatTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21773,22 +20607,22 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT return res } default: - return nil, errors.New("context to binding.FloatTree: context fn Prepend: expected function") + return nil, errors.New("context to binding.FloatTree: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Set"] + ctxObj4, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.FloatTree: expected context to have function Set") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.FloatTree: context fn Set: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.FloatTree: context fn Set: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 map[string][]string, arg1 map[string]float64) error { - var arg0Val, arg1Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 map[string][]string, farg1 map[string]float64) error { + var farg0Val, farg1Val env.Object { - data := make(map[string]any, len(arg0)) - for mKey, mVal := range arg0 { + data := make(map[string]any, len(farg0)) + for mKey, mVal := range farg0 { var dVal env.Object { items := make([]env.Object, len(mVal)) @@ -21799,20 +20633,20 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT } data[mKey] = dVal } - arg0Val = *env.NewDict(data) + farg0Val = *env.NewDict(data) } { - data := make(map[string]any, len(arg1)) - for mKey, mVal := range arg1 { + data := make(map[string]any, len(farg1)) + for mKey, mVal := range farg1 { var dVal env.Object dVal = *env.NewDecimal(float64(mVal)) data[mKey] = dVal } - arg1Val = *env.NewDict(data) + farg1Val = *env.NewDict(data) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -21821,8 +20655,9 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.FloatTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21830,8 +20665,9 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected error, string or nil", + "context to binding.FloatTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21840,24 +20676,24 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT return res } default: - return nil, errors.New("context to binding.FloatTree: context fn Set: expected function") + return nil, errors.New("context to binding.FloatTree: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["SetValue"] + ctxObj5, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.FloatTree: expected context to have function SetValue") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.FloatTree: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.FloatTree: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 string, arg1 float64) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewDecimal(float64(arg1)) + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 string, farg1 float64) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewDecimal(float64(farg1)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -21866,8 +20702,9 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.FloatTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21875,8 +20712,9 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected error, string or nil", + "context to binding.FloatTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21885,37 +20723,39 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT return res } default: - return nil, errors.New("context to binding.FloatTree: context fn SetValue: expected function") + return nil, errors.New("context to binding.FloatTree: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["GetItem"] + ctxObj6, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.FloatTree: expected context to have function GetItem") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.FloatTree: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.FloatTree: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 string) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 string) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected block for multiple return values", + "context to binding.FloatTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected block with 2 return values", + "context to binding.FloatTree: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21926,19 +20766,21 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: "+err.Error()+"", + "context to binding.FloatTree: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.FloatTree: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21946,8 +20788,9 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.FloatTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21955,8 +20798,9 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected native", + "context to binding.FloatTree: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21969,8 +20813,9 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.FloatTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21978,8 +20823,9 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected error, string or nil", + "context to binding.FloatTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -21988,54 +20834,45 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT return res0, res1 } default: - return nil, errors.New("context to binding.FloatTree: context fn GetItem: expected function") + return nil, errors.New("context to binding.FloatTree: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["ChildIDs"] + ctxObj7, ok := wordToObj["child-i-ds"] if !ok { return nil, errors.New("context to binding.FloatTree: expected context to have function ChildIDs") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.FloatTree: context fn ChildIDs: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.FloatTree: context fn ChildIDs: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_ChildIDs = func(ctx env.RyeCtx, arg0 string) []string { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_ChildIDs = func(ctx env.RyeCtx, farg0 string) []string { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res []string switch v := ps.Res.(type) { case env.Block: res = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - res[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + res[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: block item: expected string", + "context to binding.FloatTree: arg 0: callback result: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.FloatTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22043,8 +20880,9 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.FloatTree: arg 0: callback result: expected block, native or nil", + "context to binding.FloatTree: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22053,79 +20891,45 @@ func ctxTo_binding_FloatTree(ps *env.ProgramState, v env.RyeCtx) (binding.FloatT return res } default: - return nil, errors.New("context to binding.FloatTree: context fn ChildIDs: expected function") + return nil, errors.New("context to binding.FloatTree: context fn ChildIDs: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["AddListener"] + ctxObj8, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.FloatTree: expected context to have function AddListener") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.FloatTree: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.FloatTree: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.FloatTree: context fn AddListener: expected function") + return nil, errors.New("context to binding.FloatTree: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["RemoveListener"] + ctxObj9, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.FloatTree: expected context to have function RemoveListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.FloatTree: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.FloatTree: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.FloatTree: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.FloatTree: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -22169,14 +20973,14 @@ func ctxTo_binding_Int(ps *env.ProgramState, v env.RyeCtx) (binding.Int, error) impl := &iface_binding_Int{ self: v, } - ctxObj0, ok := wordToObj["Get"] + ctxObj0, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.Int: expected context to have function Get") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.Int: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.Int: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) (int, error) { actualFn := fn @@ -22186,26 +20990,29 @@ func ctxTo_binding_Int(ps *env.ProgramState, v env.RyeCtx) (binding.Int, error) var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Int: arg 0: callback result: expected block for multiple return values", + "context to binding.Int: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Int: arg 0: callback result: expected block with 2 return values", + "context to binding.Int: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = int(v.Value) + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Int: arg 0: callback result: expected integer", + "context to binding.Int: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22218,8 +21025,9 @@ func ctxTo_binding_Int(ps *env.ProgramState, v env.RyeCtx) (binding.Int, error) res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Int: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.Int: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22227,8 +21035,9 @@ func ctxTo_binding_Int(ps *env.ProgramState, v env.RyeCtx) (binding.Int, error) } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Int: arg 0: callback result: expected error, string or nil", + "context to binding.Int: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22237,23 +21046,23 @@ func ctxTo_binding_Int(ps *env.ProgramState, v env.RyeCtx) (binding.Int, error) return res0, res1 } default: - return nil, errors.New("context to binding.Int: context fn Get: expected function") + return nil, errors.New("context to binding.Int: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Set"] + ctxObj1, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.Int: expected context to have function Set") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.Int: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.Int: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 int) error { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_Set = func(ctx env.RyeCtx, farg0 int) error { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -22262,8 +21071,9 @@ func ctxTo_binding_Int(ps *env.ProgramState, v env.RyeCtx) (binding.Int, error) res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Int: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.Int: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22271,8 +21081,9 @@ func ctxTo_binding_Int(ps *env.ProgramState, v env.RyeCtx) (binding.Int, error) } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Int: arg 0: callback result: expected error, string or nil", + "context to binding.Int: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22281,79 +21092,45 @@ func ctxTo_binding_Int(ps *env.ProgramState, v env.RyeCtx) (binding.Int, error) return res } default: - return nil, errors.New("context to binding.Int: context fn Set: expected function") + return nil, errors.New("context to binding.Int: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["AddListener"] + ctxObj2, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.Int: expected context to have function AddListener") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.Int: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.Int: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.Int: context fn AddListener: expected function") + return nil, errors.New("context to binding.Int: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["RemoveListener"] + ctxObj3, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.Int: expected context to have function RemoveListener") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.Int: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.Int: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.Int: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.Int: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -22421,21 +21198,21 @@ func ctxTo_binding_IntList(ps *env.ProgramState, v env.RyeCtx) (binding.IntList, impl := &iface_binding_IntList{ self: v, } - ctxObj0, ok := wordToObj["Append"] + ctxObj0, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.IntList: expected context to have function Append") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.IntList: context fn Append: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.IntList: context fn Append: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 int) error { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_Append = func(ctx env.RyeCtx, farg0 int) error { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -22444,8 +21221,9 @@ func ctxTo_binding_IntList(ps *env.ProgramState, v env.RyeCtx) (binding.IntList, res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.IntList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22453,8 +21231,9 @@ func ctxTo_binding_IntList(ps *env.ProgramState, v env.RyeCtx) (binding.IntList, } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: expected error, string or nil", + "context to binding.IntList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22463,16 +21242,16 @@ func ctxTo_binding_IntList(ps *env.ProgramState, v env.RyeCtx) (binding.IntList, return res } default: - return nil, errors.New("context to binding.IntList: context fn Append: expected function") + return nil, errors.New("context to binding.IntList: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Get"] + ctxObj1, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.IntList: expected context to have function Get") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.IntList: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.IntList: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) ([]int, error) { actualFn := fn @@ -22482,16 +21261,18 @@ func ctxTo_binding_IntList(ps *env.ProgramState, v env.RyeCtx) (binding.IntList, var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: expected block for multiple return values", + "context to binding.IntList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: expected block with 2 return values", + "context to binding.IntList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22501,32 +21282,23 @@ func ctxTo_binding_IntList(ps *env.ProgramState, v env.RyeCtx) (binding.IntList, case env.Block: res0 = make([]int, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.Integer); ok { - res0[i] = int(v.Value) + if vc, ok := it.(env.Integer); ok { + res0[i] = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: block item: expected integer", + "context to binding.IntList: arg 0: callback result: "+"block item: "+"expected integer, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } } - case env.Native: - var ok bool - res0, ok = v.Value.([]int) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: expected native of type []int", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.IntList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22534,8 +21306,9 @@ func ctxTo_binding_IntList(ps *env.ProgramState, v env.RyeCtx) (binding.IntList, } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: expected block, native or nil", + "context to binding.IntList: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22548,8 +21321,9 @@ func ctxTo_binding_IntList(ps *env.ProgramState, v env.RyeCtx) (binding.IntList, res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.IntList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22557,8 +21331,9 @@ func ctxTo_binding_IntList(ps *env.ProgramState, v env.RyeCtx) (binding.IntList, } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: expected error, string or nil", + "context to binding.IntList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22567,47 +21342,50 @@ func ctxTo_binding_IntList(ps *env.ProgramState, v env.RyeCtx) (binding.IntList, return res0, res1 } default: - return nil, errors.New("context to binding.IntList: context fn Get: expected function") + return nil, errors.New("context to binding.IntList: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["GetValue"] + ctxObj2, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.IntList: expected context to have function GetValue") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.IntList: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.IntList: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 int) (int, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 int) (int, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 int var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: expected block for multiple return values", + "context to binding.IntList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: expected block with 2 return values", + "context to binding.IntList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = int(v.Value) + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: expected integer", + "context to binding.IntList: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22620,8 +21398,9 @@ func ctxTo_binding_IntList(ps *env.ProgramState, v env.RyeCtx) (binding.IntList, res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.IntList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22629,8 +21408,9 @@ func ctxTo_binding_IntList(ps *env.ProgramState, v env.RyeCtx) (binding.IntList, } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: expected error, string or nil", + "context to binding.IntList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22639,23 +21419,23 @@ func ctxTo_binding_IntList(ps *env.ProgramState, v env.RyeCtx) (binding.IntList, return res0, res1 } default: - return nil, errors.New("context to binding.IntList: context fn GetValue: expected function") + return nil, errors.New("context to binding.IntList: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Prepend"] + ctxObj3, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.IntList: expected context to have function Prepend") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.IntList: context fn Prepend: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.IntList: context fn Prepend: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 int) error { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 int) error { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -22664,8 +21444,9 @@ func ctxTo_binding_IntList(ps *env.ProgramState, v env.RyeCtx) (binding.IntList, res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.IntList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22673,8 +21454,9 @@ func ctxTo_binding_IntList(ps *env.ProgramState, v env.RyeCtx) (binding.IntList, } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: expected error, string or nil", + "context to binding.IntList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22683,29 +21465,29 @@ func ctxTo_binding_IntList(ps *env.ProgramState, v env.RyeCtx) (binding.IntList, return res } default: - return nil, errors.New("context to binding.IntList: context fn Prepend: expected function") + return nil, errors.New("context to binding.IntList: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Set"] + ctxObj4, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.IntList: expected context to have function Set") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.IntList: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.IntList: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 []int) error { - var arg0Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 []int) error { + var farg0Val env.Object { - items := make([]env.Object, len(arg0)) - for i, it := range arg0 { + items := make([]env.Object, len(farg0)) + for i, it := range farg0 { items[i] = *env.NewInteger(int64(it)) } - arg0Val = *env.NewBlock(*env.NewTSeries(items)) + farg0Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -22714,8 +21496,9 @@ func ctxTo_binding_IntList(ps *env.ProgramState, v env.RyeCtx) (binding.IntList, res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.IntList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22723,8 +21506,9 @@ func ctxTo_binding_IntList(ps *env.ProgramState, v env.RyeCtx) (binding.IntList, } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: expected error, string or nil", + "context to binding.IntList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22733,24 +21517,24 @@ func ctxTo_binding_IntList(ps *env.ProgramState, v env.RyeCtx) (binding.IntList, return res } default: - return nil, errors.New("context to binding.IntList: context fn Set: expected function") + return nil, errors.New("context to binding.IntList: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["SetValue"] + ctxObj5, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.IntList: expected context to have function SetValue") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.IntList: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.IntList: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 int, arg1 int) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) - arg1Val = *env.NewInteger(int64(arg1)) + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 int, farg1 int) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) + farg1Val = *env.NewInteger(int64(farg1)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -22759,8 +21543,9 @@ func ctxTo_binding_IntList(ps *env.ProgramState, v env.RyeCtx) (binding.IntList, res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.IntList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22768,8 +21553,9 @@ func ctxTo_binding_IntList(ps *env.ProgramState, v env.RyeCtx) (binding.IntList, } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: expected error, string or nil", + "context to binding.IntList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22778,37 +21564,39 @@ func ctxTo_binding_IntList(ps *env.ProgramState, v env.RyeCtx) (binding.IntList, return res } default: - return nil, errors.New("context to binding.IntList: context fn SetValue: expected function") + return nil, errors.New("context to binding.IntList: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["GetItem"] + ctxObj6, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.IntList: expected context to have function GetItem") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.IntList: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.IntList: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 int) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 int) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: expected block for multiple return values", + "context to binding.IntList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: expected block with 2 return values", + "context to binding.IntList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22819,19 +21607,21 @@ func ctxTo_binding_IntList(ps *env.ProgramState, v env.RyeCtx) (binding.IntList, var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: "+err.Error()+"", + "context to binding.IntList: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.IntList: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22839,8 +21629,9 @@ func ctxTo_binding_IntList(ps *env.ProgramState, v env.RyeCtx) (binding.IntList, } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.IntList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22848,8 +21639,9 @@ func ctxTo_binding_IntList(ps *env.ProgramState, v env.RyeCtx) (binding.IntList, } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: expected native", + "context to binding.IntList: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22862,8 +21654,9 @@ func ctxTo_binding_IntList(ps *env.ProgramState, v env.RyeCtx) (binding.IntList, res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.IntList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22871,8 +21664,9 @@ func ctxTo_binding_IntList(ps *env.ProgramState, v env.RyeCtx) (binding.IntList, } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: expected error, string or nil", + "context to binding.IntList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22881,27 +21675,28 @@ func ctxTo_binding_IntList(ps *env.ProgramState, v env.RyeCtx) (binding.IntList, return res0, res1 } default: - return nil, errors.New("context to binding.IntList: context fn GetItem: expected function") + return nil, errors.New("context to binding.IntList: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["Length"] + ctxObj7, ok := wordToObj["length"] if !ok { return nil, errors.New("context to binding.IntList: expected context to have function Length") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.IntList: context fn Length: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.IntList: context fn Length: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Length = func(ctx env.RyeCtx) int { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res int - if v, ok := ps.Res.(env.Integer); ok { - res = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + res = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntList: arg 0: callback result: expected integer", + "context to binding.IntList: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -22910,79 +21705,45 @@ func ctxTo_binding_IntList(ps *env.ProgramState, v env.RyeCtx) (binding.IntList, return res } default: - return nil, errors.New("context to binding.IntList: context fn Length: expected function") + return nil, errors.New("context to binding.IntList: context fn Length: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["AddListener"] + ctxObj8, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.IntList: expected context to have function AddListener") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.IntList: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.IntList: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.IntList: context fn AddListener: expected function") + return nil, errors.New("context to binding.IntList: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["RemoveListener"] + ctxObj9, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.IntList: expected context to have function RemoveListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.IntList: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.IntList: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.IntList: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.IntList: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -23050,23 +21811,23 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, impl := &iface_binding_IntTree{ self: v, } - ctxObj0, ok := wordToObj["Append"] + ctxObj0, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.IntTree: expected context to have function Append") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 3 { - return nil, errors.New("context to binding.IntTree: context fn Append: function has invalid number of arguments (expected 3)") + return nil, errors.New("context to binding.IntTree: context fn Append: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 string, arg1 string, arg2 int) error { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) - arg2Val = *env.NewInteger(int64(arg2)) + impl.fn_Append = func(ctx env.RyeCtx, farg0 string, farg1 string, farg2 int) error { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) + farg2Val = *env.NewInteger(int64(farg2)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val, farg2Val) var res error switch v := ps.Res.(type) { case env.String: @@ -23075,8 +21836,9 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.IntTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23084,8 +21846,9 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected error, string or nil", + "context to binding.IntTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23094,16 +21857,16 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, return res } default: - return nil, errors.New("context to binding.IntTree: context fn Append: expected function") + return nil, errors.New("context to binding.IntTree: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Get"] + ctxObj1, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.IntTree: expected context to have function Get") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.IntTree: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.IntTree: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) (map[string][]string, map[string]int, error) { actualFn := fn @@ -23114,16 +21877,18 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, var res2 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected block for multiple return values", + "context to binding.IntTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } if len(res.Series.S) != 3 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected block with 3 return values", + "context to binding.IntTree: arg 0: callback result: "+"expected block with 3 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23132,8 +21897,9 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, switch v := res.Series.S[0].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.IntTree: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23142,11 +21908,12 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, res0 = make(map[string][]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: map key: expected string", + "context to binding.IntTree: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23157,32 +21924,23 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: map value: block item: expected string", + "context to binding.IntTree: arg 0: callback result: "+"map value: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: map value: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.IntTree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23190,8 +21948,9 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.IntTree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23208,32 +21967,23 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: map value: block item: expected string", + "context to binding.IntTree: arg 0: callback result: "+"map value: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: map value: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.IntTree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23241,8 +21991,9 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.IntTree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23250,21 +22001,11 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, } res0[mapK] = mapV } - case env.Native: - var ok bool - res0, ok = v.Value.(map[string][]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected native of type map[string][]string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.IntTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23272,8 +22013,9 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected native, block, dict or nil", + "context to binding.IntTree: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23282,8 +22024,9 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, switch v := res.Series.S[1].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.IntTree: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23292,22 +22035,24 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, res1 = make(map[string]int, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: map key: expected string", + "context to binding.IntTree: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } var mapV int - if v, ok := v.Series.S[i+1].(env.Integer); ok { - mapV = int(v.Value) + if vc, ok := v.Series.S[i+1].(env.Integer); ok { + mapV = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: map value: expected integer", + "context to binding.IntTree: arg 0: callback result: "+"map value: "+"expected integer, but got "+objectDebugString(ps.Idx, v.Series.S[i+1]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23320,11 +22065,12 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, for dictK, dictV := range v.Data { mapK := dictK var mapV int - if v, ok := dictV.(env.Integer); ok { - mapV = int(v.Value) + if vc, ok := dictV.(env.Integer); ok { + mapV = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: map value: expected integer", + "context to binding.IntTree: arg 0: callback result: "+"map value: "+"expected integer, but got "+objectDebugString(ps.Idx, dictV), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23332,21 +22078,11 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, } res1[mapK] = mapV } - case env.Native: - var ok bool - res1, ok = v.Value.(map[string]int) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected native of type map[string]int", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.IntTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23354,8 +22090,9 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected native, block, dict or nil", + "context to binding.IntTree: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23368,8 +22105,9 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, res2 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.IntTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23377,8 +22115,9 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, } res2 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected error, string or nil", + "context to binding.IntTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23387,47 +22126,50 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, return res0, res1, res2 } default: - return nil, errors.New("context to binding.IntTree: context fn Get: expected function") + return nil, errors.New("context to binding.IntTree: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["GetValue"] + ctxObj2, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.IntTree: expected context to have function GetValue") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.IntTree: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.IntTree: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 string) (int, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 string) (int, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 int var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected block for multiple return values", + "context to binding.IntTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected block with 2 return values", + "context to binding.IntTree: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = int(v.Value) + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected integer", + "context to binding.IntTree: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23440,8 +22182,9 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.IntTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23449,8 +22192,9 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected error, string or nil", + "context to binding.IntTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23459,25 +22203,25 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, return res0, res1 } default: - return nil, errors.New("context to binding.IntTree: context fn GetValue: expected function") + return nil, errors.New("context to binding.IntTree: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Prepend"] + ctxObj3, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.IntTree: expected context to have function Prepend") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 3 { - return nil, errors.New("context to binding.IntTree: context fn Prepend: function has invalid number of arguments (expected 3)") + return nil, errors.New("context to binding.IntTree: context fn Prepend: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 string, arg1 string, arg2 int) error { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) - arg2Val = *env.NewInteger(int64(arg2)) + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 string, farg1 string, farg2 int) error { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) + farg2Val = *env.NewInteger(int64(farg2)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val, farg2Val) var res error switch v := ps.Res.(type) { case env.String: @@ -23486,8 +22230,9 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.IntTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23495,8 +22240,9 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected error, string or nil", + "context to binding.IntTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23505,22 +22251,22 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, return res } default: - return nil, errors.New("context to binding.IntTree: context fn Prepend: expected function") + return nil, errors.New("context to binding.IntTree: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Set"] + ctxObj4, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.IntTree: expected context to have function Set") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.IntTree: context fn Set: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.IntTree: context fn Set: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 map[string][]string, arg1 map[string]int) error { - var arg0Val, arg1Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 map[string][]string, farg1 map[string]int) error { + var farg0Val, farg1Val env.Object { - data := make(map[string]any, len(arg0)) - for mKey, mVal := range arg0 { + data := make(map[string]any, len(farg0)) + for mKey, mVal := range farg0 { var dVal env.Object { items := make([]env.Object, len(mVal)) @@ -23531,20 +22277,20 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, } data[mKey] = dVal } - arg0Val = *env.NewDict(data) + farg0Val = *env.NewDict(data) } { - data := make(map[string]any, len(arg1)) - for mKey, mVal := range arg1 { + data := make(map[string]any, len(farg1)) + for mKey, mVal := range farg1 { var dVal env.Object dVal = *env.NewInteger(int64(mVal)) data[mKey] = dVal } - arg1Val = *env.NewDict(data) + farg1Val = *env.NewDict(data) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -23553,8 +22299,9 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.IntTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23562,8 +22309,9 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected error, string or nil", + "context to binding.IntTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23572,24 +22320,24 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, return res } default: - return nil, errors.New("context to binding.IntTree: context fn Set: expected function") + return nil, errors.New("context to binding.IntTree: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["SetValue"] + ctxObj5, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.IntTree: expected context to have function SetValue") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.IntTree: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.IntTree: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 string, arg1 int) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewInteger(int64(arg1)) + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 string, farg1 int) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewInteger(int64(farg1)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -23598,8 +22346,9 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.IntTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23607,8 +22356,9 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected error, string or nil", + "context to binding.IntTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23617,37 +22367,39 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, return res } default: - return nil, errors.New("context to binding.IntTree: context fn SetValue: expected function") + return nil, errors.New("context to binding.IntTree: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["GetItem"] + ctxObj6, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.IntTree: expected context to have function GetItem") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.IntTree: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.IntTree: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 string) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 string) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected block for multiple return values", + "context to binding.IntTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected block with 2 return values", + "context to binding.IntTree: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23658,19 +22410,21 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: "+err.Error()+"", + "context to binding.IntTree: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.IntTree: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23678,8 +22432,9 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.IntTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23687,8 +22442,9 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected native", + "context to binding.IntTree: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23701,8 +22457,9 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.IntTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23710,8 +22467,9 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected error, string or nil", + "context to binding.IntTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23720,54 +22478,45 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, return res0, res1 } default: - return nil, errors.New("context to binding.IntTree: context fn GetItem: expected function") + return nil, errors.New("context to binding.IntTree: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["ChildIDs"] + ctxObj7, ok := wordToObj["child-i-ds"] if !ok { return nil, errors.New("context to binding.IntTree: expected context to have function ChildIDs") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.IntTree: context fn ChildIDs: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.IntTree: context fn ChildIDs: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_ChildIDs = func(ctx env.RyeCtx, arg0 string) []string { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_ChildIDs = func(ctx env.RyeCtx, farg0 string) []string { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res []string switch v := ps.Res.(type) { case env.Block: res = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - res[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + res[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: block item: expected string", + "context to binding.IntTree: arg 0: callback result: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.IntTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23775,8 +22524,9 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.IntTree: arg 0: callback result: expected block, native or nil", + "context to binding.IntTree: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23785,79 +22535,45 @@ func ctxTo_binding_IntTree(ps *env.ProgramState, v env.RyeCtx) (binding.IntTree, return res } default: - return nil, errors.New("context to binding.IntTree: context fn ChildIDs: expected function") + return nil, errors.New("context to binding.IntTree: context fn ChildIDs: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["AddListener"] + ctxObj8, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.IntTree: expected context to have function AddListener") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.IntTree: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.IntTree: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.IntTree: context fn AddListener: expected function") + return nil, errors.New("context to binding.IntTree: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["RemoveListener"] + ctxObj9, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.IntTree: expected context to have function RemoveListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.IntTree: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.IntTree: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.IntTree: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.IntTree: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -23901,14 +22617,14 @@ func ctxTo_binding_Rune(ps *env.ProgramState, v env.RyeCtx) (binding.Rune, error impl := &iface_binding_Rune{ self: v, } - ctxObj0, ok := wordToObj["Get"] + ctxObj0, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.Rune: expected context to have function Get") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.Rune: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.Rune: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) (rune, error) { actualFn := fn @@ -23918,16 +22634,18 @@ func ctxTo_binding_Rune(ps *env.ProgramState, v env.RyeCtx) (binding.Rune, error var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Rune: arg 0: callback result: expected block for multiple return values", + "context to binding.Rune: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Rune: arg 0: callback result: expected block with 2 return values", + "context to binding.Rune: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23935,19 +22653,21 @@ func ctxTo_binding_Rune(ps *env.ProgramState, v env.RyeCtx) (binding.Rune, error } switch v := res.Series.S[0].(type) { case env.Native: - var ok bool - res0, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Rune: arg 0: callback result: expected native of type rune", + "context to binding.Rune: arg 0: callback result: "+"expected native of type rune, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Rune: arg 0: callback result: expected native", + "context to binding.Rune: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23960,8 +22680,9 @@ func ctxTo_binding_Rune(ps *env.ProgramState, v env.RyeCtx) (binding.Rune, error res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Rune: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.Rune: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23969,8 +22690,9 @@ func ctxTo_binding_Rune(ps *env.ProgramState, v env.RyeCtx) (binding.Rune, error } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Rune: arg 0: callback result: expected error, string or nil", + "context to binding.Rune: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -23979,23 +22701,23 @@ func ctxTo_binding_Rune(ps *env.ProgramState, v env.RyeCtx) (binding.Rune, error return res0, res1 } default: - return nil, errors.New("context to binding.Rune: context fn Get: expected function") + return nil, errors.New("context to binding.Rune: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Set"] + ctxObj1, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.Rune: expected context to have function Set") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.Rune: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.Rune: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 rune) error { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(rune)") + impl.fn_Set = func(ctx env.RyeCtx, farg0 rune) error { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(rune)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -24004,8 +22726,9 @@ func ctxTo_binding_Rune(ps *env.ProgramState, v env.RyeCtx) (binding.Rune, error res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Rune: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.Rune: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24013,8 +22736,9 @@ func ctxTo_binding_Rune(ps *env.ProgramState, v env.RyeCtx) (binding.Rune, error } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Rune: arg 0: callback result: expected error, string or nil", + "context to binding.Rune: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24023,79 +22747,45 @@ func ctxTo_binding_Rune(ps *env.ProgramState, v env.RyeCtx) (binding.Rune, error return res } default: - return nil, errors.New("context to binding.Rune: context fn Set: expected function") + return nil, errors.New("context to binding.Rune: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["AddListener"] + ctxObj2, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.Rune: expected context to have function AddListener") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.Rune: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.Rune: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.Rune: context fn AddListener: expected function") + return nil, errors.New("context to binding.Rune: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["RemoveListener"] + ctxObj3, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.Rune: expected context to have function RemoveListener") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.Rune: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.Rune: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.Rune: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.Rune: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -24163,21 +22853,21 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis impl := &iface_binding_RuneList{ self: v, } - ctxObj0, ok := wordToObj["Append"] + ctxObj0, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.RuneList: expected context to have function Append") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.RuneList: context fn Append: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.RuneList: context fn Append: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 rune) error { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(rune)") + impl.fn_Append = func(ctx env.RyeCtx, farg0 rune) error { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(rune)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -24186,8 +22876,9 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.RuneList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24195,8 +22886,9 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: expected error, string or nil", + "context to binding.RuneList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24205,16 +22897,16 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis return res } default: - return nil, errors.New("context to binding.RuneList: context fn Append: expected function") + return nil, errors.New("context to binding.RuneList: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Get"] + ctxObj1, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.RuneList: expected context to have function Get") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.RuneList: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.RuneList: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) ([]rune, error) { actualFn := fn @@ -24224,16 +22916,18 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: expected block for multiple return values", + "context to binding.RuneList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: expected block with 2 return values", + "context to binding.RuneList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24245,40 +22939,32 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - res0[i], ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + res0[i] = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: block item: expected native of type rune", + "context to binding.RuneList: arg 0: callback result: "+"block item: "+"expected native of type rune, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: block item: expected native", + "context to binding.RuneList: arg 0: callback result: "+"block item: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } } - case env.Native: - var ok bool - res0, ok = v.Value.([]rune) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: expected native of type []rune", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.RuneList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24286,8 +22972,9 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: expected block, native or nil", + "context to binding.RuneList: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24300,8 +22987,9 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.RuneList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24309,8 +22997,9 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: expected error, string or nil", + "context to binding.RuneList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24319,37 +23008,39 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis return res0, res1 } default: - return nil, errors.New("context to binding.RuneList: context fn Get: expected function") + return nil, errors.New("context to binding.RuneList: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["GetValue"] + ctxObj2, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.RuneList: expected context to have function GetValue") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.RuneList: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.RuneList: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 int) (rune, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 int) (rune, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 rune var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: expected block for multiple return values", + "context to binding.RuneList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: expected block with 2 return values", + "context to binding.RuneList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24357,19 +23048,21 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis } switch v := res.Series.S[0].(type) { case env.Native: - var ok bool - res0, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: expected native of type rune", + "context to binding.RuneList: arg 0: callback result: "+"expected native of type rune, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: expected native", + "context to binding.RuneList: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24382,8 +23075,9 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.RuneList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24391,8 +23085,9 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: expected error, string or nil", + "context to binding.RuneList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24401,23 +23096,23 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis return res0, res1 } default: - return nil, errors.New("context to binding.RuneList: context fn GetValue: expected function") + return nil, errors.New("context to binding.RuneList: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Prepend"] + ctxObj3, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.RuneList: expected context to have function Prepend") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.RuneList: context fn Prepend: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.RuneList: context fn Prepend: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 rune) error { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(rune)") + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 rune) error { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(rune)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -24426,8 +23121,9 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.RuneList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24435,8 +23131,9 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: expected error, string or nil", + "context to binding.RuneList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24445,29 +23142,29 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis return res } default: - return nil, errors.New("context to binding.RuneList: context fn Prepend: expected function") + return nil, errors.New("context to binding.RuneList: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Set"] + ctxObj4, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.RuneList: expected context to have function Set") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.RuneList: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.RuneList: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 []rune) error { - var arg0Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 []rune) error { + var farg0Val env.Object { - items := make([]env.Object, len(arg0)) - for i, it := range arg0 { + items := make([]env.Object, len(farg0)) + for i, it := range farg0 { items[i] = *env.NewNative(ps.Idx, it, "Go(rune)") } - arg0Val = *env.NewBlock(*env.NewTSeries(items)) + farg0Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -24476,8 +23173,9 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.RuneList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24485,8 +23183,9 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: expected error, string or nil", + "context to binding.RuneList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24495,24 +23194,24 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis return res } default: - return nil, errors.New("context to binding.RuneList: context fn Set: expected function") + return nil, errors.New("context to binding.RuneList: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["SetValue"] + ctxObj5, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.RuneList: expected context to have function SetValue") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.RuneList: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.RuneList: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 int, arg1 rune) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) - arg1Val = *env.NewNative(ps.Idx, arg1, "Go(rune)") + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 int, farg1 rune) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) + farg1Val = *env.NewNative(ps.Idx, farg1, "Go(rune)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -24521,8 +23220,9 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.RuneList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24530,8 +23230,9 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: expected error, string or nil", + "context to binding.RuneList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24540,37 +23241,39 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis return res } default: - return nil, errors.New("context to binding.RuneList: context fn SetValue: expected function") + return nil, errors.New("context to binding.RuneList: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["GetItem"] + ctxObj6, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.RuneList: expected context to have function GetItem") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.RuneList: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.RuneList: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 int) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 int) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: expected block for multiple return values", + "context to binding.RuneList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: expected block with 2 return values", + "context to binding.RuneList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24581,19 +23284,21 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: "+err.Error()+"", + "context to binding.RuneList: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.RuneList: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24601,8 +23306,9 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.RuneList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24610,8 +23316,9 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: expected native", + "context to binding.RuneList: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24624,8 +23331,9 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.RuneList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24633,8 +23341,9 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: expected error, string or nil", + "context to binding.RuneList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24643,27 +23352,28 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis return res0, res1 } default: - return nil, errors.New("context to binding.RuneList: context fn GetItem: expected function") + return nil, errors.New("context to binding.RuneList: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["Length"] + ctxObj7, ok := wordToObj["length"] if !ok { return nil, errors.New("context to binding.RuneList: expected context to have function Length") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.RuneList: context fn Length: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.RuneList: context fn Length: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Length = func(ctx env.RyeCtx) int { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res int - if v, ok := ps.Res.(env.Integer); ok { - res = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + res = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneList: arg 0: callback result: expected integer", + "context to binding.RuneList: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24672,79 +23382,45 @@ func ctxTo_binding_RuneList(ps *env.ProgramState, v env.RyeCtx) (binding.RuneLis return res } default: - return nil, errors.New("context to binding.RuneList: context fn Length: expected function") + return nil, errors.New("context to binding.RuneList: context fn Length: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["AddListener"] + ctxObj8, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.RuneList: expected context to have function AddListener") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.RuneList: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.RuneList: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.RuneList: context fn AddListener: expected function") + return nil, errors.New("context to binding.RuneList: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["RemoveListener"] + ctxObj9, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.RuneList: expected context to have function RemoveListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.RuneList: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.RuneList: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.RuneList: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.RuneList: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -24812,23 +23488,23 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre impl := &iface_binding_RuneTree{ self: v, } - ctxObj0, ok := wordToObj["Append"] + ctxObj0, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.RuneTree: expected context to have function Append") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 3 { - return nil, errors.New("context to binding.RuneTree: context fn Append: function has invalid number of arguments (expected 3)") + return nil, errors.New("context to binding.RuneTree: context fn Append: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 string, arg1 string, arg2 rune) error { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) - arg2Val = *env.NewNative(ps.Idx, arg2, "Go(rune)") + impl.fn_Append = func(ctx env.RyeCtx, farg0 string, farg1 string, farg2 rune) error { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) + farg2Val = *env.NewNative(ps.Idx, farg2, "Go(rune)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val, farg2Val) var res error switch v := ps.Res.(type) { case env.String: @@ -24837,8 +23513,9 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.RuneTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24846,8 +23523,9 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected error, string or nil", + "context to binding.RuneTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24856,16 +23534,16 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre return res } default: - return nil, errors.New("context to binding.RuneTree: context fn Append: expected function") + return nil, errors.New("context to binding.RuneTree: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Get"] + ctxObj1, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.RuneTree: expected context to have function Get") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.RuneTree: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.RuneTree: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) (map[string][]string, map[string]rune, error) { actualFn := fn @@ -24876,16 +23554,18 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre var res2 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected block for multiple return values", + "context to binding.RuneTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } if len(res.Series.S) != 3 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected block with 3 return values", + "context to binding.RuneTree: arg 0: callback result: "+"expected block with 3 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24894,8 +23574,9 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre switch v := res.Series.S[0].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.RuneTree: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24904,11 +23585,12 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre res0 = make(map[string][]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: map key: expected string", + "context to binding.RuneTree: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24919,32 +23601,23 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: map value: block item: expected string", + "context to binding.RuneTree: arg 0: callback result: "+"map value: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: map value: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.RuneTree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24952,8 +23625,9 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.RuneTree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -24970,32 +23644,23 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: map value: block item: expected string", + "context to binding.RuneTree: arg 0: callback result: "+"map value: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: map value: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.RuneTree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25003,8 +23668,9 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.RuneTree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25012,21 +23678,11 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre } res0[mapK] = mapV } - case env.Native: - var ok bool - res0, ok = v.Value.(map[string][]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected native of type map[string][]string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.RuneTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25034,8 +23690,9 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected native, block, dict or nil", + "context to binding.RuneTree: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25044,8 +23701,9 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre switch v := res.Series.S[1].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.RuneTree: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25054,11 +23712,12 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre res1 = make(map[string]rune, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: map key: expected string", + "context to binding.RuneTree: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25067,19 +23726,21 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre var mapV rune switch v := v.Series.S[i+1].(type) { case env.Native: - var ok bool - mapV, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + mapV = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: map value: expected native of type rune", + "context to binding.RuneTree: arg 0: callback result: "+"map value: "+"expected native of type rune, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: map value: expected native", + "context to binding.RuneTree: arg 0: callback result: "+"map value: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25094,19 +23755,21 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre var mapV rune switch v := dictV.(type) { case env.Native: - var ok bool - mapV, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + mapV = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: map value: expected native of type rune", + "context to binding.RuneTree: arg 0: callback result: "+"map value: "+"expected native of type rune, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: map value: expected native", + "context to binding.RuneTree: arg 0: callback result: "+"map value: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25114,21 +23777,11 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre } res1[mapK] = mapV } - case env.Native: - var ok bool - res1, ok = v.Value.(map[string]rune) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected native of type map[string]rune", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.RuneTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25136,8 +23789,9 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected native, block, dict or nil", + "context to binding.RuneTree: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25150,8 +23804,9 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre res2 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.RuneTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25159,8 +23814,9 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre } res2 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected error, string or nil", + "context to binding.RuneTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25169,37 +23825,39 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre return res0, res1, res2 } default: - return nil, errors.New("context to binding.RuneTree: context fn Get: expected function") + return nil, errors.New("context to binding.RuneTree: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["GetValue"] + ctxObj2, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.RuneTree: expected context to have function GetValue") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.RuneTree: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.RuneTree: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 string) (rune, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 string) (rune, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 rune var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected block for multiple return values", + "context to binding.RuneTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected block with 2 return values", + "context to binding.RuneTree: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25207,19 +23865,21 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre } switch v := res.Series.S[0].(type) { case env.Native: - var ok bool - res0, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected native of type rune", + "context to binding.RuneTree: arg 0: callback result: "+"expected native of type rune, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected native", + "context to binding.RuneTree: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25232,8 +23892,9 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.RuneTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25241,8 +23902,9 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected error, string or nil", + "context to binding.RuneTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25251,25 +23913,25 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre return res0, res1 } default: - return nil, errors.New("context to binding.RuneTree: context fn GetValue: expected function") + return nil, errors.New("context to binding.RuneTree: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Prepend"] + ctxObj3, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.RuneTree: expected context to have function Prepend") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 3 { - return nil, errors.New("context to binding.RuneTree: context fn Prepend: function has invalid number of arguments (expected 3)") + return nil, errors.New("context to binding.RuneTree: context fn Prepend: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 string, arg1 string, arg2 rune) error { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) - arg2Val = *env.NewNative(ps.Idx, arg2, "Go(rune)") + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 string, farg1 string, farg2 rune) error { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) + farg2Val = *env.NewNative(ps.Idx, farg2, "Go(rune)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val, farg2Val) var res error switch v := ps.Res.(type) { case env.String: @@ -25278,8 +23940,9 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.RuneTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25287,8 +23950,9 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected error, string or nil", + "context to binding.RuneTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25297,22 +23961,22 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre return res } default: - return nil, errors.New("context to binding.RuneTree: context fn Prepend: expected function") + return nil, errors.New("context to binding.RuneTree: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Set"] + ctxObj4, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.RuneTree: expected context to have function Set") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.RuneTree: context fn Set: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.RuneTree: context fn Set: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 map[string][]string, arg1 map[string]rune) error { - var arg0Val, arg1Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 map[string][]string, farg1 map[string]rune) error { + var farg0Val, farg1Val env.Object { - data := make(map[string]any, len(arg0)) - for mKey, mVal := range arg0 { + data := make(map[string]any, len(farg0)) + for mKey, mVal := range farg0 { var dVal env.Object { items := make([]env.Object, len(mVal)) @@ -25323,20 +23987,20 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre } data[mKey] = dVal } - arg0Val = *env.NewDict(data) + farg0Val = *env.NewDict(data) } { - data := make(map[string]any, len(arg1)) - for mKey, mVal := range arg1 { + data := make(map[string]any, len(farg1)) + for mKey, mVal := range farg1 { var dVal env.Object dVal = *env.NewNative(ps.Idx, mVal, "Go(rune)") data[mKey] = dVal } - arg1Val = *env.NewDict(data) + farg1Val = *env.NewDict(data) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -25345,8 +24009,9 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.RuneTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25354,8 +24019,9 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected error, string or nil", + "context to binding.RuneTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25364,24 +24030,24 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre return res } default: - return nil, errors.New("context to binding.RuneTree: context fn Set: expected function") + return nil, errors.New("context to binding.RuneTree: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["SetValue"] + ctxObj5, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.RuneTree: expected context to have function SetValue") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.RuneTree: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.RuneTree: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 string, arg1 rune) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewNative(ps.Idx, arg1, "Go(rune)") + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 string, farg1 rune) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewNative(ps.Idx, farg1, "Go(rune)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -25390,8 +24056,9 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.RuneTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25399,8 +24066,9 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected error, string or nil", + "context to binding.RuneTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25409,37 +24077,39 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre return res } default: - return nil, errors.New("context to binding.RuneTree: context fn SetValue: expected function") + return nil, errors.New("context to binding.RuneTree: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["GetItem"] + ctxObj6, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.RuneTree: expected context to have function GetItem") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.RuneTree: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.RuneTree: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 string) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 string) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected block for multiple return values", + "context to binding.RuneTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected block with 2 return values", + "context to binding.RuneTree: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25450,19 +24120,21 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: "+err.Error()+"", + "context to binding.RuneTree: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.RuneTree: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25470,8 +24142,9 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.RuneTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25479,8 +24152,9 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected native", + "context to binding.RuneTree: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25493,8 +24167,9 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.RuneTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25502,8 +24177,9 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected error, string or nil", + "context to binding.RuneTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25512,54 +24188,45 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre return res0, res1 } default: - return nil, errors.New("context to binding.RuneTree: context fn GetItem: expected function") + return nil, errors.New("context to binding.RuneTree: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["ChildIDs"] + ctxObj7, ok := wordToObj["child-i-ds"] if !ok { return nil, errors.New("context to binding.RuneTree: expected context to have function ChildIDs") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.RuneTree: context fn ChildIDs: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.RuneTree: context fn ChildIDs: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_ChildIDs = func(ctx env.RyeCtx, arg0 string) []string { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_ChildIDs = func(ctx env.RyeCtx, farg0 string) []string { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res []string switch v := ps.Res.(type) { case env.Block: res = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - res[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + res[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: block item: expected string", + "context to binding.RuneTree: arg 0: callback result: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.RuneTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25567,8 +24234,9 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.RuneTree: arg 0: callback result: expected block, native or nil", + "context to binding.RuneTree: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25577,79 +24245,45 @@ func ctxTo_binding_RuneTree(ps *env.ProgramState, v env.RyeCtx) (binding.RuneTre return res } default: - return nil, errors.New("context to binding.RuneTree: context fn ChildIDs: expected function") + return nil, errors.New("context to binding.RuneTree: context fn ChildIDs: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["AddListener"] + ctxObj8, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.RuneTree: expected context to have function AddListener") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.RuneTree: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.RuneTree: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.RuneTree: context fn AddListener: expected function") + return nil, errors.New("context to binding.RuneTree: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["RemoveListener"] + ctxObj9, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.RuneTree: expected context to have function RemoveListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.RuneTree: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.RuneTree: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.RuneTree: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.RuneTree: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -25693,14 +24327,14 @@ func ctxTo_binding_String(ps *env.ProgramState, v env.RyeCtx) (binding.String, e impl := &iface_binding_String{ self: v, } - ctxObj0, ok := wordToObj["Get"] + ctxObj0, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.String: expected context to have function Get") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.String: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.String: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) (string, error) { actualFn := fn @@ -25710,26 +24344,29 @@ func ctxTo_binding_String(ps *env.ProgramState, v env.RyeCtx) (binding.String, e var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.String: arg 0: callback result: expected block for multiple return values", + "context to binding.String: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.String: arg 0: callback result: expected block with 2 return values", + "context to binding.String: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.String); ok { - res0 = string(v.Value) + if vc, ok := res.Series.S[0].(env.String); ok { + res0 = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.String: arg 0: callback result: expected string", + "context to binding.String: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25742,8 +24379,9 @@ func ctxTo_binding_String(ps *env.ProgramState, v env.RyeCtx) (binding.String, e res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.String: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.String: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25751,8 +24389,9 @@ func ctxTo_binding_String(ps *env.ProgramState, v env.RyeCtx) (binding.String, e } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.String: arg 0: callback result: expected error, string or nil", + "context to binding.String: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25761,23 +24400,23 @@ func ctxTo_binding_String(ps *env.ProgramState, v env.RyeCtx) (binding.String, e return res0, res1 } default: - return nil, errors.New("context to binding.String: context fn Get: expected function") + return nil, errors.New("context to binding.String: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Set"] + ctxObj1, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.String: expected context to have function Set") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.String: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.String: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 string) error { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_Set = func(ctx env.RyeCtx, farg0 string) error { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -25786,8 +24425,9 @@ func ctxTo_binding_String(ps *env.ProgramState, v env.RyeCtx) (binding.String, e res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.String: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.String: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25795,8 +24435,9 @@ func ctxTo_binding_String(ps *env.ProgramState, v env.RyeCtx) (binding.String, e } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.String: arg 0: callback result: expected error, string or nil", + "context to binding.String: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25805,79 +24446,45 @@ func ctxTo_binding_String(ps *env.ProgramState, v env.RyeCtx) (binding.String, e return res } default: - return nil, errors.New("context to binding.String: context fn Set: expected function") + return nil, errors.New("context to binding.String: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["AddListener"] + ctxObj2, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.String: expected context to have function AddListener") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.String: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.String: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.String: context fn AddListener: expected function") + return nil, errors.New("context to binding.String: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["RemoveListener"] + ctxObj3, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.String: expected context to have function RemoveListener") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.String: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.String: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.String: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.String: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -25945,21 +24552,21 @@ func ctxTo_binding_StringList(ps *env.ProgramState, v env.RyeCtx) (binding.Strin impl := &iface_binding_StringList{ self: v, } - ctxObj0, ok := wordToObj["Append"] + ctxObj0, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.StringList: expected context to have function Append") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.StringList: context fn Append: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.StringList: context fn Append: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 string) error { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_Append = func(ctx env.RyeCtx, farg0 string) error { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -25968,8 +24575,9 @@ func ctxTo_binding_StringList(ps *env.ProgramState, v env.RyeCtx) (binding.Strin res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.StringList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25977,8 +24585,9 @@ func ctxTo_binding_StringList(ps *env.ProgramState, v env.RyeCtx) (binding.Strin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: expected error, string or nil", + "context to binding.StringList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -25987,16 +24596,16 @@ func ctxTo_binding_StringList(ps *env.ProgramState, v env.RyeCtx) (binding.Strin return res } default: - return nil, errors.New("context to binding.StringList: context fn Append: expected function") + return nil, errors.New("context to binding.StringList: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Get"] + ctxObj1, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.StringList: expected context to have function Get") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.StringList: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.StringList: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) ([]string, error) { actualFn := fn @@ -26006,16 +24615,18 @@ func ctxTo_binding_StringList(ps *env.ProgramState, v env.RyeCtx) (binding.Strin var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: expected block for multiple return values", + "context to binding.StringList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: expected block with 2 return values", + "context to binding.StringList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26025,32 +24636,23 @@ func ctxTo_binding_StringList(ps *env.ProgramState, v env.RyeCtx) (binding.Strin case env.Block: res0 = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - res0[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + res0[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: block item: expected string", + "context to binding.StringList: arg 0: callback result: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } } - case env.Native: - var ok bool - res0, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.StringList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26058,8 +24660,9 @@ func ctxTo_binding_StringList(ps *env.ProgramState, v env.RyeCtx) (binding.Strin } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: expected block, native or nil", + "context to binding.StringList: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26072,8 +24675,9 @@ func ctxTo_binding_StringList(ps *env.ProgramState, v env.RyeCtx) (binding.Strin res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.StringList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26081,8 +24685,9 @@ func ctxTo_binding_StringList(ps *env.ProgramState, v env.RyeCtx) (binding.Strin } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: expected error, string or nil", + "context to binding.StringList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26091,47 +24696,50 @@ func ctxTo_binding_StringList(ps *env.ProgramState, v env.RyeCtx) (binding.Strin return res0, res1 } default: - return nil, errors.New("context to binding.StringList: context fn Get: expected function") + return nil, errors.New("context to binding.StringList: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["GetValue"] + ctxObj2, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.StringList: expected context to have function GetValue") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.StringList: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.StringList: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 int) (string, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 int) (string, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 string var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: expected block for multiple return values", + "context to binding.StringList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: expected block with 2 return values", + "context to binding.StringList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.String); ok { - res0 = string(v.Value) + if vc, ok := res.Series.S[0].(env.String); ok { + res0 = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: expected string", + "context to binding.StringList: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26144,8 +24752,9 @@ func ctxTo_binding_StringList(ps *env.ProgramState, v env.RyeCtx) (binding.Strin res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.StringList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26153,8 +24762,9 @@ func ctxTo_binding_StringList(ps *env.ProgramState, v env.RyeCtx) (binding.Strin } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: expected error, string or nil", + "context to binding.StringList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26163,23 +24773,23 @@ func ctxTo_binding_StringList(ps *env.ProgramState, v env.RyeCtx) (binding.Strin return res0, res1 } default: - return nil, errors.New("context to binding.StringList: context fn GetValue: expected function") + return nil, errors.New("context to binding.StringList: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Prepend"] + ctxObj3, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.StringList: expected context to have function Prepend") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.StringList: context fn Prepend: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.StringList: context fn Prepend: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 string) error { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 string) error { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -26188,8 +24798,9 @@ func ctxTo_binding_StringList(ps *env.ProgramState, v env.RyeCtx) (binding.Strin res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.StringList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26197,8 +24808,9 @@ func ctxTo_binding_StringList(ps *env.ProgramState, v env.RyeCtx) (binding.Strin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: expected error, string or nil", + "context to binding.StringList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26207,29 +24819,29 @@ func ctxTo_binding_StringList(ps *env.ProgramState, v env.RyeCtx) (binding.Strin return res } default: - return nil, errors.New("context to binding.StringList: context fn Prepend: expected function") + return nil, errors.New("context to binding.StringList: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Set"] + ctxObj4, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.StringList: expected context to have function Set") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.StringList: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.StringList: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 []string) error { - var arg0Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 []string) error { + var farg0Val env.Object { - items := make([]env.Object, len(arg0)) - for i, it := range arg0 { + items := make([]env.Object, len(farg0)) + for i, it := range farg0 { items[i] = *env.NewString(it) } - arg0Val = *env.NewBlock(*env.NewTSeries(items)) + farg0Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -26238,8 +24850,9 @@ func ctxTo_binding_StringList(ps *env.ProgramState, v env.RyeCtx) (binding.Strin res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.StringList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26247,8 +24860,9 @@ func ctxTo_binding_StringList(ps *env.ProgramState, v env.RyeCtx) (binding.Strin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: expected error, string or nil", + "context to binding.StringList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26257,24 +24871,24 @@ func ctxTo_binding_StringList(ps *env.ProgramState, v env.RyeCtx) (binding.Strin return res } default: - return nil, errors.New("context to binding.StringList: context fn Set: expected function") + return nil, errors.New("context to binding.StringList: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["SetValue"] + ctxObj5, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.StringList: expected context to have function SetValue") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.StringList: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.StringList: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 int, arg1 string) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) - arg1Val = *env.NewString(arg1) + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 int, farg1 string) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) + farg1Val = *env.NewString(farg1) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -26283,8 +24897,9 @@ func ctxTo_binding_StringList(ps *env.ProgramState, v env.RyeCtx) (binding.Strin res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.StringList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26292,8 +24907,9 @@ func ctxTo_binding_StringList(ps *env.ProgramState, v env.RyeCtx) (binding.Strin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: expected error, string or nil", + "context to binding.StringList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26302,37 +24918,39 @@ func ctxTo_binding_StringList(ps *env.ProgramState, v env.RyeCtx) (binding.Strin return res } default: - return nil, errors.New("context to binding.StringList: context fn SetValue: expected function") + return nil, errors.New("context to binding.StringList: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["GetItem"] + ctxObj6, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.StringList: expected context to have function GetItem") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.StringList: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.StringList: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 int) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 int) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: expected block for multiple return values", + "context to binding.StringList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: expected block with 2 return values", + "context to binding.StringList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26343,19 +24961,21 @@ func ctxTo_binding_StringList(ps *env.ProgramState, v env.RyeCtx) (binding.Strin var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: "+err.Error()+"", + "context to binding.StringList: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.StringList: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26363,8 +24983,9 @@ func ctxTo_binding_StringList(ps *env.ProgramState, v env.RyeCtx) (binding.Strin } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.StringList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26372,8 +24993,9 @@ func ctxTo_binding_StringList(ps *env.ProgramState, v env.RyeCtx) (binding.Strin } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: expected native", + "context to binding.StringList: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26386,8 +25008,9 @@ func ctxTo_binding_StringList(ps *env.ProgramState, v env.RyeCtx) (binding.Strin res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.StringList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26395,8 +25018,9 @@ func ctxTo_binding_StringList(ps *env.ProgramState, v env.RyeCtx) (binding.Strin } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: expected error, string or nil", + "context to binding.StringList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26405,27 +25029,28 @@ func ctxTo_binding_StringList(ps *env.ProgramState, v env.RyeCtx) (binding.Strin return res0, res1 } default: - return nil, errors.New("context to binding.StringList: context fn GetItem: expected function") + return nil, errors.New("context to binding.StringList: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["Length"] + ctxObj7, ok := wordToObj["length"] if !ok { return nil, errors.New("context to binding.StringList: expected context to have function Length") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.StringList: context fn Length: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.StringList: context fn Length: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Length = func(ctx env.RyeCtx) int { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res int - if v, ok := ps.Res.(env.Integer); ok { - res = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + res = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringList: arg 0: callback result: expected integer", + "context to binding.StringList: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26434,79 +25059,45 @@ func ctxTo_binding_StringList(ps *env.ProgramState, v env.RyeCtx) (binding.Strin return res } default: - return nil, errors.New("context to binding.StringList: context fn Length: expected function") + return nil, errors.New("context to binding.StringList: context fn Length: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["AddListener"] + ctxObj8, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.StringList: expected context to have function AddListener") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.StringList: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.StringList: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.StringList: context fn AddListener: expected function") + return nil, errors.New("context to binding.StringList: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["RemoveListener"] + ctxObj9, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.StringList: expected context to have function RemoveListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.StringList: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.StringList: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.StringList: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.StringList: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -26574,23 +25165,23 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin impl := &iface_binding_StringTree{ self: v, } - ctxObj0, ok := wordToObj["Append"] + ctxObj0, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.StringTree: expected context to have function Append") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 3 { - return nil, errors.New("context to binding.StringTree: context fn Append: function has invalid number of arguments (expected 3)") + return nil, errors.New("context to binding.StringTree: context fn Append: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 string, arg1 string, arg2 string) error { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) - arg2Val = *env.NewString(arg2) + impl.fn_Append = func(ctx env.RyeCtx, farg0 string, farg1 string, farg2 string) error { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) + farg2Val = *env.NewString(farg2) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val, farg2Val) var res error switch v := ps.Res.(type) { case env.String: @@ -26599,8 +25190,9 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.StringTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26608,8 +25200,9 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected error, string or nil", + "context to binding.StringTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26618,16 +25211,16 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin return res } default: - return nil, errors.New("context to binding.StringTree: context fn Append: expected function") + return nil, errors.New("context to binding.StringTree: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Get"] + ctxObj1, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.StringTree: expected context to have function Get") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.StringTree: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.StringTree: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) (map[string][]string, map[string]string, error) { actualFn := fn @@ -26638,16 +25231,18 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin var res2 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected block for multiple return values", + "context to binding.StringTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } if len(res.Series.S) != 3 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected block with 3 return values", + "context to binding.StringTree: arg 0: callback result: "+"expected block with 3 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26656,8 +25251,9 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin switch v := res.Series.S[0].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.StringTree: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26666,11 +25262,12 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin res0 = make(map[string][]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: map key: expected string", + "context to binding.StringTree: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26681,32 +25278,23 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: map value: block item: expected string", + "context to binding.StringTree: arg 0: callback result: "+"map value: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: map value: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.StringTree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26714,8 +25302,9 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.StringTree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26732,32 +25321,23 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: map value: block item: expected string", + "context to binding.StringTree: arg 0: callback result: "+"map value: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: map value: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.StringTree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26765,8 +25345,9 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.StringTree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26774,21 +25355,11 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin } res0[mapK] = mapV } - case env.Native: - var ok bool - res0, ok = v.Value.(map[string][]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected native of type map[string][]string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.StringTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26796,8 +25367,9 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected native, block, dict or nil", + "context to binding.StringTree: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26806,8 +25378,9 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin switch v := res.Series.S[1].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.StringTree: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26816,22 +25389,24 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin res1 = make(map[string]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: map key: expected string", + "context to binding.StringTree: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } var mapV string - if v, ok := v.Series.S[i+1].(env.String); ok { - mapV = string(v.Value) + if vc, ok := v.Series.S[i+1].(env.String); ok { + mapV = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: map value: expected string", + "context to binding.StringTree: arg 0: callback result: "+"map value: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+1]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26844,11 +25419,12 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin for dictK, dictV := range v.Data { mapK := dictK var mapV string - if v, ok := dictV.(env.String); ok { - mapV = string(v.Value) + if vc, ok := dictV.(env.String); ok { + mapV = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: map value: expected string", + "context to binding.StringTree: arg 0: callback result: "+"map value: "+"expected string, but got "+objectDebugString(ps.Idx, dictV), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26856,21 +25432,11 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin } res1[mapK] = mapV } - case env.Native: - var ok bool - res1, ok = v.Value.(map[string]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected native of type map[string]string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.StringTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26878,8 +25444,9 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected native, block, dict or nil", + "context to binding.StringTree: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26892,8 +25459,9 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin res2 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.StringTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26901,8 +25469,9 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin } res2 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected error, string or nil", + "context to binding.StringTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26911,47 +25480,50 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin return res0, res1, res2 } default: - return nil, errors.New("context to binding.StringTree: context fn Get: expected function") + return nil, errors.New("context to binding.StringTree: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["GetValue"] + ctxObj2, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.StringTree: expected context to have function GetValue") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.StringTree: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.StringTree: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 string) (string, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 string) (string, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 string var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected block for multiple return values", + "context to binding.StringTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected block with 2 return values", + "context to binding.StringTree: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.String); ok { - res0 = string(v.Value) + if vc, ok := res.Series.S[0].(env.String); ok { + res0 = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected string", + "context to binding.StringTree: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26964,8 +25536,9 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.StringTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26973,8 +25546,9 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected error, string or nil", + "context to binding.StringTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -26983,25 +25557,25 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin return res0, res1 } default: - return nil, errors.New("context to binding.StringTree: context fn GetValue: expected function") + return nil, errors.New("context to binding.StringTree: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Prepend"] + ctxObj3, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.StringTree: expected context to have function Prepend") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 3 { - return nil, errors.New("context to binding.StringTree: context fn Prepend: function has invalid number of arguments (expected 3)") + return nil, errors.New("context to binding.StringTree: context fn Prepend: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 string, arg1 string, arg2 string) error { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) - arg2Val = *env.NewString(arg2) + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 string, farg1 string, farg2 string) error { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) + farg2Val = *env.NewString(farg2) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val, farg2Val) var res error switch v := ps.Res.(type) { case env.String: @@ -27010,8 +25584,9 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.StringTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27019,8 +25594,9 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected error, string or nil", + "context to binding.StringTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27029,22 +25605,22 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin return res } default: - return nil, errors.New("context to binding.StringTree: context fn Prepend: expected function") + return nil, errors.New("context to binding.StringTree: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Set"] + ctxObj4, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.StringTree: expected context to have function Set") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.StringTree: context fn Set: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.StringTree: context fn Set: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 map[string][]string, arg1 map[string]string) error { - var arg0Val, arg1Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 map[string][]string, farg1 map[string]string) error { + var farg0Val, farg1Val env.Object { - data := make(map[string]any, len(arg0)) - for mKey, mVal := range arg0 { + data := make(map[string]any, len(farg0)) + for mKey, mVal := range farg0 { var dVal env.Object { items := make([]env.Object, len(mVal)) @@ -27055,20 +25631,20 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin } data[mKey] = dVal } - arg0Val = *env.NewDict(data) + farg0Val = *env.NewDict(data) } { - data := make(map[string]any, len(arg1)) - for mKey, mVal := range arg1 { + data := make(map[string]any, len(farg1)) + for mKey, mVal := range farg1 { var dVal env.Object dVal = *env.NewString(mVal) data[mKey] = dVal } - arg1Val = *env.NewDict(data) + farg1Val = *env.NewDict(data) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -27077,8 +25653,9 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.StringTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27086,8 +25663,9 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected error, string or nil", + "context to binding.StringTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27096,24 +25674,24 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin return res } default: - return nil, errors.New("context to binding.StringTree: context fn Set: expected function") + return nil, errors.New("context to binding.StringTree: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["SetValue"] + ctxObj5, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.StringTree: expected context to have function SetValue") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.StringTree: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.StringTree: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 string, arg1 string) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 string, farg1 string) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -27122,8 +25700,9 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.StringTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27131,8 +25710,9 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected error, string or nil", + "context to binding.StringTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27141,37 +25721,39 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin return res } default: - return nil, errors.New("context to binding.StringTree: context fn SetValue: expected function") + return nil, errors.New("context to binding.StringTree: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["GetItem"] + ctxObj6, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.StringTree: expected context to have function GetItem") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.StringTree: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.StringTree: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 string) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 string) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected block for multiple return values", + "context to binding.StringTree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected block with 2 return values", + "context to binding.StringTree: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27182,19 +25764,21 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: "+err.Error()+"", + "context to binding.StringTree: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.StringTree: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27202,8 +25786,9 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.StringTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27211,8 +25796,9 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected native", + "context to binding.StringTree: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27225,8 +25811,9 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.StringTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27234,8 +25821,9 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected error, string or nil", + "context to binding.StringTree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27244,54 +25832,45 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin return res0, res1 } default: - return nil, errors.New("context to binding.StringTree: context fn GetItem: expected function") + return nil, errors.New("context to binding.StringTree: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["ChildIDs"] + ctxObj7, ok := wordToObj["child-i-ds"] if !ok { return nil, errors.New("context to binding.StringTree: expected context to have function ChildIDs") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.StringTree: context fn ChildIDs: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.StringTree: context fn ChildIDs: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_ChildIDs = func(ctx env.RyeCtx, arg0 string) []string { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_ChildIDs = func(ctx env.RyeCtx, farg0 string) []string { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res []string switch v := ps.Res.(type) { case env.Block: res = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - res[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + res[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: block item: expected string", + "context to binding.StringTree: arg 0: callback result: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.StringTree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27299,8 +25878,9 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.StringTree: arg 0: callback result: expected block, native or nil", + "context to binding.StringTree: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27309,87 +25889,53 @@ func ctxTo_binding_StringTree(ps *env.ProgramState, v env.RyeCtx) (binding.Strin return res } default: - return nil, errors.New("context to binding.StringTree: context fn ChildIDs: expected function") + return nil, errors.New("context to binding.StringTree: context fn ChildIDs: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["AddListener"] + ctxObj8, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.StringTree: expected context to have function AddListener") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.StringTree: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.StringTree: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.StringTree: context fn AddListener: expected function") + return nil, errors.New("context to binding.StringTree: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["RemoveListener"] + ctxObj9, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.StringTree: expected context to have function RemoveListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.StringTree: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.StringTree: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.StringTree: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.StringTree: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } type iface_binding_Struct struct { self env.RyeCtx - fn_GetValue func(self env.RyeCtx, arg0 string) (any, error) - fn_SetValue func(self env.RyeCtx, arg0 string, arg1 any) error + fn_GetValue func(self env.RyeCtx, arg0 string) (interface{}, error) + fn_SetValue func(self env.RyeCtx, arg0 string, arg1 interface{}) error fn_Reload func(self env.RyeCtx) error fn_GetItem func(self env.RyeCtx, arg0 string) (binding.DataItem, error) fn_Keys func(self env.RyeCtx) []string @@ -27397,10 +25943,10 @@ type iface_binding_Struct struct { fn_RemoveListener func(self env.RyeCtx, arg0 binding.DataListener) } -func (self *iface_binding_Struct) GetValue(arg0 string) (any, error) { +func (self *iface_binding_Struct) GetValue(arg0 string) (interface{}, error) { return self.fn_GetValue(self.self, arg0) } -func (self *iface_binding_Struct) SetValue(arg0 string, arg1 any) error { +func (self *iface_binding_Struct) SetValue(arg0 string, arg1 interface{}) error { return self.fn_SetValue(self.self, arg0, arg1) } func (self *iface_binding_Struct) Reload() error { @@ -27437,35 +25983,37 @@ func ctxTo_binding_Struct(ps *env.ProgramState, v env.RyeCtx) (binding.Struct, e impl := &iface_binding_Struct{ self: v, } - ctxObj0, ok := wordToObj["GetValue"] + ctxObj0, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.Struct: expected context to have function GetValue") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.Struct: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.Struct: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 string) (any, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 string) (interface{}, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) - var res0 any + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) + var res0 interface{} var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Struct: arg 0: callback result: expected block for multiple return values", + "context to binding.Struct: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Struct: arg 0: callback result: expected block with 2 return values", + "context to binding.Struct: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27473,19 +26021,21 @@ func ctxTo_binding_Struct(ps *env.ProgramState, v env.RyeCtx) (binding.Struct, e } switch v := res.Series.S[0].(type) { case env.Native: - var ok bool - res0, ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Struct: arg 0: callback result: expected native of type any", + "context to binding.Struct: arg 0: callback result: "+"expected native of type interface{}, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Struct: arg 0: callback result: expected native", + "context to binding.Struct: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27498,8 +26048,9 @@ func ctxTo_binding_Struct(ps *env.ProgramState, v env.RyeCtx) (binding.Struct, e res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Struct: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.Struct: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27507,8 +26058,9 @@ func ctxTo_binding_Struct(ps *env.ProgramState, v env.RyeCtx) (binding.Struct, e } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Struct: arg 0: callback result: expected error, string or nil", + "context to binding.Struct: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27517,24 +26069,24 @@ func ctxTo_binding_Struct(ps *env.ProgramState, v env.RyeCtx) (binding.Struct, e return res0, res1 } default: - return nil, errors.New("context to binding.Struct: context fn GetValue: expected function") + return nil, errors.New("context to binding.Struct: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["SetValue"] + ctxObj1, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.Struct: expected context to have function SetValue") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.Struct: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.Struct: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 string, arg1 any) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewNative(ps.Idx, arg1, "Go(any)") + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 string, farg1 interface{}) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewNative(ps.Idx, farg1, "Go(interface{})") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -27543,8 +26095,9 @@ func ctxTo_binding_Struct(ps *env.ProgramState, v env.RyeCtx) (binding.Struct, e res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Struct: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.Struct: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27552,8 +26105,9 @@ func ctxTo_binding_Struct(ps *env.ProgramState, v env.RyeCtx) (binding.Struct, e } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Struct: arg 0: callback result: expected error, string or nil", + "context to binding.Struct: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27562,16 +26116,16 @@ func ctxTo_binding_Struct(ps *env.ProgramState, v env.RyeCtx) (binding.Struct, e return res } default: - return nil, errors.New("context to binding.Struct: context fn SetValue: expected function") + return nil, errors.New("context to binding.Struct: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Reload"] + ctxObj2, ok := wordToObj["reload"] if !ok { return nil, errors.New("context to binding.Struct: expected context to have function Reload") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.Struct: context fn Reload: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.Struct: context fn Reload: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Reload = func(ctx env.RyeCtx) error { actualFn := fn @@ -27585,8 +26139,9 @@ func ctxTo_binding_Struct(ps *env.ProgramState, v env.RyeCtx) (binding.Struct, e res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Struct: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.Struct: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27594,8 +26149,9 @@ func ctxTo_binding_Struct(ps *env.ProgramState, v env.RyeCtx) (binding.Struct, e } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Struct: arg 0: callback result: expected error, string or nil", + "context to binding.Struct: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27604,37 +26160,39 @@ func ctxTo_binding_Struct(ps *env.ProgramState, v env.RyeCtx) (binding.Struct, e return res } default: - return nil, errors.New("context to binding.Struct: context fn Reload: expected function") + return nil, errors.New("context to binding.Struct: context fn Reload: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["GetItem"] + ctxObj3, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.Struct: expected context to have function GetItem") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.Struct: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.Struct: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 string) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 string) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Struct: arg 0: callback result: expected block for multiple return values", + "context to binding.Struct: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Struct: arg 0: callback result: expected block with 2 return values", + "context to binding.Struct: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27645,19 +26203,21 @@ func ctxTo_binding_Struct(ps *env.ProgramState, v env.RyeCtx) (binding.Struct, e var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Struct: arg 0: callback result: "+err.Error()+"", + "context to binding.Struct: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Struct: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.Struct: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27665,8 +26225,9 @@ func ctxTo_binding_Struct(ps *env.ProgramState, v env.RyeCtx) (binding.Struct, e } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Struct: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.Struct: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27674,8 +26235,9 @@ func ctxTo_binding_Struct(ps *env.ProgramState, v env.RyeCtx) (binding.Struct, e } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Struct: arg 0: callback result: expected native", + "context to binding.Struct: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27688,8 +26250,9 @@ func ctxTo_binding_Struct(ps *env.ProgramState, v env.RyeCtx) (binding.Struct, e res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Struct: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.Struct: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27697,8 +26260,9 @@ func ctxTo_binding_Struct(ps *env.ProgramState, v env.RyeCtx) (binding.Struct, e } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Struct: arg 0: callback result: expected error, string or nil", + "context to binding.Struct: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27707,16 +26271,16 @@ func ctxTo_binding_Struct(ps *env.ProgramState, v env.RyeCtx) (binding.Struct, e return res0, res1 } default: - return nil, errors.New("context to binding.Struct: context fn GetItem: expected function") + return nil, errors.New("context to binding.Struct: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Keys"] + ctxObj4, ok := wordToObj["keys"] if !ok { return nil, errors.New("context to binding.Struct: expected context to have function Keys") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.Struct: context fn Keys: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.Struct: context fn Keys: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Keys = func(ctx env.RyeCtx) []string { actualFn := fn @@ -27727,32 +26291,23 @@ func ctxTo_binding_Struct(ps *env.ProgramState, v env.RyeCtx) (binding.Struct, e case env.Block: res = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - res[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + res[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Struct: arg 0: callback result: block item: expected string", + "context to binding.Struct: arg 0: callback result: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Struct: arg 0: callback result: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Struct: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.Struct: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27760,8 +26315,9 @@ func ctxTo_binding_Struct(ps *env.ProgramState, v env.RyeCtx) (binding.Struct, e } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Struct: arg 0: callback result: expected block, native or nil", + "context to binding.Struct: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27770,79 +26326,45 @@ func ctxTo_binding_Struct(ps *env.ProgramState, v env.RyeCtx) (binding.Struct, e return res } default: - return nil, errors.New("context to binding.Struct: context fn Keys: expected function") + return nil, errors.New("context to binding.Struct: context fn Keys: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["AddListener"] + ctxObj5, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.Struct: expected context to have function AddListener") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.Struct: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.Struct: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.Struct: context fn AddListener: expected function") + return nil, errors.New("context to binding.Struct: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["RemoveListener"] + ctxObj6, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.Struct: expected context to have function RemoveListener") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.Struct: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.Struct: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.Struct: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.Struct: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -27886,14 +26408,14 @@ func ctxTo_binding_URI(ps *env.ProgramState, v env.RyeCtx) (binding.URI, error) impl := &iface_binding_URI{ self: v, } - ctxObj0, ok := wordToObj["Get"] + ctxObj0, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.URI: expected context to have function Get") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.URI: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.URI: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) (fyne.URI, error) { actualFn := fn @@ -27903,16 +26425,18 @@ func ctxTo_binding_URI(ps *env.ProgramState, v env.RyeCtx) (binding.URI, error) var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URI: arg 0: callback result: expected block for multiple return values", + "context to binding.URI: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URI: arg 0: callback result: expected block with 2 return values", + "context to binding.URI: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27923,19 +26447,21 @@ func ctxTo_binding_URI(ps *env.ProgramState, v env.RyeCtx) (binding.URI, error) var err error res0, err = ctxTo_fyne_URI(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URI: arg 0: callback result: "+err.Error()+"", + "context to binding.URI: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URI: arg 0: callback result: expected native of type fyne.URI", + "context to binding.URI: arg 0: callback result: "+"expected native of type fyne.URI, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27943,8 +26469,9 @@ func ctxTo_binding_URI(ps *env.ProgramState, v env.RyeCtx) (binding.URI, error) } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URI: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.URI: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27952,8 +26479,9 @@ func ctxTo_binding_URI(ps *env.ProgramState, v env.RyeCtx) (binding.URI, error) } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URI: arg 0: callback result: expected native", + "context to binding.URI: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27966,8 +26494,9 @@ func ctxTo_binding_URI(ps *env.ProgramState, v env.RyeCtx) (binding.URI, error) res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URI: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.URI: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27975,8 +26504,9 @@ func ctxTo_binding_URI(ps *env.ProgramState, v env.RyeCtx) (binding.URI, error) } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URI: arg 0: callback result: expected error, string or nil", + "context to binding.URI: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -27985,40 +26515,23 @@ func ctxTo_binding_URI(ps *env.ProgramState, v env.RyeCtx) (binding.URI, error) return res0, res1 } default: - return nil, errors.New("context to binding.URI: context fn Get: expected function") + return nil, errors.New("context to binding.URI: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Set"] + ctxObj1, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.URI: expected context to have function Set") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.URI: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.URI: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 fyne.URI) error { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_Set = func(ctx env.RyeCtx, farg0 fyne.URI) error { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -28027,8 +26540,9 @@ func ctxTo_binding_URI(ps *env.ProgramState, v env.RyeCtx) (binding.URI, error) res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URI: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.URI: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28036,8 +26550,9 @@ func ctxTo_binding_URI(ps *env.ProgramState, v env.RyeCtx) (binding.URI, error) } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URI: arg 0: callback result: expected error, string or nil", + "context to binding.URI: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28046,79 +26561,45 @@ func ctxTo_binding_URI(ps *env.ProgramState, v env.RyeCtx) (binding.URI, error) return res } default: - return nil, errors.New("context to binding.URI: context fn Set: expected function") + return nil, errors.New("context to binding.URI: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["AddListener"] + ctxObj2, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.URI: expected context to have function AddListener") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.URI: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.URI: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.URI: context fn AddListener: expected function") + return nil, errors.New("context to binding.URI: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["RemoveListener"] + ctxObj3, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.URI: expected context to have function RemoveListener") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.URI: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.URI: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.URI: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.URI: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -28186,38 +26667,21 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, impl := &iface_binding_URIList{ self: v, } - ctxObj0, ok := wordToObj["Append"] + ctxObj0, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.URIList: expected context to have function Append") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.URIList: context fn Append: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.URIList: context fn Append: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 fyne.URI) error { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_Append = func(ctx env.RyeCtx, farg0 fyne.URI) error { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -28226,8 +26690,9 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.URIList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28235,8 +26700,9 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected error, string or nil", + "context to binding.URIList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28245,16 +26711,16 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, return res } default: - return nil, errors.New("context to binding.URIList: context fn Append: expected function") + return nil, errors.New("context to binding.URIList: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Get"] + ctxObj1, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.URIList: expected context to have function Get") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.URIList: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.URIList: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) ([]fyne.URI, error) { actualFn := fn @@ -28264,16 +26730,18 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected block for multiple return values", + "context to binding.URIList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected block with 2 return values", + "context to binding.URIList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28288,19 +26756,21 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, var err error res0[i], err = ctxTo_fyne_URI(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: block item: "+err.Error()+"", + "context to binding.URIList: arg 0: callback result: "+"block item: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0[i], ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + res0[i] = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: block item: expected native of type fyne.URI", + "context to binding.URIList: arg 0: callback result: "+"block item: "+"expected native of type fyne.URI, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28308,8 +26778,9 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: block item: expected integer to be 0 or nil", + "context to binding.URIList: arg 0: callback result: "+"block item: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28317,29 +26788,20 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, } res0[i] = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: block item: expected native", + "context to binding.URIList: arg 0: callback result: "+"block item: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } } - case env.Native: - var ok bool - res0, ok = v.Value.([]fyne.URI) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected native of type []fyne.URI", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.URIList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28347,8 +26809,9 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected block, native or nil", + "context to binding.URIList: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28361,8 +26824,9 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.URIList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28370,8 +26834,9 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected error, string or nil", + "context to binding.URIList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28380,37 +26845,39 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, return res0, res1 } default: - return nil, errors.New("context to binding.URIList: context fn Get: expected function") + return nil, errors.New("context to binding.URIList: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["GetValue"] + ctxObj2, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.URIList: expected context to have function GetValue") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.URIList: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.URIList: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 int) (fyne.URI, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 int) (fyne.URI, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 fyne.URI var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected block for multiple return values", + "context to binding.URIList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected block with 2 return values", + "context to binding.URIList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28421,19 +26888,21 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, var err error res0, err = ctxTo_fyne_URI(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: "+err.Error()+"", + "context to binding.URIList: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected native of type fyne.URI", + "context to binding.URIList: arg 0: callback result: "+"expected native of type fyne.URI, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28441,8 +26910,9 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.URIList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28450,8 +26920,9 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected native", + "context to binding.URIList: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28464,8 +26935,9 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.URIList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28473,8 +26945,9 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected error, string or nil", + "context to binding.URIList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28483,40 +26956,23 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, return res0, res1 } default: - return nil, errors.New("context to binding.URIList: context fn GetValue: expected function") + return nil, errors.New("context to binding.URIList: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Prepend"] + ctxObj3, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.URIList: expected context to have function Prepend") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.URIList: context fn Prepend: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.URIList: context fn Prepend: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 fyne.URI) error { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 fyne.URI) error { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -28525,8 +26981,9 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.URIList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28534,8 +26991,9 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected error, string or nil", + "context to binding.URIList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28544,46 +27002,29 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, return res } default: - return nil, errors.New("context to binding.URIList: context fn Prepend: expected function") + return nil, errors.New("context to binding.URIList: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Set"] + ctxObj4, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.URIList: expected context to have function Set") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.URIList: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.URIList: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 []fyne.URI) error { - var arg0Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 []fyne.URI) error { + var farg0Val env.Object { - items := make([]env.Object, len(arg0)) - for i, it := range arg0 { - { - typ := reflect.TypeOf(it) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - items[i] = *env.NewNative(ps.Idx, it, typRyeName) - } else { - items[i] = *env.NewNative(ps.Idx, it, "Go(fyne.URI)") - } - } + items := make([]env.Object, len(farg0)) + for i, it := range farg0 { + items[i] = ifaceToNative(ps.Idx, it, "Go(fyne.URI)") } - arg0Val = *env.NewBlock(*env.NewTSeries(items)) + farg0Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -28592,8 +27033,9 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.URIList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28601,8 +27043,9 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected error, string or nil", + "context to binding.URIList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28611,41 +27054,24 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, return res } default: - return nil, errors.New("context to binding.URIList: context fn Set: expected function") + return nil, errors.New("context to binding.URIList: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["SetValue"] + ctxObj5, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.URIList: expected context to have function SetValue") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.URIList: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.URIList: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 int, arg1 fyne.URI) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) - { - typ := reflect.TypeOf(arg1) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg1Val = *env.NewNative(ps.Idx, arg1, typRyeName) - } else { - arg1Val = *env.NewNative(ps.Idx, arg1, "Go(fyne.URI)") - } - } + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 int, farg1 fyne.URI) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) + farg1Val = ifaceToNative(ps.Idx, farg1, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -28654,8 +27080,9 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.URIList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28663,8 +27090,9 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected error, string or nil", + "context to binding.URIList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28673,37 +27101,39 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, return res } default: - return nil, errors.New("context to binding.URIList: context fn SetValue: expected function") + return nil, errors.New("context to binding.URIList: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["GetItem"] + ctxObj6, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.URIList: expected context to have function GetItem") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.URIList: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.URIList: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 int) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 int) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected block for multiple return values", + "context to binding.URIList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected block with 2 return values", + "context to binding.URIList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28714,19 +27144,21 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: "+err.Error()+"", + "context to binding.URIList: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.URIList: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28734,8 +27166,9 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.URIList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28743,8 +27176,9 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected native", + "context to binding.URIList: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28757,8 +27191,9 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.URIList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28766,8 +27201,9 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected error, string or nil", + "context to binding.URIList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28776,27 +27212,28 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, return res0, res1 } default: - return nil, errors.New("context to binding.URIList: context fn GetItem: expected function") + return nil, errors.New("context to binding.URIList: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["Length"] + ctxObj7, ok := wordToObj["length"] if !ok { return nil, errors.New("context to binding.URIList: expected context to have function Length") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.URIList: context fn Length: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.URIList: context fn Length: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Length = func(ctx env.RyeCtx) int { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res int - if v, ok := ps.Res.(env.Integer); ok { - res = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + res = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URIList: arg 0: callback result: expected integer", + "context to binding.URIList: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28805,79 +27242,45 @@ func ctxTo_binding_URIList(ps *env.ProgramState, v env.RyeCtx) (binding.URIList, return res } default: - return nil, errors.New("context to binding.URIList: context fn Length: expected function") + return nil, errors.New("context to binding.URIList: context fn Length: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["AddListener"] + ctxObj8, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.URIList: expected context to have function AddListener") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.URIList: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.URIList: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.URIList: context fn AddListener: expected function") + return nil, errors.New("context to binding.URIList: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["RemoveListener"] + ctxObj9, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.URIList: expected context to have function RemoveListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.URIList: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.URIList: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.URIList: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.URIList: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -28945,40 +27348,23 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, impl := &iface_binding_URITree{ self: v, } - ctxObj0, ok := wordToObj["Append"] + ctxObj0, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.URITree: expected context to have function Append") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 3 { - return nil, errors.New("context to binding.URITree: context fn Append: function has invalid number of arguments (expected 3)") + return nil, errors.New("context to binding.URITree: context fn Append: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 string, arg1 string, arg2 fyne.URI) error { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) - { - typ := reflect.TypeOf(arg2) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg2Val = *env.NewNative(ps.Idx, arg2, typRyeName) - } else { - arg2Val = *env.NewNative(ps.Idx, arg2, "Go(fyne.URI)") - } - } + impl.fn_Append = func(ctx env.RyeCtx, farg0 string, farg1 string, farg2 fyne.URI) error { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) + farg2Val = ifaceToNative(ps.Idx, farg2, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val, farg2Val) var res error switch v := ps.Res.(type) { case env.String: @@ -28987,8 +27373,9 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.URITree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -28996,8 +27383,9 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected error, string or nil", + "context to binding.URITree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29006,16 +27394,16 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, return res } default: - return nil, errors.New("context to binding.URITree: context fn Append: expected function") + return nil, errors.New("context to binding.URITree: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Get"] + ctxObj1, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.URITree: expected context to have function Get") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.URITree: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.URITree: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Get = func(ctx env.RyeCtx) (map[string][]string, map[string]fyne.URI, error) { actualFn := fn @@ -29026,16 +27414,18 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, var res2 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected block for multiple return values", + "context to binding.URITree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } if len(res.Series.S) != 3 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected block with 3 return values", + "context to binding.URITree: arg 0: callback result: "+"expected block with 3 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29044,8 +27434,9 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, switch v := res.Series.S[0].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.URITree: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29054,11 +27445,12 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, res0 = make(map[string][]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: map key: expected string", + "context to binding.URITree: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29069,32 +27461,23 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: map value: block item: expected string", + "context to binding.URITree: arg 0: callback result: "+"map value: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: map value: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.URITree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29102,8 +27485,9 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.URITree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29120,32 +27504,23 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: map value: block item: expected string", + "context to binding.URITree: arg 0: callback result: "+"map value: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: map value: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.URITree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29153,8 +27528,9 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: map value: expected block, native or nil", + "context to binding.URITree: arg 0: callback result: "+"map value: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29162,21 +27538,11 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, } res0[mapK] = mapV } - case env.Native: - var ok bool - res0, ok = v.Value.(map[string][]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected native of type map[string][]string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.URITree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29184,8 +27550,9 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected native, block, dict or nil", + "context to binding.URITree: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29194,8 +27561,9 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, switch v := res.Series.S[1].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.URITree: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29204,11 +27572,12 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, res1 = make(map[string]fyne.URI, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: map key: expected string", + "context to binding.URITree: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29220,19 +27589,21 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, var err error mapV, err = ctxTo_fyne_URI(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: map value: "+err.Error()+"", + "context to binding.URITree: arg 0: callback result: "+"map value: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } case env.Native: - var ok bool - mapV, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + mapV = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: map value: expected native of type fyne.URI", + "context to binding.URITree: arg 0: callback result: "+"map value: "+"expected native of type fyne.URI, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29240,8 +27611,9 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.URITree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29249,8 +27621,9 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: map value: expected native", + "context to binding.URITree: arg 0: callback result: "+"map value: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29268,19 +27641,21 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, var err error mapV, err = ctxTo_fyne_URI(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: map value: "+err.Error()+"", + "context to binding.URITree: arg 0: callback result: "+"map value: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } case env.Native: - var ok bool - mapV, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + mapV = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: map value: expected native of type fyne.URI", + "context to binding.URITree: arg 0: callback result: "+"map value: "+"expected native of type fyne.URI, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29288,8 +27663,9 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: map value: expected integer to be 0 or nil", + "context to binding.URITree: arg 0: callback result: "+"map value: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29297,8 +27673,9 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, } mapV = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: map value: expected native", + "context to binding.URITree: arg 0: callback result: "+"map value: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29306,21 +27683,11 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, } res1[mapK] = mapV } - case env.Native: - var ok bool - res1, ok = v.Value.(map[string]fyne.URI) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected native of type map[string]fyne.URI", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1, res2 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.URITree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29328,8 +27695,9 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected native, block, dict or nil", + "context to binding.URITree: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29342,8 +27710,9 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, res2 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.URITree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29351,8 +27720,9 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, } res2 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected error, string or nil", + "context to binding.URITree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29361,37 +27731,39 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, return res0, res1, res2 } default: - return nil, errors.New("context to binding.URITree: context fn Get: expected function") + return nil, errors.New("context to binding.URITree: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["GetValue"] + ctxObj2, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.URITree: expected context to have function GetValue") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.URITree: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.URITree: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 string) (fyne.URI, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 string) (fyne.URI, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 fyne.URI var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected block for multiple return values", + "context to binding.URITree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected block with 2 return values", + "context to binding.URITree: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29402,19 +27774,21 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, var err error res0, err = ctxTo_fyne_URI(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: "+err.Error()+"", + "context to binding.URITree: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected native of type fyne.URI", + "context to binding.URITree: arg 0: callback result: "+"expected native of type fyne.URI, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29422,8 +27796,9 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.URITree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29431,8 +27806,9 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected native", + "context to binding.URITree: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29445,8 +27821,9 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.URITree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29454,8 +27831,9 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected error, string or nil", + "context to binding.URITree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29464,42 +27842,25 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, return res0, res1 } default: - return nil, errors.New("context to binding.URITree: context fn GetValue: expected function") + return nil, errors.New("context to binding.URITree: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Prepend"] + ctxObj3, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.URITree: expected context to have function Prepend") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 3 { - return nil, errors.New("context to binding.URITree: context fn Prepend: function has invalid number of arguments (expected 3)") + return nil, errors.New("context to binding.URITree: context fn Prepend: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 string, arg1 string, arg2 fyne.URI) error { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) - { - typ := reflect.TypeOf(arg2) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg2Val = *env.NewNative(ps.Idx, arg2, typRyeName) - } else { - arg2Val = *env.NewNative(ps.Idx, arg2, "Go(fyne.URI)") - } - } + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 string, farg1 string, farg2 fyne.URI) error { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) + farg2Val = ifaceToNative(ps.Idx, farg2, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val, farg2Val) var res error switch v := ps.Res.(type) { case env.String: @@ -29508,8 +27869,9 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.URITree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29517,8 +27879,9 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected error, string or nil", + "context to binding.URITree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29527,22 +27890,22 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, return res } default: - return nil, errors.New("context to binding.URITree: context fn Prepend: expected function") + return nil, errors.New("context to binding.URITree: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Set"] + ctxObj4, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.URITree: expected context to have function Set") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.URITree: context fn Set: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.URITree: context fn Set: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 map[string][]string, arg1 map[string]fyne.URI) error { - var arg0Val, arg1Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 map[string][]string, farg1 map[string]fyne.URI) error { + var farg0Val, farg1Val env.Object { - data := make(map[string]any, len(arg0)) - for mKey, mVal := range arg0 { + data := make(map[string]any, len(farg0)) + for mKey, mVal := range farg0 { var dVal env.Object { items := make([]env.Object, len(mVal)) @@ -29553,37 +27916,20 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, } data[mKey] = dVal } - arg0Val = *env.NewDict(data) + farg0Val = *env.NewDict(data) } { - data := make(map[string]any, len(arg1)) - for mKey, mVal := range arg1 { + data := make(map[string]any, len(farg1)) + for mKey, mVal := range farg1 { var dVal env.Object - { - typ := reflect.TypeOf(mVal) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - dVal = *env.NewNative(ps.Idx, mVal, typRyeName) - } else { - dVal = *env.NewNative(ps.Idx, mVal, "Go(fyne.URI)") - } - } + dVal = ifaceToNative(ps.Idx, mVal, "Go(fyne.URI)") data[mKey] = dVal } - arg1Val = *env.NewDict(data) + farg1Val = *env.NewDict(data) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -29592,8 +27938,9 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.URITree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29601,8 +27948,9 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected error, string or nil", + "context to binding.URITree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29611,41 +27959,24 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, return res } default: - return nil, errors.New("context to binding.URITree: context fn Set: expected function") + return nil, errors.New("context to binding.URITree: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["SetValue"] + ctxObj5, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.URITree: expected context to have function SetValue") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.URITree: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.URITree: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 string, arg1 fyne.URI) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) - { - typ := reflect.TypeOf(arg1) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg1Val = *env.NewNative(ps.Idx, arg1, typRyeName) - } else { - arg1Val = *env.NewNative(ps.Idx, arg1, "Go(fyne.URI)") - } - } + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 string, farg1 fyne.URI) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = ifaceToNative(ps.Idx, farg1, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -29654,8 +27985,9 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.URITree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29663,8 +27995,9 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected error, string or nil", + "context to binding.URITree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29673,37 +28006,39 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, return res } default: - return nil, errors.New("context to binding.URITree: context fn SetValue: expected function") + return nil, errors.New("context to binding.URITree: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["GetItem"] + ctxObj6, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.URITree: expected context to have function GetItem") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.URITree: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.URITree: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 string) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 string) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected block for multiple return values", + "context to binding.URITree: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected block with 2 return values", + "context to binding.URITree: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29714,19 +28049,21 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: "+err.Error()+"", + "context to binding.URITree: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.URITree: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29734,8 +28071,9 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.URITree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29743,8 +28081,9 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected native", + "context to binding.URITree: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29757,8 +28096,9 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.URITree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29766,8 +28106,9 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected error, string or nil", + "context to binding.URITree: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29776,54 +28117,45 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, return res0, res1 } default: - return nil, errors.New("context to binding.URITree: context fn GetItem: expected function") + return nil, errors.New("context to binding.URITree: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["ChildIDs"] + ctxObj7, ok := wordToObj["child-i-ds"] if !ok { return nil, errors.New("context to binding.URITree: expected context to have function ChildIDs") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.URITree: context fn ChildIDs: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.URITree: context fn ChildIDs: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_ChildIDs = func(ctx env.RyeCtx, arg0 string) []string { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_ChildIDs = func(ctx env.RyeCtx, farg0 string) []string { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res []string switch v := ps.Res.(type) { case env.Block: res = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - res[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + res[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: block item: expected string", + "context to binding.URITree: arg 0: callback result: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.URITree: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29831,8 +28163,9 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.URITree: arg 0: callback result: expected block, native or nil", + "context to binding.URITree: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29841,95 +28174,61 @@ func ctxTo_binding_URITree(ps *env.ProgramState, v env.RyeCtx) (binding.URITree, return res } default: - return nil, errors.New("context to binding.URITree: context fn ChildIDs: expected function") + return nil, errors.New("context to binding.URITree: context fn ChildIDs: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["AddListener"] + ctxObj8, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.URITree: expected context to have function AddListener") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.URITree: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.URITree: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.URITree: context fn AddListener: expected function") + return nil, errors.New("context to binding.URITree: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["RemoveListener"] + ctxObj9, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.URITree: expected context to have function RemoveListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.URITree: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.URITree: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.URITree: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.URITree: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } type iface_binding_Untyped struct { self env.RyeCtx - fn_Get func(self env.RyeCtx) (any, error) - fn_Set func(self env.RyeCtx, arg0 any) error + fn_Get func(self env.RyeCtx) (interface{}, error) + fn_Set func(self env.RyeCtx, arg0 interface{}) error fn_AddListener func(self env.RyeCtx, arg0 binding.DataListener) fn_RemoveListener func(self env.RyeCtx, arg0 binding.DataListener) } -func (self *iface_binding_Untyped) Get() (any, error) { +func (self *iface_binding_Untyped) Get() (interface{}, error) { return self.fn_Get(self.self) } -func (self *iface_binding_Untyped) Set(arg0 any) error { +func (self *iface_binding_Untyped) Set(arg0 interface{}) error { return self.fn_Set(self.self, arg0) } func (self *iface_binding_Untyped) AddListener(arg0 binding.DataListener) { @@ -29957,33 +28256,35 @@ func ctxTo_binding_Untyped(ps *env.ProgramState, v env.RyeCtx) (binding.Untyped, impl := &iface_binding_Untyped{ self: v, } - ctxObj0, ok := wordToObj["Get"] + ctxObj0, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.Untyped: expected context to have function Get") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.Untyped: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.Untyped: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Get = func(ctx env.RyeCtx) (any, error) { + impl.fn_Get = func(ctx env.RyeCtx) (interface{}, error) { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) - var res0 any + var res0 interface{} var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Untyped: arg 0: callback result: expected block for multiple return values", + "context to binding.Untyped: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Untyped: arg 0: callback result: expected block with 2 return values", + "context to binding.Untyped: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -29991,19 +28292,21 @@ func ctxTo_binding_Untyped(ps *env.ProgramState, v env.RyeCtx) (binding.Untyped, } switch v := res.Series.S[0].(type) { case env.Native: - var ok bool - res0, ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Untyped: arg 0: callback result: expected native of type any", + "context to binding.Untyped: arg 0: callback result: "+"expected native of type interface{}, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Untyped: arg 0: callback result: expected native", + "context to binding.Untyped: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30016,8 +28319,9 @@ func ctxTo_binding_Untyped(ps *env.ProgramState, v env.RyeCtx) (binding.Untyped, res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Untyped: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.Untyped: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30025,8 +28329,9 @@ func ctxTo_binding_Untyped(ps *env.ProgramState, v env.RyeCtx) (binding.Untyped, } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Untyped: arg 0: callback result: expected error, string or nil", + "context to binding.Untyped: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30035,23 +28340,23 @@ func ctxTo_binding_Untyped(ps *env.ProgramState, v env.RyeCtx) (binding.Untyped, return res0, res1 } default: - return nil, errors.New("context to binding.Untyped: context fn Get: expected function") + return nil, errors.New("context to binding.Untyped: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Set"] + ctxObj1, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.Untyped: expected context to have function Set") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.Untyped: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.Untyped: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 any) error { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(any)") + impl.fn_Set = func(ctx env.RyeCtx, farg0 interface{}) error { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(interface{})") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -30060,8 +28365,9 @@ func ctxTo_binding_Untyped(ps *env.ProgramState, v env.RyeCtx) (binding.Untyped, res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Untyped: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.Untyped: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30069,8 +28375,9 @@ func ctxTo_binding_Untyped(ps *env.ProgramState, v env.RyeCtx) (binding.Untyped, } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.Untyped: arg 0: callback result: expected error, string or nil", + "context to binding.Untyped: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30079,113 +28386,79 @@ func ctxTo_binding_Untyped(ps *env.ProgramState, v env.RyeCtx) (binding.Untyped, return res } default: - return nil, errors.New("context to binding.Untyped: context fn Set: expected function") + return nil, errors.New("context to binding.Untyped: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["AddListener"] + ctxObj2, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.Untyped: expected context to have function AddListener") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.Untyped: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.Untyped: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.Untyped: context fn AddListener: expected function") + return nil, errors.New("context to binding.Untyped: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["RemoveListener"] + ctxObj3, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.Untyped: expected context to have function RemoveListener") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.Untyped: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.Untyped: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.Untyped: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.Untyped: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } type iface_binding_UntypedList struct { self env.RyeCtx - fn_Append func(self env.RyeCtx, arg0 any) error - fn_Get func(self env.RyeCtx) ([]any, error) - fn_GetValue func(self env.RyeCtx, arg0 int) (any, error) - fn_Prepend func(self env.RyeCtx, arg0 any) error - fn_Set func(self env.RyeCtx, arg0 []any) error - fn_SetValue func(self env.RyeCtx, arg0 int, arg1 any) error + fn_Append func(self env.RyeCtx, arg0 interface{}) error + fn_Get func(self env.RyeCtx) ([]interface{}, error) + fn_GetValue func(self env.RyeCtx, arg0 int) (interface{}, error) + fn_Prepend func(self env.RyeCtx, arg0 interface{}) error + fn_Set func(self env.RyeCtx, arg0 []interface{}) error + fn_SetValue func(self env.RyeCtx, arg0 int, arg1 interface{}) error fn_GetItem func(self env.RyeCtx, arg0 int) (binding.DataItem, error) fn_Length func(self env.RyeCtx) int fn_AddListener func(self env.RyeCtx, arg0 binding.DataListener) fn_RemoveListener func(self env.RyeCtx, arg0 binding.DataListener) } -func (self *iface_binding_UntypedList) Append(arg0 any) error { +func (self *iface_binding_UntypedList) Append(arg0 interface{}) error { return self.fn_Append(self.self, arg0) } -func (self *iface_binding_UntypedList) Get() ([]any, error) { +func (self *iface_binding_UntypedList) Get() ([]interface{}, error) { return self.fn_Get(self.self) } -func (self *iface_binding_UntypedList) GetValue(arg0 int) (any, error) { +func (self *iface_binding_UntypedList) GetValue(arg0 int) (interface{}, error) { return self.fn_GetValue(self.self, arg0) } -func (self *iface_binding_UntypedList) Prepend(arg0 any) error { +func (self *iface_binding_UntypedList) Prepend(arg0 interface{}) error { return self.fn_Prepend(self.self, arg0) } -func (self *iface_binding_UntypedList) Set(arg0 []any) error { +func (self *iface_binding_UntypedList) Set(arg0 []interface{}) error { return self.fn_Set(self.self, arg0) } -func (self *iface_binding_UntypedList) SetValue(arg0 int, arg1 any) error { +func (self *iface_binding_UntypedList) SetValue(arg0 int, arg1 interface{}) error { return self.fn_SetValue(self.self, arg0, arg1) } func (self *iface_binding_UntypedList) GetItem(arg0 int) (binding.DataItem, error) { @@ -30219,21 +28492,21 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty impl := &iface_binding_UntypedList{ self: v, } - ctxObj0, ok := wordToObj["Append"] + ctxObj0, ok := wordToObj["append"] if !ok { return nil, errors.New("context to binding.UntypedList: expected context to have function Append") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.UntypedList: context fn Append: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.UntypedList: context fn Append: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Append = func(ctx env.RyeCtx, arg0 any) error { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(any)") + impl.fn_Append = func(ctx env.RyeCtx, farg0 interface{}) error { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(interface{})") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -30242,8 +28515,9 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.UntypedList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30251,8 +28525,9 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: expected error, string or nil", + "context to binding.UntypedList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30261,35 +28536,37 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty return res } default: - return nil, errors.New("context to binding.UntypedList: context fn Append: expected function") + return nil, errors.New("context to binding.UntypedList: context fn Append: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Get"] + ctxObj1, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.UntypedList: expected context to have function Get") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.UntypedList: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.UntypedList: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Get = func(ctx env.RyeCtx) ([]any, error) { + impl.fn_Get = func(ctx env.RyeCtx) ([]interface{}, error) { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) - var res0 []any + var res0 []interface{} var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: expected block for multiple return values", + "context to binding.UntypedList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: expected block with 2 return values", + "context to binding.UntypedList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30297,44 +28574,36 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty } switch v := res.Series.S[0].(type) { case env.Block: - res0 = make([]any, len(v.Series.S)) + res0 = make([]interface{}, len(v.Series.S)) for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - res0[i], ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + res0[i] = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: block item: expected native of type any", + "context to binding.UntypedList: arg 0: callback result: "+"block item: "+"expected native of type interface{}, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: block item: expected native", + "context to binding.UntypedList: arg 0: callback result: "+"block item: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } } - case env.Native: - var ok bool - res0, ok = v.Value.([]any) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: expected native of type []any", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.UntypedList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30342,8 +28611,9 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: expected block, native or nil", + "context to binding.UntypedList: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30356,8 +28626,9 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.UntypedList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30365,8 +28636,9 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: expected error, string or nil", + "context to binding.UntypedList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30375,37 +28647,39 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty return res0, res1 } default: - return nil, errors.New("context to binding.UntypedList: context fn Get: expected function") + return nil, errors.New("context to binding.UntypedList: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["GetValue"] + ctxObj2, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.UntypedList: expected context to have function GetValue") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.UntypedList: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.UntypedList: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 int) (any, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 int) (interface{}, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) - var res0 any + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) + var res0 interface{} var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: expected block for multiple return values", + "context to binding.UntypedList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: expected block with 2 return values", + "context to binding.UntypedList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30413,19 +28687,21 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty } switch v := res.Series.S[0].(type) { case env.Native: - var ok bool - res0, ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: expected native of type any", + "context to binding.UntypedList: arg 0: callback result: "+"expected native of type interface{}, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: expected native", + "context to binding.UntypedList: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30438,8 +28714,9 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.UntypedList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30447,8 +28724,9 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: expected error, string or nil", + "context to binding.UntypedList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30457,23 +28735,23 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty return res0, res1 } default: - return nil, errors.New("context to binding.UntypedList: context fn GetValue: expected function") + return nil, errors.New("context to binding.UntypedList: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Prepend"] + ctxObj3, ok := wordToObj["prepend"] if !ok { return nil, errors.New("context to binding.UntypedList: expected context to have function Prepend") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.UntypedList: context fn Prepend: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.UntypedList: context fn Prepend: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Prepend = func(ctx env.RyeCtx, arg0 any) error { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(any)") + impl.fn_Prepend = func(ctx env.RyeCtx, farg0 interface{}) error { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(interface{})") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -30482,8 +28760,9 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.UntypedList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30491,8 +28770,9 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: expected error, string or nil", + "context to binding.UntypedList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30501,29 +28781,29 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty return res } default: - return nil, errors.New("context to binding.UntypedList: context fn Prepend: expected function") + return nil, errors.New("context to binding.UntypedList: context fn Prepend: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Set"] + ctxObj4, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.UntypedList: expected context to have function Set") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.UntypedList: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.UntypedList: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 []any) error { - var arg0Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 []interface{}) error { + var farg0Val env.Object { - items := make([]env.Object, len(arg0)) - for i, it := range arg0 { - items[i] = *env.NewNative(ps.Idx, it, "Go(any)") + items := make([]env.Object, len(farg0)) + for i, it := range farg0 { + items[i] = *env.NewNative(ps.Idx, it, "Go(interface{})") } - arg0Val = *env.NewBlock(*env.NewTSeries(items)) + farg0Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -30532,8 +28812,9 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.UntypedList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30541,8 +28822,9 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: expected error, string or nil", + "context to binding.UntypedList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30551,24 +28833,24 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty return res } default: - return nil, errors.New("context to binding.UntypedList: context fn Set: expected function") + return nil, errors.New("context to binding.UntypedList: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["SetValue"] + ctxObj5, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.UntypedList: expected context to have function SetValue") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.UntypedList: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.UntypedList: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 int, arg1 any) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) - arg1Val = *env.NewNative(ps.Idx, arg1, "Go(any)") + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 int, farg1 interface{}) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) + farg1Val = *env.NewNative(ps.Idx, farg1, "Go(interface{})") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -30577,8 +28859,9 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.UntypedList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30586,8 +28869,9 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: expected error, string or nil", + "context to binding.UntypedList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30596,37 +28880,39 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty return res } default: - return nil, errors.New("context to binding.UntypedList: context fn SetValue: expected function") + return nil, errors.New("context to binding.UntypedList: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["GetItem"] + ctxObj6, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.UntypedList: expected context to have function GetItem") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.UntypedList: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.UntypedList: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 int) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 int) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: expected block for multiple return values", + "context to binding.UntypedList: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: expected block with 2 return values", + "context to binding.UntypedList: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30637,19 +28923,21 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: "+err.Error()+"", + "context to binding.UntypedList: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.UntypedList: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30657,8 +28945,9 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.UntypedList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30666,8 +28955,9 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: expected native", + "context to binding.UntypedList: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30680,8 +28970,9 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.UntypedList: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30689,8 +28980,9 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: expected error, string or nil", + "context to binding.UntypedList: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30699,27 +28991,28 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty return res0, res1 } default: - return nil, errors.New("context to binding.UntypedList: context fn GetItem: expected function") + return nil, errors.New("context to binding.UntypedList: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["Length"] + ctxObj7, ok := wordToObj["length"] if !ok { return nil, errors.New("context to binding.UntypedList: expected context to have function Length") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.UntypedList: context fn Length: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.UntypedList: context fn Length: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Length = func(ctx env.RyeCtx) int { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res int - if v, ok := ps.Res.(env.Integer); ok { - res = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + res = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedList: arg 0: callback result: expected integer", + "context to binding.UntypedList: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30728,79 +29021,45 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty return res } default: - return nil, errors.New("context to binding.UntypedList: context fn Length: expected function") + return nil, errors.New("context to binding.UntypedList: context fn Length: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["AddListener"] + ctxObj8, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.UntypedList: expected context to have function AddListener") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.UntypedList: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.UntypedList: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.UntypedList: context fn AddListener: expected function") + return nil, errors.New("context to binding.UntypedList: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["RemoveListener"] + ctxObj9, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.UntypedList: expected context to have function RemoveListener") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.UntypedList: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.UntypedList: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.UntypedList: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.UntypedList: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -30808,10 +29067,10 @@ func ctxTo_binding_UntypedList(ps *env.ProgramState, v env.RyeCtx) (binding.Unty type iface_binding_UntypedMap struct { self env.RyeCtx fn_Delete func(self env.RyeCtx, arg0 string) - fn_Get func(self env.RyeCtx) (map[string]any, error) - fn_GetValue func(self env.RyeCtx, arg0 string) (any, error) - fn_Set func(self env.RyeCtx, arg0 map[string]any) error - fn_SetValue func(self env.RyeCtx, arg0 string, arg1 any) error + fn_Get func(self env.RyeCtx) (map[string]interface{}, error) + fn_GetValue func(self env.RyeCtx, arg0 string) (interface{}, error) + fn_Set func(self env.RyeCtx, arg0 map[string]interface{}) error + fn_SetValue func(self env.RyeCtx, arg0 string, arg1 interface{}) error fn_GetItem func(self env.RyeCtx, arg0 string) (binding.DataItem, error) fn_Keys func(self env.RyeCtx) []string fn_AddListener func(self env.RyeCtx, arg0 binding.DataListener) @@ -30821,16 +29080,16 @@ type iface_binding_UntypedMap struct { func (self *iface_binding_UntypedMap) Delete(arg0 string) { self.fn_Delete(self.self, arg0) } -func (self *iface_binding_UntypedMap) Get() (map[string]any, error) { +func (self *iface_binding_UntypedMap) Get() (map[string]interface{}, error) { return self.fn_Get(self.self) } -func (self *iface_binding_UntypedMap) GetValue(arg0 string) (any, error) { +func (self *iface_binding_UntypedMap) GetValue(arg0 string) (interface{}, error) { return self.fn_GetValue(self.self, arg0) } -func (self *iface_binding_UntypedMap) Set(arg0 map[string]any) error { +func (self *iface_binding_UntypedMap) Set(arg0 map[string]interface{}) error { return self.fn_Set(self.self, arg0) } -func (self *iface_binding_UntypedMap) SetValue(arg0 string, arg1 any) error { +func (self *iface_binding_UntypedMap) SetValue(arg0 string, arg1 interface{}) error { return self.fn_SetValue(self.self, arg0, arg1) } func (self *iface_binding_UntypedMap) GetItem(arg0 string) (binding.DataItem, error) { @@ -30864,52 +29123,54 @@ func ctxTo_binding_UntypedMap(ps *env.ProgramState, v env.RyeCtx) (binding.Untyp impl := &iface_binding_UntypedMap{ self: v, } - ctxObj0, ok := wordToObj["Delete"] + ctxObj0, ok := wordToObj["delete"] if !ok { return nil, errors.New("context to binding.UntypedMap: expected context to have function Delete") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.UntypedMap: context fn Delete: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.UntypedMap: context fn Delete: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Delete = func(ctx env.RyeCtx, arg0 string) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_Delete = func(ctx env.RyeCtx, farg0 string) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.UntypedMap: context fn Delete: expected function") + return nil, errors.New("context to binding.UntypedMap: context fn Delete: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Get"] + ctxObj1, ok := wordToObj["get"] if !ok { return nil, errors.New("context to binding.UntypedMap: expected context to have function Get") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.UntypedMap: context fn Get: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.UntypedMap: context fn Get: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Get = func(ctx env.RyeCtx) (map[string]any, error) { + impl.fn_Get = func(ctx env.RyeCtx) (map[string]interface{}, error) { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) - var res0 map[string]any + var res0 map[string]interface{} var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: expected block for multiple return values", + "context to binding.UntypedMap: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: expected block with 2 return values", + "context to binding.UntypedMap: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30918,42 +29179,46 @@ func ctxTo_binding_UntypedMap(ps *env.ProgramState, v env.RyeCtx) (binding.Untyp switch v := res.Series.S[0].(type) { case env.Block: if len(v.Series.S)%2 != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: expected block to have length of multiple of 2", + "context to binding.UntypedMap: arg 0: callback result: "+"expected block to have length of multiple of 2, but got block with length "+strconv.Itoa(len(v.Series.S)), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - res0 = make(map[string]any, len(v.Series.S)/2) + res0 = make(map[string]interface{}, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: map key: expected string", + "context to binding.UntypedMap: arg 0: callback result: "+"map key: "+"expected string, but got "+objectDebugString(ps.Idx, v.Series.S[i+0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - var mapV any + var mapV interface{} switch v := v.Series.S[i+1].(type) { case env.Native: - var ok bool - mapV, ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + mapV = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: map value: expected native of type any", + "context to binding.UntypedMap: arg 0: callback result: "+"map value: "+"expected native of type interface{}, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: map value: expected native", + "context to binding.UntypedMap: arg 0: callback result: "+"map value: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30962,25 +29227,27 @@ func ctxTo_binding_UntypedMap(ps *env.ProgramState, v env.RyeCtx) (binding.Untyp res0[mapK] = mapV } case env.Dict: - res0 = make(map[string]any, len(v.Data)) + res0 = make(map[string]interface{}, len(v.Data)) for dictK, dictV := range v.Data { mapK := dictK - var mapV any + var mapV interface{} switch v := dictV.(type) { case env.Native: - var ok bool - mapV, ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + mapV = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: map value: expected native of type any", + "context to binding.UntypedMap: arg 0: callback result: "+"map value: "+"expected native of type interface{}, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: map value: expected native", + "context to binding.UntypedMap: arg 0: callback result: "+"map value: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -30988,21 +29255,11 @@ func ctxTo_binding_UntypedMap(ps *env.ProgramState, v env.RyeCtx) (binding.Untyp } res0[mapK] = mapV } - case env.Native: - var ok bool - res0, ok = v.Value.(map[string]any) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: expected native of type map[string]any", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.UntypedMap: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -31010,8 +29267,9 @@ func ctxTo_binding_UntypedMap(ps *env.ProgramState, v env.RyeCtx) (binding.Untyp } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: expected native, block, dict or nil", + "context to binding.UntypedMap: arg 0: callback result: "+"expected block, dict or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -31024,8 +29282,9 @@ func ctxTo_binding_UntypedMap(ps *env.ProgramState, v env.RyeCtx) (binding.Untyp res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.UntypedMap: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -31033,8 +29292,9 @@ func ctxTo_binding_UntypedMap(ps *env.ProgramState, v env.RyeCtx) (binding.Untyp } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: expected error, string or nil", + "context to binding.UntypedMap: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -31043,37 +29303,39 @@ func ctxTo_binding_UntypedMap(ps *env.ProgramState, v env.RyeCtx) (binding.Untyp return res0, res1 } default: - return nil, errors.New("context to binding.UntypedMap: context fn Get: expected function") + return nil, errors.New("context to binding.UntypedMap: context fn Get: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["GetValue"] + ctxObj2, ok := wordToObj["get-value"] if !ok { return nil, errors.New("context to binding.UntypedMap: expected context to have function GetValue") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.UntypedMap: context fn GetValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.UntypedMap: context fn GetValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetValue = func(ctx env.RyeCtx, arg0 string) (any, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetValue = func(ctx env.RyeCtx, farg0 string) (interface{}, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) - var res0 any + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) + var res0 interface{} var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: expected block for multiple return values", + "context to binding.UntypedMap: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: expected block with 2 return values", + "context to binding.UntypedMap: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -31081,19 +29343,21 @@ func ctxTo_binding_UntypedMap(ps *env.ProgramState, v env.RyeCtx) (binding.Untyp } switch v := res.Series.S[0].(type) { case env.Native: - var ok bool - res0, ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: expected native of type any", + "context to binding.UntypedMap: arg 0: callback result: "+"expected native of type interface{}, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: expected native", + "context to binding.UntypedMap: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -31106,8 +29370,9 @@ func ctxTo_binding_UntypedMap(ps *env.ProgramState, v env.RyeCtx) (binding.Untyp res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.UntypedMap: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -31115,8 +29380,9 @@ func ctxTo_binding_UntypedMap(ps *env.ProgramState, v env.RyeCtx) (binding.Untyp } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: expected error, string or nil", + "context to binding.UntypedMap: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -31125,31 +29391,31 @@ func ctxTo_binding_UntypedMap(ps *env.ProgramState, v env.RyeCtx) (binding.Untyp return res0, res1 } default: - return nil, errors.New("context to binding.UntypedMap: context fn GetValue: expected function") + return nil, errors.New("context to binding.UntypedMap: context fn GetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Set"] + ctxObj3, ok := wordToObj["set"] if !ok { return nil, errors.New("context to binding.UntypedMap: expected context to have function Set") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.UntypedMap: context fn Set: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.UntypedMap: context fn Set: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Set = func(ctx env.RyeCtx, arg0 map[string]any) error { - var arg0Val env.Object + impl.fn_Set = func(ctx env.RyeCtx, farg0 map[string]interface{}) error { + var farg0Val env.Object { - data := make(map[string]any, len(arg0)) - for mKey, mVal := range arg0 { + data := make(map[string]any, len(farg0)) + for mKey, mVal := range farg0 { var dVal env.Object - dVal = *env.NewNative(ps.Idx, mVal, "Go(any)") + dVal = *env.NewNative(ps.Idx, mVal, "Go(interface{})") data[mKey] = dVal } - arg0Val = *env.NewDict(data) + farg0Val = *env.NewDict(data) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -31158,8 +29424,9 @@ func ctxTo_binding_UntypedMap(ps *env.ProgramState, v env.RyeCtx) (binding.Untyp res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.UntypedMap: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -31167,8 +29434,9 @@ func ctxTo_binding_UntypedMap(ps *env.ProgramState, v env.RyeCtx) (binding.Untyp } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: expected error, string or nil", + "context to binding.UntypedMap: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -31177,24 +29445,24 @@ func ctxTo_binding_UntypedMap(ps *env.ProgramState, v env.RyeCtx) (binding.Untyp return res } default: - return nil, errors.New("context to binding.UntypedMap: context fn Set: expected function") + return nil, errors.New("context to binding.UntypedMap: context fn Set: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["SetValue"] + ctxObj4, ok := wordToObj["set-value"] if !ok { return nil, errors.New("context to binding.UntypedMap: expected context to have function SetValue") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to binding.UntypedMap: context fn SetValue: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to binding.UntypedMap: context fn SetValue: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetValue = func(ctx env.RyeCtx, arg0 string, arg1 any) error { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewNative(ps.Idx, arg1, "Go(any)") + impl.fn_SetValue = func(ctx env.RyeCtx, farg0 string, farg1 interface{}) error { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewNative(ps.Idx, farg1, "Go(interface{})") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -31203,8 +29471,9 @@ func ctxTo_binding_UntypedMap(ps *env.ProgramState, v env.RyeCtx) (binding.Untyp res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.UntypedMap: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -31212,8 +29481,9 @@ func ctxTo_binding_UntypedMap(ps *env.ProgramState, v env.RyeCtx) (binding.Untyp } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: expected error, string or nil", + "context to binding.UntypedMap: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -31222,37 +29492,39 @@ func ctxTo_binding_UntypedMap(ps *env.ProgramState, v env.RyeCtx) (binding.Untyp return res } default: - return nil, errors.New("context to binding.UntypedMap: context fn SetValue: expected function") + return nil, errors.New("context to binding.UntypedMap: context fn SetValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["GetItem"] + ctxObj5, ok := wordToObj["get-item"] if !ok { return nil, errors.New("context to binding.UntypedMap: expected context to have function GetItem") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.UntypedMap: context fn GetItem: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.UntypedMap: context fn GetItem: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_GetItem = func(ctx env.RyeCtx, arg0 string) (binding.DataItem, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_GetItem = func(ctx env.RyeCtx, farg0 string) (binding.DataItem, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 binding.DataItem var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: expected block for multiple return values", + "context to binding.UntypedMap: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: expected block with 2 return values", + "context to binding.UntypedMap: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -31263,19 +29535,21 @@ func ctxTo_binding_UntypedMap(ps *env.ProgramState, v env.RyeCtx) (binding.Untyp var err error res0, err = ctxTo_binding_DataItem(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: "+err.Error()+"", + "context to binding.UntypedMap: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: expected native of type binding.DataItem", + "context to binding.UntypedMap: arg 0: callback result: "+"expected native of type binding.DataItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -31283,8 +29557,9 @@ func ctxTo_binding_UntypedMap(ps *env.ProgramState, v env.RyeCtx) (binding.Untyp } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.UntypedMap: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -31292,8 +29567,9 @@ func ctxTo_binding_UntypedMap(ps *env.ProgramState, v env.RyeCtx) (binding.Untyp } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: expected native", + "context to binding.UntypedMap: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -31306,8 +29582,9 @@ func ctxTo_binding_UntypedMap(ps *env.ProgramState, v env.RyeCtx) (binding.Untyp res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.UntypedMap: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -31315,8 +29592,9 @@ func ctxTo_binding_UntypedMap(ps *env.ProgramState, v env.RyeCtx) (binding.Untyp } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: expected error, string or nil", + "context to binding.UntypedMap: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -31325,16 +29603,16 @@ func ctxTo_binding_UntypedMap(ps *env.ProgramState, v env.RyeCtx) (binding.Untyp return res0, res1 } default: - return nil, errors.New("context to binding.UntypedMap: context fn GetItem: expected function") + return nil, errors.New("context to binding.UntypedMap: context fn GetItem: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["Keys"] + ctxObj6, ok := wordToObj["keys"] if !ok { return nil, errors.New("context to binding.UntypedMap: expected context to have function Keys") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to binding.UntypedMap: context fn Keys: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to binding.UntypedMap: context fn Keys: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Keys = func(ctx env.RyeCtx) []string { actualFn := fn @@ -31345,32 +29623,23 @@ func ctxTo_binding_UntypedMap(ps *env.ProgramState, v env.RyeCtx) (binding.Untyp case env.Block: res = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - res[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + res[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: block item: expected string", + "context to binding.UntypedMap: arg 0: callback result: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: expected integer to be 0 or nil", + "context to binding.UntypedMap: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -31378,8 +29647,9 @@ func ctxTo_binding_UntypedMap(ps *env.ProgramState, v env.RyeCtx) (binding.Untyp } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to binding.UntypedMap: arg 0: callback result: expected block, native or nil", + "context to binding.UntypedMap: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -31388,79 +29658,45 @@ func ctxTo_binding_UntypedMap(ps *env.ProgramState, v env.RyeCtx) (binding.Untyp return res } default: - return nil, errors.New("context to binding.UntypedMap: context fn Keys: expected function") + return nil, errors.New("context to binding.UntypedMap: context fn Keys: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["AddListener"] + ctxObj7, ok := wordToObj["add-listener"] if !ok { return nil, errors.New("context to binding.UntypedMap: expected context to have function AddListener") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.UntypedMap: context fn AddListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.UntypedMap: context fn AddListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_AddListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.UntypedMap: context fn AddListener: expected function") + return nil, errors.New("context to binding.UntypedMap: context fn AddListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["RemoveListener"] + ctxObj8, ok := wordToObj["remove-listener"] if !ok { return nil, errors.New("context to binding.UntypedMap: expected context to have function RemoveListener") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to binding.UntypedMap: context fn RemoveListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to binding.UntypedMap: context fn RemoveListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveListener = func(ctx env.RyeCtx, arg0 binding.DataListener) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataListener)") - } - } + impl.fn_RemoveListener = func(ctx env.RyeCtx, farg0 binding.DataListener) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataListener)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to binding.UntypedMap: context fn RemoveListener: expected function") + return nil, errors.New("context to binding.UntypedMap: context fn RemoveListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -31496,60 +29732,43 @@ func ctxTo_desktop_App(ps *env.ProgramState, v env.RyeCtx) (desktop.App, error) impl := &iface_desktop_App{ self: v, } - ctxObj0, ok := wordToObj["SetSystemTrayMenu"] + ctxObj0, ok := wordToObj["set-system-tray-menu"] if !ok { return nil, errors.New("context to desktop.App: expected context to have function SetSystemTrayMenu") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to desktop.App: context fn SetSystemTrayMenu: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to desktop.App: context fn SetSystemTrayMenu: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetSystemTrayMenu = func(ctx env.RyeCtx, arg0 *fyne.Menu) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*fyne.Menu)") + impl.fn_SetSystemTrayMenu = func(ctx env.RyeCtx, farg0 *fyne.Menu) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*fyne.Menu)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to desktop.App: context fn SetSystemTrayMenu: expected function") + return nil, errors.New("context to desktop.App: context fn SetSystemTrayMenu: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["SetSystemTrayIcon"] + ctxObj1, ok := wordToObj["set-system-tray-icon"] if !ok { return nil, errors.New("context to desktop.App: expected context to have function SetSystemTrayIcon") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to desktop.App: context fn SetSystemTrayIcon: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to desktop.App: context fn SetSystemTrayIcon: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetSystemTrayIcon = func(ctx env.RyeCtx, arg0 fyne.Resource) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.Resource)") - } - } + impl.fn_SetSystemTrayIcon = func(ctx env.RyeCtx, farg0 fyne.Resource) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.Resource)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to desktop.App: context fn SetSystemTrayIcon: expected function") + return nil, errors.New("context to desktop.App: context fn SetSystemTrayIcon: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -31593,14 +29812,14 @@ func ctxTo_desktop_Canvas(ps *env.ProgramState, v env.RyeCtx) (desktop.Canvas, e impl := &iface_desktop_Canvas{ self: v, } - ctxObj0, ok := wordToObj["OnKeyDown"] + ctxObj0, ok := wordToObj["on-key-down"] if !ok { return nil, errors.New("context to desktop.Canvas: expected context to have function OnKeyDown") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to desktop.Canvas: context fn OnKeyDown: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to desktop.Canvas: context fn OnKeyDown: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_OnKeyDown = func(ctx env.RyeCtx) func(*fyne.KeyEvent) { actualFn := fn @@ -31610,24 +29829,26 @@ func ctxTo_desktop_Canvas(ps *env.ProgramState, v env.RyeCtx) (desktop.Canvas, e switch fn := ps.Res.(type) { case env.Function: if fn.Argsn != 1 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to desktop.Canvas: arg 0: callback result: function has invalid number of arguments (expected 1)", + "context to desktop.Canvas: arg 0: callback result: "+"expected 1 function arguments, but got "+strconv.Itoa(fn.Argsn), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } - res = func(arg0 *fyne.KeyEvent) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*fyne.KeyEvent)") + res = func(farg0 *fyne.KeyEvent) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*fyne.KeyEvent)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to desktop.Canvas: arg 0: callback result: expected integer to be 0 or nil", + "context to desktop.Canvas: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(fn.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -31635,8 +29856,9 @@ func ctxTo_desktop_Canvas(ps *env.ProgramState, v env.RyeCtx) (desktop.Canvas, e } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to desktop.Canvas: arg 0: callback result: expected function or nil", + "context to desktop.Canvas: arg 0: callback result: "+"expected function or nil, but got "+objectDebugString(ps.Idx, fn), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -31645,35 +29867,57 @@ func ctxTo_desktop_Canvas(ps *env.ProgramState, v env.RyeCtx) (desktop.Canvas, e return res } default: - return nil, errors.New("context to desktop.Canvas: context fn OnKeyDown: expected function") + return nil, errors.New("context to desktop.Canvas: context fn OnKeyDown: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["SetOnKeyDown"] + ctxObj1, ok := wordToObj["set-on-key-down"] if !ok { return nil, errors.New("context to desktop.Canvas: expected context to have function SetOnKeyDown") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to desktop.Canvas: context fn SetOnKeyDown: function has invalid number of arguments (expected 1)") - } - impl.fn_SetOnKeyDown = func(ctx env.RyeCtx, arg0 func(*fyne.KeyEvent)) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(func(*fyne.KeyEvent))") + return nil, errors.New("context to desktop.Canvas: context fn SetOnKeyDown: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) + } + impl.fn_SetOnKeyDown = func(ctx env.RyeCtx, farg0 func(*fyne.KeyEvent)) { + var farg0Val env.Object + farg0Val = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val *fyne.KeyEvent + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + arg0Val = vc + } else { + ps.FailureFlag = true + return env.NewError("context to desktop.Canvas: arg 1: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("context to desktop.Canvas: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg0Val = nil + default: + ps.FailureFlag = true + return env.NewError("context to desktop.Canvas: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + farg0(arg0Val) + return nil + }, 1, false, false, "Returned func") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to desktop.Canvas: context fn SetOnKeyDown: expected function") + return nil, errors.New("context to desktop.Canvas: context fn SetOnKeyDown: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["OnKeyUp"] + ctxObj2, ok := wordToObj["on-key-up"] if !ok { return nil, errors.New("context to desktop.Canvas: expected context to have function OnKeyUp") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to desktop.Canvas: context fn OnKeyUp: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to desktop.Canvas: context fn OnKeyUp: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_OnKeyUp = func(ctx env.RyeCtx) func(*fyne.KeyEvent) { actualFn := fn @@ -31683,24 +29927,26 @@ func ctxTo_desktop_Canvas(ps *env.ProgramState, v env.RyeCtx) (desktop.Canvas, e switch fn := ps.Res.(type) { case env.Function: if fn.Argsn != 1 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to desktop.Canvas: arg 0: callback result: function has invalid number of arguments (expected 1)", + "context to desktop.Canvas: arg 0: callback result: "+"expected 1 function arguments, but got "+strconv.Itoa(fn.Argsn), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } - res = func(arg0 *fyne.KeyEvent) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*fyne.KeyEvent)") + res = func(farg0 *fyne.KeyEvent) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*fyne.KeyEvent)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to desktop.Canvas: arg 0: callback result: expected integer to be 0 or nil", + "context to desktop.Canvas: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(fn.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -31708,8 +29954,9 @@ func ctxTo_desktop_Canvas(ps *env.ProgramState, v env.RyeCtx) (desktop.Canvas, e } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to desktop.Canvas: arg 0: callback result: expected function or nil", + "context to desktop.Canvas: arg 0: callback result: "+"expected function or nil, but got "+objectDebugString(ps.Idx, fn), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -31718,26 +29965,48 @@ func ctxTo_desktop_Canvas(ps *env.ProgramState, v env.RyeCtx) (desktop.Canvas, e return res } default: - return nil, errors.New("context to desktop.Canvas: context fn OnKeyUp: expected function") + return nil, errors.New("context to desktop.Canvas: context fn OnKeyUp: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["SetOnKeyUp"] + ctxObj3, ok := wordToObj["set-on-key-up"] if !ok { return nil, errors.New("context to desktop.Canvas: expected context to have function SetOnKeyUp") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to desktop.Canvas: context fn SetOnKeyUp: function has invalid number of arguments (expected 1)") - } - impl.fn_SetOnKeyUp = func(ctx env.RyeCtx, arg0 func(*fyne.KeyEvent)) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(func(*fyne.KeyEvent))") + return nil, errors.New("context to desktop.Canvas: context fn SetOnKeyUp: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) + } + impl.fn_SetOnKeyUp = func(ctx env.RyeCtx, farg0 func(*fyne.KeyEvent)) { + var farg0Val env.Object + farg0Val = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val *fyne.KeyEvent + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + arg0Val = vc + } else { + ps.FailureFlag = true + return env.NewError("context to desktop.Canvas: arg 1: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("context to desktop.Canvas: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg0Val = nil + default: + ps.FailureFlag = true + return env.NewError("context to desktop.Canvas: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + farg0(arg0Val) + return nil + }, 1, false, false, "Returned func") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to desktop.Canvas: context fn SetOnKeyUp: expected function") + return nil, errors.New("context to desktop.Canvas: context fn SetOnKeyUp: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -31769,14 +30038,14 @@ func ctxTo_desktop_Cursor(ps *env.ProgramState, v env.RyeCtx) (desktop.Cursor, e impl := &iface_desktop_Cursor{ self: v, } - ctxObj0, ok := wordToObj["Image"] + ctxObj0, ok := wordToObj["image"] if !ok { return nil, errors.New("context to desktop.Cursor: expected context to have function Image") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to desktop.Cursor: context fn Image: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to desktop.Cursor: context fn Image: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Image = func(ctx env.RyeCtx) (image.Image, int, int) { actualFn := fn @@ -31787,16 +30056,18 @@ func ctxTo_desktop_Cursor(ps *env.ProgramState, v env.RyeCtx) (desktop.Cursor, e var res2 int res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to desktop.Cursor: arg 0: callback result: expected block for multiple return values", + "context to desktop.Cursor: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } if len(res.Series.S) != 3 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to desktop.Cursor: arg 0: callback result: expected block with 3 return values", + "context to desktop.Cursor: arg 0: callback result: "+"expected block with 3 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -31804,39 +30075,43 @@ func ctxTo_desktop_Cursor(ps *env.ProgramState, v env.RyeCtx) (desktop.Cursor, e } switch v := res.Series.S[0].(type) { case env.Native: - var ok bool - res0, ok = v.Value.(image.Image) - if !ok { + if vc, ok := v.Value.(image.Image); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to desktop.Cursor: arg 0: callback result: expected native of type image.Image", + "context to desktop.Cursor: arg 0: callback result: "+"expected native of type image.Image, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to desktop.Cursor: arg 0: callback result: expected native", + "context to desktop.Cursor: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } - if v, ok := res.Series.S[1].(env.Integer); ok { - res1 = int(v.Value) + if vc, ok := res.Series.S[1].(env.Integer); ok { + res1 = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to desktop.Cursor: arg 0: callback result: expected integer", + "context to desktop.Cursor: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[1]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1, res2 } - if v, ok := res.Series.S[2].(env.Integer); ok { - res2 = int(v.Value) + if vc, ok := res.Series.S[2].(env.Integer); ok { + res2 = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to desktop.Cursor: arg 0: callback result: expected integer", + "context to desktop.Cursor: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[2]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -31845,7 +30120,7 @@ func ctxTo_desktop_Cursor(ps *env.ProgramState, v env.RyeCtx) (desktop.Cursor, e return res0, res1, res2 } default: - return nil, errors.New("context to desktop.Cursor: context fn Image: expected function") + return nil, errors.New("context to desktop.Cursor: context fn Image: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -31877,14 +30152,14 @@ func ctxTo_desktop_Cursorable(ps *env.ProgramState, v env.RyeCtx) (desktop.Curso impl := &iface_desktop_Cursorable{ self: v, } - ctxObj0, ok := wordToObj["Cursor"] + ctxObj0, ok := wordToObj["cursor"] if !ok { return nil, errors.New("context to desktop.Cursorable: expected context to have function Cursor") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to desktop.Cursorable: context fn Cursor: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to desktop.Cursorable: context fn Cursor: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Cursor = func(ctx env.RyeCtx) desktop.Cursor { actualFn := fn @@ -31896,19 +30171,21 @@ func ctxTo_desktop_Cursorable(ps *env.ProgramState, v env.RyeCtx) (desktop.Curso var err error res, err = ctxTo_desktop_Cursor(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to desktop.Cursorable: arg 0: callback result: "+err.Error()+"", + "context to desktop.Cursorable: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(desktop.Cursor) - if !ok { + if vc, ok := v.Value.(desktop.Cursor); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to desktop.Cursorable: arg 0: callback result: expected native of type desktop.Cursor", + "context to desktop.Cursorable: arg 0: callback result: "+"expected native of type desktop.Cursor, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -31916,8 +30193,9 @@ func ctxTo_desktop_Cursorable(ps *env.ProgramState, v env.RyeCtx) (desktop.Curso } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to desktop.Cursorable: arg 0: callback result: expected integer to be 0 or nil", + "context to desktop.Cursorable: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -31925,8 +30203,9 @@ func ctxTo_desktop_Cursorable(ps *env.ProgramState, v env.RyeCtx) (desktop.Curso } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to desktop.Cursorable: arg 0: callback result: expected native", + "context to desktop.Cursorable: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -31935,7 +30214,7 @@ func ctxTo_desktop_Cursorable(ps *env.ProgramState, v env.RyeCtx) (desktop.Curso return res } default: - return nil, errors.New("context to desktop.Cursorable: context fn Cursor: expected function") + return nil, errors.New("context to desktop.Cursorable: context fn Cursor: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -31971,14 +30250,14 @@ func ctxTo_desktop_Driver(ps *env.ProgramState, v env.RyeCtx) (desktop.Driver, e impl := &iface_desktop_Driver{ self: v, } - ctxObj0, ok := wordToObj["CreateSplashWindow"] + ctxObj0, ok := wordToObj["create-splash-window"] if !ok { return nil, errors.New("context to desktop.Driver: expected context to have function CreateSplashWindow") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to desktop.Driver: context fn CreateSplashWindow: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to desktop.Driver: context fn CreateSplashWindow: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_CreateSplashWindow = func(ctx env.RyeCtx) fyne.Window { actualFn := fn @@ -31990,19 +30269,21 @@ func ctxTo_desktop_Driver(ps *env.ProgramState, v env.RyeCtx) (desktop.Driver, e var err error res, err = ctxTo_fyne_Window(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to desktop.Driver: arg 0: callback result: "+err.Error()+"", + "context to desktop.Driver: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to desktop.Driver: arg 0: callback result: expected native of type fyne.Window", + "context to desktop.Driver: arg 0: callback result: "+"expected native of type fyne.Window, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -32010,8 +30291,9 @@ func ctxTo_desktop_Driver(ps *env.ProgramState, v env.RyeCtx) (desktop.Driver, e } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to desktop.Driver: arg 0: callback result: expected integer to be 0 or nil", + "context to desktop.Driver: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -32019,8 +30301,9 @@ func ctxTo_desktop_Driver(ps *env.ProgramState, v env.RyeCtx) (desktop.Driver, e } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to desktop.Driver: arg 0: callback result: expected native", + "context to desktop.Driver: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -32029,16 +30312,16 @@ func ctxTo_desktop_Driver(ps *env.ProgramState, v env.RyeCtx) (desktop.Driver, e return res } default: - return nil, errors.New("context to desktop.Driver: context fn CreateSplashWindow: expected function") + return nil, errors.New("context to desktop.Driver: context fn CreateSplashWindow: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["CurrentKeyModifiers"] + ctxObj1, ok := wordToObj["current-key-modifiers"] if !ok { return nil, errors.New("context to desktop.Driver: expected context to have function CurrentKeyModifiers") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to desktop.Driver: context fn CurrentKeyModifiers: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to desktop.Driver: context fn CurrentKeyModifiers: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_CurrentKeyModifiers = func(ctx env.RyeCtx) fyne.KeyModifier { actualFn := fn @@ -32056,11 +30339,12 @@ func ctxTo_desktop_Driver(ps *env.ProgramState, v env.RyeCtx) (desktop.Driver, e res = natVal } else { var u int - if v, ok := ps.Res.(env.Integer); ok { - u = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + u = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to desktop.Driver: arg 0: callback result: expected integer", + "context to desktop.Driver: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -32072,7 +30356,7 @@ func ctxTo_desktop_Driver(ps *env.ProgramState, v env.RyeCtx) (desktop.Driver, e return res } default: - return nil, errors.New("context to desktop.Driver: context fn CurrentKeyModifiers: expected function") + return nil, errors.New("context to desktop.Driver: context fn CurrentKeyModifiers: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -32112,52 +30396,52 @@ func ctxTo_desktop_Hoverable(ps *env.ProgramState, v env.RyeCtx) (desktop.Hovera impl := &iface_desktop_Hoverable{ self: v, } - ctxObj0, ok := wordToObj["MouseIn"] + ctxObj0, ok := wordToObj["mouse-in"] if !ok { return nil, errors.New("context to desktop.Hoverable: expected context to have function MouseIn") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to desktop.Hoverable: context fn MouseIn: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to desktop.Hoverable: context fn MouseIn: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_MouseIn = func(ctx env.RyeCtx, arg0 *desktop.MouseEvent) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*desktop.MouseEvent)") + impl.fn_MouseIn = func(ctx env.RyeCtx, farg0 *desktop.MouseEvent) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*desktop.MouseEvent)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to desktop.Hoverable: context fn MouseIn: expected function") + return nil, errors.New("context to desktop.Hoverable: context fn MouseIn: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["MouseMoved"] + ctxObj1, ok := wordToObj["mouse-moved"] if !ok { return nil, errors.New("context to desktop.Hoverable: expected context to have function MouseMoved") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to desktop.Hoverable: context fn MouseMoved: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to desktop.Hoverable: context fn MouseMoved: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_MouseMoved = func(ctx env.RyeCtx, arg0 *desktop.MouseEvent) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*desktop.MouseEvent)") + impl.fn_MouseMoved = func(ctx env.RyeCtx, farg0 *desktop.MouseEvent) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*desktop.MouseEvent)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to desktop.Hoverable: context fn MouseMoved: expected function") + return nil, errors.New("context to desktop.Hoverable: context fn MouseMoved: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["MouseOut"] + ctxObj2, ok := wordToObj["mouse-out"] if !ok { return nil, errors.New("context to desktop.Hoverable: expected context to have function MouseOut") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to desktop.Hoverable: context fn MouseOut: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to desktop.Hoverable: context fn MouseOut: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_MouseOut = func(ctx env.RyeCtx) { actualFn := fn @@ -32165,7 +30449,7 @@ func ctxTo_desktop_Hoverable(ps *env.ProgramState, v env.RyeCtx) (desktop.Hovera evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to desktop.Hoverable: context fn MouseOut: expected function") + return nil, errors.New("context to desktop.Hoverable: context fn MouseOut: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -32217,52 +30501,52 @@ func ctxTo_desktop_Keyable(ps *env.ProgramState, v env.RyeCtx) (desktop.Keyable, impl := &iface_desktop_Keyable{ self: v, } - ctxObj0, ok := wordToObj["KeyDown"] + ctxObj0, ok := wordToObj["key-down"] if !ok { return nil, errors.New("context to desktop.Keyable: expected context to have function KeyDown") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to desktop.Keyable: context fn KeyDown: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to desktop.Keyable: context fn KeyDown: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_KeyDown = func(ctx env.RyeCtx, arg0 *fyne.KeyEvent) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*fyne.KeyEvent)") + impl.fn_KeyDown = func(ctx env.RyeCtx, farg0 *fyne.KeyEvent) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*fyne.KeyEvent)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to desktop.Keyable: context fn KeyDown: expected function") + return nil, errors.New("context to desktop.Keyable: context fn KeyDown: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["KeyUp"] + ctxObj1, ok := wordToObj["key-up"] if !ok { return nil, errors.New("context to desktop.Keyable: expected context to have function KeyUp") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to desktop.Keyable: context fn KeyUp: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to desktop.Keyable: context fn KeyUp: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_KeyUp = func(ctx env.RyeCtx, arg0 *fyne.KeyEvent) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*fyne.KeyEvent)") + impl.fn_KeyUp = func(ctx env.RyeCtx, farg0 *fyne.KeyEvent) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*fyne.KeyEvent)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to desktop.Keyable: context fn KeyUp: expected function") + return nil, errors.New("context to desktop.Keyable: context fn KeyUp: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["FocusGained"] + ctxObj2, ok := wordToObj["focus-gained"] if !ok { return nil, errors.New("context to desktop.Keyable: expected context to have function FocusGained") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to desktop.Keyable: context fn FocusGained: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to desktop.Keyable: context fn FocusGained: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_FocusGained = func(ctx env.RyeCtx) { actualFn := fn @@ -32270,16 +30554,16 @@ func ctxTo_desktop_Keyable(ps *env.ProgramState, v env.RyeCtx) (desktop.Keyable, evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to desktop.Keyable: context fn FocusGained: expected function") + return nil, errors.New("context to desktop.Keyable: context fn FocusGained: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["FocusLost"] + ctxObj3, ok := wordToObj["focus-lost"] if !ok { return nil, errors.New("context to desktop.Keyable: expected context to have function FocusLost") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to desktop.Keyable: context fn FocusLost: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to desktop.Keyable: context fn FocusLost: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_FocusLost = func(ctx env.RyeCtx) { actualFn := fn @@ -32287,45 +30571,45 @@ func ctxTo_desktop_Keyable(ps *env.ProgramState, v env.RyeCtx) (desktop.Keyable, evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to desktop.Keyable: context fn FocusLost: expected function") + return nil, errors.New("context to desktop.Keyable: context fn FocusLost: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["TypedRune"] + ctxObj4, ok := wordToObj["typed-rune"] if !ok { return nil, errors.New("context to desktop.Keyable: expected context to have function TypedRune") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to desktop.Keyable: context fn TypedRune: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to desktop.Keyable: context fn TypedRune: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_TypedRune = func(ctx env.RyeCtx, arg0 rune) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(rune)") + impl.fn_TypedRune = func(ctx env.RyeCtx, farg0 rune) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(rune)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to desktop.Keyable: context fn TypedRune: expected function") + return nil, errors.New("context to desktop.Keyable: context fn TypedRune: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["TypedKey"] + ctxObj5, ok := wordToObj["typed-key"] if !ok { return nil, errors.New("context to desktop.Keyable: expected context to have function TypedKey") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to desktop.Keyable: context fn TypedKey: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to desktop.Keyable: context fn TypedKey: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_TypedKey = func(ctx env.RyeCtx, arg0 *fyne.KeyEvent) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*fyne.KeyEvent)") + impl.fn_TypedKey = func(ctx env.RyeCtx, farg0 *fyne.KeyEvent) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*fyne.KeyEvent)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to desktop.Keyable: context fn TypedKey: expected function") + return nil, errors.New("context to desktop.Keyable: context fn TypedKey: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -32361,43 +30645,43 @@ func ctxTo_desktop_Mouseable(ps *env.ProgramState, v env.RyeCtx) (desktop.Mousea impl := &iface_desktop_Mouseable{ self: v, } - ctxObj0, ok := wordToObj["MouseDown"] + ctxObj0, ok := wordToObj["mouse-down"] if !ok { return nil, errors.New("context to desktop.Mouseable: expected context to have function MouseDown") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to desktop.Mouseable: context fn MouseDown: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to desktop.Mouseable: context fn MouseDown: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_MouseDown = func(ctx env.RyeCtx, arg0 *desktop.MouseEvent) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*desktop.MouseEvent)") + impl.fn_MouseDown = func(ctx env.RyeCtx, farg0 *desktop.MouseEvent) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*desktop.MouseEvent)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to desktop.Mouseable: context fn MouseDown: expected function") + return nil, errors.New("context to desktop.Mouseable: context fn MouseDown: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["MouseUp"] + ctxObj1, ok := wordToObj["mouse-up"] if !ok { return nil, errors.New("context to desktop.Mouseable: expected context to have function MouseUp") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to desktop.Mouseable: context fn MouseUp: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to desktop.Mouseable: context fn MouseUp: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_MouseUp = func(ctx env.RyeCtx, arg0 *desktop.MouseEvent) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*desktop.MouseEvent)") + impl.fn_MouseUp = func(ctx env.RyeCtx, farg0 *desktop.MouseEvent) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*desktop.MouseEvent)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to desktop.Mouseable: context fn MouseUp: expected function") + return nil, errors.New("context to desktop.Mouseable: context fn MouseUp: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -32453,14 +30737,14 @@ func ctxTo_dialog_Dialog(ps *env.ProgramState, v env.RyeCtx) (dialog.Dialog, err impl := &iface_dialog_Dialog{ self: v, } - ctxObj0, ok := wordToObj["Show"] + ctxObj0, ok := wordToObj["show"] if !ok { return nil, errors.New("context to dialog.Dialog: expected context to have function Show") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to dialog.Dialog: context fn Show: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to dialog.Dialog: context fn Show: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Show = func(ctx env.RyeCtx) { actualFn := fn @@ -32468,16 +30752,16 @@ func ctxTo_dialog_Dialog(ps *env.ProgramState, v env.RyeCtx) (dialog.Dialog, err evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to dialog.Dialog: context fn Show: expected function") + return nil, errors.New("context to dialog.Dialog: context fn Show: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Hide"] + ctxObj1, ok := wordToObj["hide"] if !ok { return nil, errors.New("context to dialog.Dialog: expected context to have function Hide") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to dialog.Dialog: context fn Hide: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to dialog.Dialog: context fn Hide: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Hide = func(ctx env.RyeCtx) { actualFn := fn @@ -32485,54 +30769,57 @@ func ctxTo_dialog_Dialog(ps *env.ProgramState, v env.RyeCtx) (dialog.Dialog, err evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to dialog.Dialog: context fn Hide: expected function") + return nil, errors.New("context to dialog.Dialog: context fn Hide: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["SetDismissText"] + ctxObj2, ok := wordToObj["set-dismiss-text"] if !ok { return nil, errors.New("context to dialog.Dialog: expected context to have function SetDismissText") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to dialog.Dialog: context fn SetDismissText: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to dialog.Dialog: context fn SetDismissText: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetDismissText = func(ctx env.RyeCtx, arg0 string) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_SetDismissText = func(ctx env.RyeCtx, farg0 string) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to dialog.Dialog: context fn SetDismissText: expected function") + return nil, errors.New("context to dialog.Dialog: context fn SetDismissText: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["SetOnClosed"] + ctxObj3, ok := wordToObj["set-on-closed"] if !ok { return nil, errors.New("context to dialog.Dialog: expected context to have function SetOnClosed") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to dialog.Dialog: context fn SetOnClosed: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to dialog.Dialog: context fn SetOnClosed: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetOnClosed = func(ctx env.RyeCtx, arg0 func()) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(func())") + impl.fn_SetOnClosed = func(ctx env.RyeCtx, farg0 func()) { + var farg0Val env.Object + farg0Val = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + farg0() + return nil + }, 0, false, false, "Returned func") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to dialog.Dialog: context fn SetOnClosed: expected function") + return nil, errors.New("context to dialog.Dialog: context fn SetOnClosed: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Refresh"] + ctxObj4, ok := wordToObj["refresh"] if !ok { return nil, errors.New("context to dialog.Dialog: expected context to have function Refresh") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to dialog.Dialog: context fn Refresh: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to dialog.Dialog: context fn Refresh: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Refresh = func(ctx env.RyeCtx) { actualFn := fn @@ -32540,35 +30827,35 @@ func ctxTo_dialog_Dialog(ps *env.ProgramState, v env.RyeCtx) (dialog.Dialog, err evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to dialog.Dialog: context fn Refresh: expected function") + return nil, errors.New("context to dialog.Dialog: context fn Refresh: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["Resize"] + ctxObj5, ok := wordToObj["resize"] if !ok { return nil, errors.New("context to dialog.Dialog: expected context to have function Resize") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to dialog.Dialog: context fn Resize: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to dialog.Dialog: context fn Resize: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Resize = func(ctx env.RyeCtx, arg0 fyne.Size) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, &arg0, "Go(*fyne.Size)") + impl.fn_Resize = func(ctx env.RyeCtx, farg0 fyne.Size) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, &farg0, "Go(*fyne.Size)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to dialog.Dialog: context fn Resize: expected function") + return nil, errors.New("context to dialog.Dialog: context fn Resize: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["MinSize"] + ctxObj6, ok := wordToObj["min-size"] if !ok { return nil, errors.New("context to dialog.Dialog: expected context to have function MinSize") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to dialog.Dialog: context fn MinSize: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to dialog.Dialog: context fn MinSize: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_MinSize = func(ctx env.RyeCtx) fyne.Size { actualFn := fn @@ -32577,19 +30864,21 @@ func ctxTo_dialog_Dialog(ps *env.ProgramState, v env.RyeCtx) (dialog.Dialog, err var res fyne.Size switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(fyne.Size) - if !ok { + if vc, ok := v.Value.(*fyne.Size); ok { + res = *vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to dialog.Dialog: arg 0: callback result: expected native of type fyne.Size", + "context to dialog.Dialog: arg 0: callback result: "+"expected native of type *fyne.Size, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to dialog.Dialog: arg 0: callback result: expected native", + "context to dialog.Dialog: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -32598,7 +30887,7 @@ func ctxTo_dialog_Dialog(ps *env.ProgramState, v env.RyeCtx) (dialog.Dialog, err return res } default: - return nil, errors.New("context to dialog.Dialog: context fn MinSize: expected function") + return nil, errors.New("context to dialog.Dialog: context fn MinSize: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -32690,40 +30979,42 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { impl := &iface_fyne_App{ self: v, } - ctxObj0, ok := wordToObj["NewWindow"] + ctxObj0, ok := wordToObj["new-window"] if !ok { return nil, errors.New("context to fyne.App: expected context to have function NewWindow") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.App: context fn NewWindow: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.App: context fn NewWindow: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_NewWindow = func(ctx env.RyeCtx, arg0 string) fyne.Window { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_NewWindow = func(ctx env.RyeCtx, farg0 string) fyne.Window { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res fyne.Window switch v := ps.Res.(type) { case env.RyeCtx: var err error res, err = ctxTo_fyne_Window(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: "+err.Error()+"", + "context to fyne.App: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: expected native of type fyne.Window", + "context to fyne.App: arg 0: callback result: "+"expected native of type fyne.Window, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -32731,8 +31022,9 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.App: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -32740,8 +31032,9 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: expected native", + "context to fyne.App: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -32750,23 +31043,23 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { return res } default: - return nil, errors.New("context to fyne.App: context fn NewWindow: expected function") + return nil, errors.New("context to fyne.App: context fn NewWindow: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["OpenURL"] + ctxObj1, ok := wordToObj["open-url"] if !ok { return nil, errors.New("context to fyne.App: expected context to have function OpenURL") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.App: context fn OpenURL: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.App: context fn OpenURL: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_OpenURL = func(ctx env.RyeCtx, arg0 *url.URL) error { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*url.URL)") + impl.fn_OpenURL = func(ctx env.RyeCtx, farg0 *url.URL) error { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*url.URL)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -32775,8 +31068,9 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.App: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -32784,8 +31078,9 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: expected error, string or nil", + "context to fyne.App: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -32794,16 +31089,16 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { return res } default: - return nil, errors.New("context to fyne.App: context fn OpenURL: expected function") + return nil, errors.New("context to fyne.App: context fn OpenURL: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Icon"] + ctxObj2, ok := wordToObj["icon"] if !ok { return nil, errors.New("context to fyne.App: expected context to have function Icon") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.App: context fn Icon: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.App: context fn Icon: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Icon = func(ctx env.RyeCtx) fyne.Resource { actualFn := fn @@ -32815,19 +31110,21 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { var err error res, err = ctxTo_fyne_Resource(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: "+err.Error()+"", + "context to fyne.App: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: expected native of type fyne.Resource", + "context to fyne.App: arg 0: callback result: "+"expected native of type fyne.Resource, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -32835,8 +31132,9 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.App: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -32844,8 +31142,9 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: expected native", + "context to fyne.App: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -32854,52 +31153,35 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { return res } default: - return nil, errors.New("context to fyne.App: context fn Icon: expected function") + return nil, errors.New("context to fyne.App: context fn Icon: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["SetIcon"] + ctxObj3, ok := wordToObj["set-icon"] if !ok { return nil, errors.New("context to fyne.App: expected context to have function SetIcon") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.App: context fn SetIcon: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.App: context fn SetIcon: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetIcon = func(ctx env.RyeCtx, arg0 fyne.Resource) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.Resource)") - } - } + impl.fn_SetIcon = func(ctx env.RyeCtx, farg0 fyne.Resource) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.Resource)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.App: context fn SetIcon: expected function") + return nil, errors.New("context to fyne.App: context fn SetIcon: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Run"] + ctxObj4, ok := wordToObj["run"] if !ok { return nil, errors.New("context to fyne.App: expected context to have function Run") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.App: context fn Run: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.App: context fn Run: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Run = func(ctx env.RyeCtx) { actualFn := fn @@ -32907,16 +31189,16 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to fyne.App: context fn Run: expected function") + return nil, errors.New("context to fyne.App: context fn Run: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["Quit"] + ctxObj5, ok := wordToObj["quit"] if !ok { return nil, errors.New("context to fyne.App: expected context to have function Quit") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.App: context fn Quit: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.App: context fn Quit: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Quit = func(ctx env.RyeCtx) { actualFn := fn @@ -32924,16 +31206,16 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to fyne.App: context fn Quit: expected function") + return nil, errors.New("context to fyne.App: context fn Quit: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["Driver"] + ctxObj6, ok := wordToObj["driver"] if !ok { return nil, errors.New("context to fyne.App: expected context to have function Driver") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.App: context fn Driver: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.App: context fn Driver: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Driver = func(ctx env.RyeCtx) fyne.Driver { actualFn := fn @@ -32945,19 +31227,21 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { var err error res, err = ctxTo_fyne_Driver(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: "+err.Error()+"", + "context to fyne.App: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.Driver) - if !ok { + if vc, ok := v.Value.(fyne.Driver); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: expected native of type fyne.Driver", + "context to fyne.App: arg 0: callback result: "+"expected native of type fyne.Driver, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -32965,8 +31249,9 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.App: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -32974,8 +31259,9 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: expected native", + "context to fyne.App: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -32984,27 +31270,28 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { return res } default: - return nil, errors.New("context to fyne.App: context fn Driver: expected function") + return nil, errors.New("context to fyne.App: context fn Driver: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["UniqueID"] + ctxObj7, ok := wordToObj["unique-id"] if !ok { return nil, errors.New("context to fyne.App: expected context to have function UniqueID") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.App: context fn UniqueID: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.App: context fn UniqueID: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_UniqueID = func(ctx env.RyeCtx) string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: expected string", + "context to fyne.App: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33013,35 +31300,35 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { return res } default: - return nil, errors.New("context to fyne.App: context fn UniqueID: expected function") + return nil, errors.New("context to fyne.App: context fn UniqueID: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["SendNotification"] + ctxObj8, ok := wordToObj["send-notification"] if !ok { return nil, errors.New("context to fyne.App: expected context to have function SendNotification") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.App: context fn SendNotification: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.App: context fn SendNotification: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SendNotification = func(ctx env.RyeCtx, arg0 *fyne.Notification) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*fyne.Notification)") + impl.fn_SendNotification = func(ctx env.RyeCtx, farg0 *fyne.Notification) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*fyne.Notification)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.App: context fn SendNotification: expected function") + return nil, errors.New("context to fyne.App: context fn SendNotification: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["Settings"] + ctxObj9, ok := wordToObj["settings"] if !ok { return nil, errors.New("context to fyne.App: expected context to have function Settings") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.App: context fn Settings: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.App: context fn Settings: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Settings = func(ctx env.RyeCtx) fyne.Settings { actualFn := fn @@ -33053,19 +31340,21 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { var err error res, err = ctxTo_fyne_Settings(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: "+err.Error()+"", + "context to fyne.App: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.Settings) - if !ok { + if vc, ok := v.Value.(fyne.Settings); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: expected native of type fyne.Settings", + "context to fyne.App: arg 0: callback result: "+"expected native of type fyne.Settings, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33073,8 +31362,9 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.App: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33082,8 +31372,9 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: expected native", + "context to fyne.App: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33092,16 +31383,16 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { return res } default: - return nil, errors.New("context to fyne.App: context fn Settings: expected function") + return nil, errors.New("context to fyne.App: context fn Settings: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj10, ok := wordToObj["Preferences"] + ctxObj10, ok := wordToObj["preferences"] if !ok { return nil, errors.New("context to fyne.App: expected context to have function Preferences") } switch fn := ctxObj10.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.App: context fn Preferences: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.App: context fn Preferences: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Preferences = func(ctx env.RyeCtx) fyne.Preferences { actualFn := fn @@ -33113,19 +31404,21 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { var err error res, err = ctxTo_fyne_Preferences(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: "+err.Error()+"", + "context to fyne.App: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: expected native of type fyne.Preferences", + "context to fyne.App: arg 0: callback result: "+"expected native of type fyne.Preferences, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33133,8 +31426,9 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.App: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33142,8 +31436,9 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: expected native", + "context to fyne.App: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33152,16 +31447,16 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { return res } default: - return nil, errors.New("context to fyne.App: context fn Preferences: expected function") + return nil, errors.New("context to fyne.App: context fn Preferences: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj11, ok := wordToObj["Storage"] + ctxObj11, ok := wordToObj["storage"] if !ok { return nil, errors.New("context to fyne.App: expected context to have function Storage") } switch fn := ctxObj11.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.App: context fn Storage: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.App: context fn Storage: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Storage = func(ctx env.RyeCtx) fyne.Storage { actualFn := fn @@ -33173,19 +31468,21 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { var err error res, err = ctxTo_fyne_Storage(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: "+err.Error()+"", + "context to fyne.App: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.Storage) - if !ok { + if vc, ok := v.Value.(fyne.Storage); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: expected native of type fyne.Storage", + "context to fyne.App: arg 0: callback result: "+"expected native of type fyne.Storage, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33193,8 +31490,9 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.App: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33202,8 +31500,9 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: expected native", + "context to fyne.App: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33212,16 +31511,16 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { return res } default: - return nil, errors.New("context to fyne.App: context fn Storage: expected function") + return nil, errors.New("context to fyne.App: context fn Storage: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj12, ok := wordToObj["Lifecycle"] + ctxObj12, ok := wordToObj["lifecycle"] if !ok { return nil, errors.New("context to fyne.App: expected context to have function Lifecycle") } switch fn := ctxObj12.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.App: context fn Lifecycle: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.App: context fn Lifecycle: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Lifecycle = func(ctx env.RyeCtx) fyne.Lifecycle { actualFn := fn @@ -33233,19 +31532,21 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { var err error res, err = ctxTo_fyne_Lifecycle(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: "+err.Error()+"", + "context to fyne.App: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.Lifecycle) - if !ok { + if vc, ok := v.Value.(fyne.Lifecycle); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: expected native of type fyne.Lifecycle", + "context to fyne.App: arg 0: callback result: "+"expected native of type fyne.Lifecycle, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33253,8 +31554,9 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.App: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33262,8 +31564,9 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: expected native", + "context to fyne.App: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33272,16 +31575,16 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { return res } default: - return nil, errors.New("context to fyne.App: context fn Lifecycle: expected function") + return nil, errors.New("context to fyne.App: context fn Lifecycle: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj13, ok := wordToObj["Metadata"] + ctxObj13, ok := wordToObj["metadata"] if !ok { return nil, errors.New("context to fyne.App: expected context to have function Metadata") } switch fn := ctxObj13.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.App: context fn Metadata: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.App: context fn Metadata: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Metadata = func(ctx env.RyeCtx) fyne.AppMetadata { actualFn := fn @@ -33290,19 +31593,21 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { var res fyne.AppMetadata switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(fyne.AppMetadata) - if !ok { + if vc, ok := v.Value.(*fyne.AppMetadata); ok { + res = *vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: expected native of type fyne.AppMetadata", + "context to fyne.App: arg 0: callback result: "+"expected native of type *fyne.AppMetadata, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: expected native", + "context to fyne.App: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33311,16 +31616,16 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { return res } default: - return nil, errors.New("context to fyne.App: context fn Metadata: expected function") + return nil, errors.New("context to fyne.App: context fn Metadata: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj14, ok := wordToObj["CloudProvider"] + ctxObj14, ok := wordToObj["cloud-provider"] if !ok { return nil, errors.New("context to fyne.App: expected context to have function CloudProvider") } switch fn := ctxObj14.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.App: context fn CloudProvider: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.App: context fn CloudProvider: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_CloudProvider = func(ctx env.RyeCtx) fyne.CloudProvider { actualFn := fn @@ -33332,19 +31637,21 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { var err error res, err = ctxTo_fyne_CloudProvider(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: "+err.Error()+"", + "context to fyne.App: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.CloudProvider) - if !ok { + if vc, ok := v.Value.(fyne.CloudProvider); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: expected native of type fyne.CloudProvider", + "context to fyne.App: arg 0: callback result: "+"expected native of type fyne.CloudProvider, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33352,8 +31659,9 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.App: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33361,8 +31669,9 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.App: arg 0: callback result: expected native", + "context to fyne.App: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33371,43 +31680,26 @@ func ctxTo_fyne_App(ps *env.ProgramState, v env.RyeCtx) (fyne.App, error) { return res } default: - return nil, errors.New("context to fyne.App: context fn CloudProvider: expected function") + return nil, errors.New("context to fyne.App: context fn CloudProvider: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj15, ok := wordToObj["SetCloudProvider"] + ctxObj15, ok := wordToObj["set-cloud-provider"] if !ok { return nil, errors.New("context to fyne.App: expected context to have function SetCloudProvider") } switch fn := ctxObj15.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.App: context fn SetCloudProvider: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.App: context fn SetCloudProvider: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetCloudProvider = func(ctx env.RyeCtx, arg0 fyne.CloudProvider) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.CloudProvider)") - } - } + impl.fn_SetCloudProvider = func(ctx env.RyeCtx, farg0 fyne.CloudProvider) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.CloudProvider)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.App: context fn SetCloudProvider: expected function") + return nil, errors.New("context to fyne.App: context fn SetCloudProvider: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -33515,14 +31807,14 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) impl := &iface_fyne_Canvas{ self: v, } - ctxObj0, ok := wordToObj["Content"] + ctxObj0, ok := wordToObj["content"] if !ok { return nil, errors.New("context to fyne.Canvas: expected context to have function Content") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Canvas: context fn Content: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Canvas: context fn Content: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Content = func(ctx env.RyeCtx) fyne.CanvasObject { actualFn := fn @@ -33534,19 +31826,21 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) var err error res, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: "+err.Error()+"", + "context to fyne.Canvas: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: expected native of type fyne.CanvasObject", + "context to fyne.Canvas: arg 0: callback result: "+"expected native of type fyne.CanvasObject, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33554,8 +31848,9 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Canvas: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33563,8 +31858,9 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: expected native", + "context to fyne.Canvas: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33573,124 +31869,73 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) return res } default: - return nil, errors.New("context to fyne.Canvas: context fn Content: expected function") + return nil, errors.New("context to fyne.Canvas: context fn Content: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["SetContent"] + ctxObj1, ok := wordToObj["set-content"] if !ok { return nil, errors.New("context to fyne.Canvas: expected context to have function SetContent") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Canvas: context fn SetContent: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Canvas: context fn SetContent: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetContent = func(ctx env.RyeCtx, arg0 fyne.CanvasObject) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.CanvasObject)") - } - } + impl.fn_SetContent = func(ctx env.RyeCtx, farg0 fyne.CanvasObject) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.CanvasObject)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Canvas: context fn SetContent: expected function") + return nil, errors.New("context to fyne.Canvas: context fn SetContent: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Refresh"] + ctxObj2, ok := wordToObj["refresh"] if !ok { return nil, errors.New("context to fyne.Canvas: expected context to have function Refresh") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Canvas: context fn Refresh: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Canvas: context fn Refresh: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Refresh = func(ctx env.RyeCtx, arg0 fyne.CanvasObject) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.CanvasObject)") - } - } + impl.fn_Refresh = func(ctx env.RyeCtx, farg0 fyne.CanvasObject) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.CanvasObject)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Canvas: context fn Refresh: expected function") + return nil, errors.New("context to fyne.Canvas: context fn Refresh: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Focus"] + ctxObj3, ok := wordToObj["focus"] if !ok { return nil, errors.New("context to fyne.Canvas: expected context to have function Focus") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Canvas: context fn Focus: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Canvas: context fn Focus: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Focus = func(ctx env.RyeCtx, arg0 fyne.Focusable) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.Focusable)") - } - } + impl.fn_Focus = func(ctx env.RyeCtx, farg0 fyne.Focusable) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.Focusable)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Canvas: context fn Focus: expected function") + return nil, errors.New("context to fyne.Canvas: context fn Focus: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["FocusNext"] + ctxObj4, ok := wordToObj["focus-next"] if !ok { return nil, errors.New("context to fyne.Canvas: expected context to have function FocusNext") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Canvas: context fn FocusNext: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Canvas: context fn FocusNext: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_FocusNext = func(ctx env.RyeCtx) { actualFn := fn @@ -33698,16 +31943,16 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to fyne.Canvas: context fn FocusNext: expected function") + return nil, errors.New("context to fyne.Canvas: context fn FocusNext: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["FocusPrevious"] + ctxObj5, ok := wordToObj["focus-previous"] if !ok { return nil, errors.New("context to fyne.Canvas: expected context to have function FocusPrevious") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Canvas: context fn FocusPrevious: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Canvas: context fn FocusPrevious: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_FocusPrevious = func(ctx env.RyeCtx) { actualFn := fn @@ -33715,16 +31960,16 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to fyne.Canvas: context fn FocusPrevious: expected function") + return nil, errors.New("context to fyne.Canvas: context fn FocusPrevious: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["Unfocus"] + ctxObj6, ok := wordToObj["unfocus"] if !ok { return nil, errors.New("context to fyne.Canvas: expected context to have function Unfocus") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Canvas: context fn Unfocus: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Canvas: context fn Unfocus: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Unfocus = func(ctx env.RyeCtx) { actualFn := fn @@ -33732,16 +31977,16 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to fyne.Canvas: context fn Unfocus: expected function") + return nil, errors.New("context to fyne.Canvas: context fn Unfocus: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["Focused"] + ctxObj7, ok := wordToObj["focused"] if !ok { return nil, errors.New("context to fyne.Canvas: expected context to have function Focused") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Canvas: context fn Focused: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Canvas: context fn Focused: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Focused = func(ctx env.RyeCtx) fyne.Focusable { actualFn := fn @@ -33753,19 +31998,21 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) var err error res, err = ctxTo_fyne_Focusable(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: "+err.Error()+"", + "context to fyne.Canvas: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.Focusable) - if !ok { + if vc, ok := v.Value.(fyne.Focusable); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: expected native of type fyne.Focusable", + "context to fyne.Canvas: arg 0: callback result: "+"expected native of type fyne.Focusable, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33773,8 +32020,9 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Canvas: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33782,8 +32030,9 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: expected native", + "context to fyne.Canvas: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33792,16 +32041,16 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) return res } default: - return nil, errors.New("context to fyne.Canvas: context fn Focused: expected function") + return nil, errors.New("context to fyne.Canvas: context fn Focused: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["Size"] + ctxObj8, ok := wordToObj["size"] if !ok { return nil, errors.New("context to fyne.Canvas: expected context to have function Size") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Canvas: context fn Size: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Canvas: context fn Size: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Size = func(ctx env.RyeCtx) fyne.Size { actualFn := fn @@ -33810,19 +32059,21 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) var res fyne.Size switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(fyne.Size) - if !ok { + if vc, ok := v.Value.(*fyne.Size); ok { + res = *vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: expected native of type fyne.Size", + "context to fyne.Canvas: arg 0: callback result: "+"expected native of type *fyne.Size, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: expected native", + "context to fyne.Canvas: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33831,27 +32082,28 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) return res } default: - return nil, errors.New("context to fyne.Canvas: context fn Size: expected function") + return nil, errors.New("context to fyne.Canvas: context fn Size: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["Scale"] + ctxObj9, ok := wordToObj["scale"] if !ok { return nil, errors.New("context to fyne.Canvas: expected context to have function Scale") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Canvas: context fn Scale: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Canvas: context fn Scale: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Scale = func(ctx env.RyeCtx) float32 { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res float32 - if v, ok := ps.Res.(env.Decimal); ok { - res = float32(v.Value) + if vc, ok := ps.Res.(env.Decimal); ok { + res = float32(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: expected decimal", + "context to fyne.Canvas: arg 0: callback result: "+"expected decimal, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33860,16 +32112,16 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) return res } default: - return nil, errors.New("context to fyne.Canvas: context fn Scale: expected function") + return nil, errors.New("context to fyne.Canvas: context fn Scale: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj10, ok := wordToObj["Overlays"] + ctxObj10, ok := wordToObj["overlays"] if !ok { return nil, errors.New("context to fyne.Canvas: expected context to have function Overlays") } switch fn := ctxObj10.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Canvas: context fn Overlays: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Canvas: context fn Overlays: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Overlays = func(ctx env.RyeCtx) fyne.OverlayStack { actualFn := fn @@ -33881,19 +32133,21 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) var err error res, err = ctxTo_fyne_OverlayStack(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: "+err.Error()+"", + "context to fyne.Canvas: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.OverlayStack) - if !ok { + if vc, ok := v.Value.(fyne.OverlayStack); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: expected native of type fyne.OverlayStack", + "context to fyne.Canvas: arg 0: callback result: "+"expected native of type fyne.OverlayStack, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33901,8 +32155,9 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Canvas: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33910,8 +32165,9 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: expected native", + "context to fyne.Canvas: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33920,16 +32176,16 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) return res } default: - return nil, errors.New("context to fyne.Canvas: context fn Overlays: expected function") + return nil, errors.New("context to fyne.Canvas: context fn Overlays: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj11, ok := wordToObj["OnTypedRune"] + ctxObj11, ok := wordToObj["on-typed-rune"] if !ok { return nil, errors.New("context to fyne.Canvas: expected context to have function OnTypedRune") } switch fn := ctxObj11.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Canvas: context fn OnTypedRune: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Canvas: context fn OnTypedRune: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_OnTypedRune = func(ctx env.RyeCtx) func(rune) { actualFn := fn @@ -33939,24 +32195,26 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) switch fn := ps.Res.(type) { case env.Function: if fn.Argsn != 1 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: function has invalid number of arguments (expected 1)", + "context to fyne.Canvas: arg 0: callback result: "+"expected 1 function arguments, but got "+strconv.Itoa(fn.Argsn), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } - res = func(arg0 rune) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(rune)") + res = func(farg0 rune) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(rune)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Canvas: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(fn.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33964,8 +32222,9 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: expected function or nil", + "context to fyne.Canvas: arg 0: callback result: "+"expected function or nil, but got "+objectDebugString(ps.Idx, fn), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -33974,35 +32233,51 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) return res } default: - return nil, errors.New("context to fyne.Canvas: context fn OnTypedRune: expected function") + return nil, errors.New("context to fyne.Canvas: context fn OnTypedRune: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj12, ok := wordToObj["SetOnTypedRune"] + ctxObj12, ok := wordToObj["set-on-typed-rune"] if !ok { return nil, errors.New("context to fyne.Canvas: expected context to have function SetOnTypedRune") } switch fn := ctxObj12.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Canvas: context fn SetOnTypedRune: function has invalid number of arguments (expected 1)") - } - impl.fn_SetOnTypedRune = func(ctx env.RyeCtx, arg0 func(rune)) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(func(rune))") + return nil, errors.New("context to fyne.Canvas: context fn SetOnTypedRune: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) + } + impl.fn_SetOnTypedRune = func(ctx env.RyeCtx, farg0 func(rune)) { + var farg0Val env.Object + farg0Val = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val rune + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(rune); ok { + arg0Val = vc + } else { + ps.FailureFlag = true + return env.NewError("context to fyne.Canvas: arg 1: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) + } + default: + ps.FailureFlag = true + return env.NewError("context to fyne.Canvas: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + farg0(arg0Val) + return nil + }, 1, false, false, "Returned func") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Canvas: context fn SetOnTypedRune: expected function") + return nil, errors.New("context to fyne.Canvas: context fn SetOnTypedRune: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj13, ok := wordToObj["OnTypedKey"] + ctxObj13, ok := wordToObj["on-typed-key"] if !ok { return nil, errors.New("context to fyne.Canvas: expected context to have function OnTypedKey") } switch fn := ctxObj13.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Canvas: context fn OnTypedKey: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Canvas: context fn OnTypedKey: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_OnTypedKey = func(ctx env.RyeCtx) func(*fyne.KeyEvent) { actualFn := fn @@ -34012,24 +32287,26 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) switch fn := ps.Res.(type) { case env.Function: if fn.Argsn != 1 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: function has invalid number of arguments (expected 1)", + "context to fyne.Canvas: arg 0: callback result: "+"expected 1 function arguments, but got "+strconv.Itoa(fn.Argsn), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } - res = func(arg0 *fyne.KeyEvent) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*fyne.KeyEvent)") + res = func(farg0 *fyne.KeyEvent) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*fyne.KeyEvent)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Canvas: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(fn.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -34037,8 +32314,9 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: expected function or nil", + "context to fyne.Canvas: arg 0: callback result: "+"expected function or nil, but got "+objectDebugString(ps.Idx, fn), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -34047,108 +32325,125 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) return res } default: - return nil, errors.New("context to fyne.Canvas: context fn OnTypedKey: expected function") + return nil, errors.New("context to fyne.Canvas: context fn OnTypedKey: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj14, ok := wordToObj["SetOnTypedKey"] + ctxObj14, ok := wordToObj["set-on-typed-key"] if !ok { return nil, errors.New("context to fyne.Canvas: expected context to have function SetOnTypedKey") } switch fn := ctxObj14.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Canvas: context fn SetOnTypedKey: function has invalid number of arguments (expected 1)") - } - impl.fn_SetOnTypedKey = func(ctx env.RyeCtx, arg0 func(*fyne.KeyEvent)) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(func(*fyne.KeyEvent))") + return nil, errors.New("context to fyne.Canvas: context fn SetOnTypedKey: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) + } + impl.fn_SetOnTypedKey = func(ctx env.RyeCtx, farg0 func(*fyne.KeyEvent)) { + var farg0Val env.Object + farg0Val = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val *fyne.KeyEvent + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + arg0Val = vc + } else { + ps.FailureFlag = true + return env.NewError("context to fyne.Canvas: arg 1: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("context to fyne.Canvas: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg0Val = nil + default: + ps.FailureFlag = true + return env.NewError("context to fyne.Canvas: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + farg0(arg0Val) + return nil + }, 1, false, false, "Returned func") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Canvas: context fn SetOnTypedKey: expected function") + return nil, errors.New("context to fyne.Canvas: context fn SetOnTypedKey: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj15, ok := wordToObj["AddShortcut"] + ctxObj15, ok := wordToObj["add-shortcut"] if !ok { return nil, errors.New("context to fyne.Canvas: expected context to have function AddShortcut") } switch fn := ctxObj15.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to fyne.Canvas: context fn AddShortcut: function has invalid number of arguments (expected 2)") - } - impl.fn_AddShortcut = func(ctx env.RyeCtx, arg0 fyne.Shortcut, arg1 func(fyne.Shortcut)) { - var arg0Val, arg1Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() + return nil, errors.New("context to fyne.Canvas: context fn AddShortcut: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) + } + impl.fn_AddShortcut = func(ctx env.RyeCtx, farg0 fyne.Shortcut, farg1 func(fyne.Shortcut)) { + var farg0Val, farg1Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.Shortcut)") + farg1Val = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val fyne.Shortcut + switch v := arg0.(type) { + case env.RyeCtx: + var err error + arg0Val, err = ctxTo_fyne_Shortcut(ps, v) + if err != nil { + ps.FailureFlag = true + return env.NewError("context to fyne.Canvas: arg 1: " + err.Error()) } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.Shortcut)") + case env.Native: + if vc, ok := v.Value.(fyne.Shortcut); ok { + arg0Val = vc + } else { + ps.FailureFlag = true + return env.NewError("context to fyne.Canvas: arg 1: " + "expected native of type fyne.Shortcut, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("context to fyne.Canvas: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg0Val = nil + default: + ps.FailureFlag = true + return env.NewError("context to fyne.Canvas: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - } - arg1Val = *env.NewNative(ps.Idx, arg1, "Go(func(fyne.Shortcut))") + farg1(arg0Val) + return nil + }, 1, false, false, "Returned func") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) } default: - return nil, errors.New("context to fyne.Canvas: context fn AddShortcut: expected function") + return nil, errors.New("context to fyne.Canvas: context fn AddShortcut: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj16, ok := wordToObj["RemoveShortcut"] + ctxObj16, ok := wordToObj["remove-shortcut"] if !ok { return nil, errors.New("context to fyne.Canvas: expected context to have function RemoveShortcut") } switch fn := ctxObj16.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Canvas: context fn RemoveShortcut: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Canvas: context fn RemoveShortcut: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveShortcut = func(ctx env.RyeCtx, arg0 fyne.Shortcut) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.Shortcut)") - } - } + impl.fn_RemoveShortcut = func(ctx env.RyeCtx, farg0 fyne.Shortcut) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.Shortcut)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Canvas: context fn RemoveShortcut: expected function") + return nil, errors.New("context to fyne.Canvas: context fn RemoveShortcut: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj17, ok := wordToObj["Capture"] + ctxObj17, ok := wordToObj["capture"] if !ok { return nil, errors.New("context to fyne.Canvas: expected context to have function Capture") } switch fn := ctxObj17.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Canvas: context fn Capture: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Canvas: context fn Capture: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Capture = func(ctx env.RyeCtx) image.Image { actualFn := fn @@ -34157,19 +32452,21 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) var res image.Image switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(image.Image) - if !ok { + if vc, ok := v.Value.(image.Image); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: expected native of type image.Image", + "context to fyne.Canvas: arg 0: callback result: "+"expected native of type image.Image, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: expected native", + "context to fyne.Canvas: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -34178,57 +32475,61 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) return res } default: - return nil, errors.New("context to fyne.Canvas: context fn Capture: expected function") + return nil, errors.New("context to fyne.Canvas: context fn Capture: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj18, ok := wordToObj["PixelCoordinateForPosition"] + ctxObj18, ok := wordToObj["pixel-coordinate-for-position"] if !ok { return nil, errors.New("context to fyne.Canvas: expected context to have function PixelCoordinateForPosition") } switch fn := ctxObj18.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Canvas: context fn PixelCoordinateForPosition: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Canvas: context fn PixelCoordinateForPosition: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_PixelCoordinateForPosition = func(ctx env.RyeCtx, arg0 fyne.Position) (int, int) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, &arg0, "Go(*fyne.Position)") + impl.fn_PixelCoordinateForPosition = func(ctx env.RyeCtx, farg0 fyne.Position) (int, int) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, &farg0, "Go(*fyne.Position)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 int var res1 int res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: expected block for multiple return values", + "context to fyne.Canvas: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: expected block with 2 return values", + "context to fyne.Canvas: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = int(v.Value) + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: expected integer", + "context to fyne.Canvas: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[1].(env.Integer); ok { - res1 = int(v.Value) + if vc, ok := res.Series.S[1].(env.Integer); ok { + res1 = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: expected integer", + "context to fyne.Canvas: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[1]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -34237,16 +32538,16 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) return res0, res1 } default: - return nil, errors.New("context to fyne.Canvas: context fn PixelCoordinateForPosition: expected function") + return nil, errors.New("context to fyne.Canvas: context fn PixelCoordinateForPosition: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj19, ok := wordToObj["InteractiveArea"] + ctxObj19, ok := wordToObj["interactive-area"] if !ok { return nil, errors.New("context to fyne.Canvas: expected context to have function InteractiveArea") } switch fn := ctxObj19.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Canvas: context fn InteractiveArea: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Canvas: context fn InteractiveArea: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_InteractiveArea = func(ctx env.RyeCtx) (fyne.Position, fyne.Size) { actualFn := fn @@ -34256,16 +32557,18 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) var res1 fyne.Size res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: expected block for multiple return values", + "context to fyne.Canvas: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: expected block with 2 return values", + "context to fyne.Canvas: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -34273,19 +32576,21 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) } switch v := res.Series.S[0].(type) { case env.Native: - var ok bool - res0, ok = v.Value.(fyne.Position) - if !ok { + if vc, ok := v.Value.(*fyne.Position); ok { + res0 = *vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: expected native of type fyne.Position", + "context to fyne.Canvas: arg 0: callback result: "+"expected native of type *fyne.Position, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: expected native", + "context to fyne.Canvas: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -34293,19 +32598,21 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) } switch v := res.Series.S[1].(type) { case env.Native: - var ok bool - res1, ok = v.Value.(fyne.Size) - if !ok { + if vc, ok := v.Value.(*fyne.Size); ok { + res1 = *vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: expected native of type fyne.Size", + "context to fyne.Canvas: arg 0: callback result: "+"expected native of type *fyne.Size, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Canvas: arg 0: callback result: expected native", + "context to fyne.Canvas: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -34314,7 +32621,7 @@ func ctxTo_fyne_Canvas(ps *env.ProgramState, v env.RyeCtx) (fyne.Canvas, error) return res0, res1 } default: - return nil, errors.New("context to fyne.Canvas: context fn InteractiveArea: expected function") + return nil, errors.New("context to fyne.Canvas: context fn InteractiveArea: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -34378,14 +32685,14 @@ func ctxTo_fyne_CanvasObject(ps *env.ProgramState, v env.RyeCtx) (fyne.CanvasObj impl := &iface_fyne_CanvasObject{ self: v, } - ctxObj0, ok := wordToObj["MinSize"] + ctxObj0, ok := wordToObj["min-size"] if !ok { return nil, errors.New("context to fyne.CanvasObject: expected context to have function MinSize") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.CanvasObject: context fn MinSize: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.CanvasObject: context fn MinSize: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_MinSize = func(ctx env.RyeCtx) fyne.Size { actualFn := fn @@ -34394,19 +32701,21 @@ func ctxTo_fyne_CanvasObject(ps *env.ProgramState, v env.RyeCtx) (fyne.CanvasObj var res fyne.Size switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(fyne.Size) - if !ok { + if vc, ok := v.Value.(*fyne.Size); ok { + res = *vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.CanvasObject: arg 0: callback result: expected native of type fyne.Size", + "context to fyne.CanvasObject: arg 0: callback result: "+"expected native of type *fyne.Size, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.CanvasObject: arg 0: callback result: expected native", + "context to fyne.CanvasObject: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -34415,35 +32724,35 @@ func ctxTo_fyne_CanvasObject(ps *env.ProgramState, v env.RyeCtx) (fyne.CanvasObj return res } default: - return nil, errors.New("context to fyne.CanvasObject: context fn MinSize: expected function") + return nil, errors.New("context to fyne.CanvasObject: context fn MinSize: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Move"] + ctxObj1, ok := wordToObj["move"] if !ok { return nil, errors.New("context to fyne.CanvasObject: expected context to have function Move") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.CanvasObject: context fn Move: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.CanvasObject: context fn Move: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Move = func(ctx env.RyeCtx, arg0 fyne.Position) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, &arg0, "Go(*fyne.Position)") + impl.fn_Move = func(ctx env.RyeCtx, farg0 fyne.Position) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, &farg0, "Go(*fyne.Position)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.CanvasObject: context fn Move: expected function") + return nil, errors.New("context to fyne.CanvasObject: context fn Move: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Position"] + ctxObj2, ok := wordToObj["position"] if !ok { return nil, errors.New("context to fyne.CanvasObject: expected context to have function Position") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.CanvasObject: context fn Position: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.CanvasObject: context fn Position: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Position = func(ctx env.RyeCtx) fyne.Position { actualFn := fn @@ -34452,19 +32761,21 @@ func ctxTo_fyne_CanvasObject(ps *env.ProgramState, v env.RyeCtx) (fyne.CanvasObj var res fyne.Position switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(fyne.Position) - if !ok { + if vc, ok := v.Value.(*fyne.Position); ok { + res = *vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.CanvasObject: arg 0: callback result: expected native of type fyne.Position", + "context to fyne.CanvasObject: arg 0: callback result: "+"expected native of type *fyne.Position, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.CanvasObject: arg 0: callback result: expected native", + "context to fyne.CanvasObject: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -34473,35 +32784,35 @@ func ctxTo_fyne_CanvasObject(ps *env.ProgramState, v env.RyeCtx) (fyne.CanvasObj return res } default: - return nil, errors.New("context to fyne.CanvasObject: context fn Position: expected function") + return nil, errors.New("context to fyne.CanvasObject: context fn Position: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Resize"] + ctxObj3, ok := wordToObj["resize"] if !ok { return nil, errors.New("context to fyne.CanvasObject: expected context to have function Resize") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.CanvasObject: context fn Resize: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.CanvasObject: context fn Resize: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Resize = func(ctx env.RyeCtx, arg0 fyne.Size) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, &arg0, "Go(*fyne.Size)") + impl.fn_Resize = func(ctx env.RyeCtx, farg0 fyne.Size) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, &farg0, "Go(*fyne.Size)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.CanvasObject: context fn Resize: expected function") + return nil, errors.New("context to fyne.CanvasObject: context fn Resize: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Size"] + ctxObj4, ok := wordToObj["size"] if !ok { return nil, errors.New("context to fyne.CanvasObject: expected context to have function Size") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.CanvasObject: context fn Size: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.CanvasObject: context fn Size: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Size = func(ctx env.RyeCtx) fyne.Size { actualFn := fn @@ -34510,19 +32821,21 @@ func ctxTo_fyne_CanvasObject(ps *env.ProgramState, v env.RyeCtx) (fyne.CanvasObj var res fyne.Size switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(fyne.Size) - if !ok { + if vc, ok := v.Value.(*fyne.Size); ok { + res = *vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.CanvasObject: arg 0: callback result: expected native of type fyne.Size", + "context to fyne.CanvasObject: arg 0: callback result: "+"expected native of type *fyne.Size, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.CanvasObject: arg 0: callback result: expected native", + "context to fyne.CanvasObject: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -34531,16 +32844,16 @@ func ctxTo_fyne_CanvasObject(ps *env.ProgramState, v env.RyeCtx) (fyne.CanvasObj return res } default: - return nil, errors.New("context to fyne.CanvasObject: context fn Size: expected function") + return nil, errors.New("context to fyne.CanvasObject: context fn Size: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["Hide"] + ctxObj5, ok := wordToObj["hide"] if !ok { return nil, errors.New("context to fyne.CanvasObject: expected context to have function Hide") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.CanvasObject: context fn Hide: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.CanvasObject: context fn Hide: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Hide = func(ctx env.RyeCtx) { actualFn := fn @@ -34548,27 +32861,28 @@ func ctxTo_fyne_CanvasObject(ps *env.ProgramState, v env.RyeCtx) (fyne.CanvasObj evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to fyne.CanvasObject: context fn Hide: expected function") + return nil, errors.New("context to fyne.CanvasObject: context fn Hide: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["Visible"] + ctxObj6, ok := wordToObj["visible"] if !ok { return nil, errors.New("context to fyne.CanvasObject: expected context to have function Visible") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.CanvasObject: context fn Visible: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.CanvasObject: context fn Visible: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Visible = func(ctx env.RyeCtx) bool { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res bool - if v, ok := ps.Res.(env.Integer); ok { - res = v.Value != 0 + if vc, ok := ps.Res.(env.Integer); ok { + res = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.CanvasObject: arg 0: callback result: expected integer", + "context to fyne.CanvasObject: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -34577,16 +32891,16 @@ func ctxTo_fyne_CanvasObject(ps *env.ProgramState, v env.RyeCtx) (fyne.CanvasObj return res } default: - return nil, errors.New("context to fyne.CanvasObject: context fn Visible: expected function") + return nil, errors.New("context to fyne.CanvasObject: context fn Visible: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["Show"] + ctxObj7, ok := wordToObj["show"] if !ok { return nil, errors.New("context to fyne.CanvasObject: expected context to have function Show") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.CanvasObject: context fn Show: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.CanvasObject: context fn Show: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Show = func(ctx env.RyeCtx) { actualFn := fn @@ -34594,16 +32908,16 @@ func ctxTo_fyne_CanvasObject(ps *env.ProgramState, v env.RyeCtx) (fyne.CanvasObj evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to fyne.CanvasObject: context fn Show: expected function") + return nil, errors.New("context to fyne.CanvasObject: context fn Show: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["Refresh"] + ctxObj8, ok := wordToObj["refresh"] if !ok { return nil, errors.New("context to fyne.CanvasObject: expected context to have function Refresh") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.CanvasObject: context fn Refresh: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.CanvasObject: context fn Refresh: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Refresh = func(ctx env.RyeCtx) { actualFn := fn @@ -34611,7 +32925,7 @@ func ctxTo_fyne_CanvasObject(ps *env.ProgramState, v env.RyeCtx) (fyne.CanvasObj evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to fyne.CanvasObject: context fn Refresh: expected function") + return nil, errors.New("context to fyne.CanvasObject: context fn Refresh: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -34647,25 +32961,26 @@ func ctxTo_fyne_Clipboard(ps *env.ProgramState, v env.RyeCtx) (fyne.Clipboard, e impl := &iface_fyne_Clipboard{ self: v, } - ctxObj0, ok := wordToObj["Content"] + ctxObj0, ok := wordToObj["content"] if !ok { return nil, errors.New("context to fyne.Clipboard: expected context to have function Content") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Clipboard: context fn Content: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Clipboard: context fn Content: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Content = func(ctx env.RyeCtx) string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Clipboard: arg 0: callback result: expected string", + "context to fyne.Clipboard: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -34674,26 +32989,26 @@ func ctxTo_fyne_Clipboard(ps *env.ProgramState, v env.RyeCtx) (fyne.Clipboard, e return res } default: - return nil, errors.New("context to fyne.Clipboard: context fn Content: expected function") + return nil, errors.New("context to fyne.Clipboard: context fn Content: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["SetContent"] + ctxObj1, ok := wordToObj["set-content"] if !ok { return nil, errors.New("context to fyne.Clipboard: expected context to have function SetContent") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Clipboard: context fn SetContent: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Clipboard: context fn SetContent: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetContent = func(ctx env.RyeCtx, arg0 string) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_SetContent = func(ctx env.RyeCtx, farg0 string) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Clipboard: context fn SetContent: expected function") + return nil, errors.New("context to fyne.Clipboard: context fn SetContent: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -34741,25 +33056,26 @@ func ctxTo_fyne_CloudProvider(ps *env.ProgramState, v env.RyeCtx) (fyne.CloudPro impl := &iface_fyne_CloudProvider{ self: v, } - ctxObj0, ok := wordToObj["ProviderDescription"] + ctxObj0, ok := wordToObj["provider-description"] if !ok { return nil, errors.New("context to fyne.CloudProvider: expected context to have function ProviderDescription") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.CloudProvider: context fn ProviderDescription: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.CloudProvider: context fn ProviderDescription: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_ProviderDescription = func(ctx env.RyeCtx) string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.CloudProvider: arg 0: callback result: expected string", + "context to fyne.CloudProvider: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -34768,16 +33084,16 @@ func ctxTo_fyne_CloudProvider(ps *env.ProgramState, v env.RyeCtx) (fyne.CloudPro return res } default: - return nil, errors.New("context to fyne.CloudProvider: context fn ProviderDescription: expected function") + return nil, errors.New("context to fyne.CloudProvider: context fn ProviderDescription: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["ProviderIcon"] + ctxObj1, ok := wordToObj["provider-icon"] if !ok { return nil, errors.New("context to fyne.CloudProvider: expected context to have function ProviderIcon") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.CloudProvider: context fn ProviderIcon: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.CloudProvider: context fn ProviderIcon: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_ProviderIcon = func(ctx env.RyeCtx) fyne.Resource { actualFn := fn @@ -34789,19 +33105,21 @@ func ctxTo_fyne_CloudProvider(ps *env.ProgramState, v env.RyeCtx) (fyne.CloudPro var err error res, err = ctxTo_fyne_Resource(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.CloudProvider: arg 0: callback result: "+err.Error()+"", + "context to fyne.CloudProvider: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.CloudProvider: arg 0: callback result: expected native of type fyne.Resource", + "context to fyne.CloudProvider: arg 0: callback result: "+"expected native of type fyne.Resource, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -34809,8 +33127,9 @@ func ctxTo_fyne_CloudProvider(ps *env.ProgramState, v env.RyeCtx) (fyne.CloudPro } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.CloudProvider: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.CloudProvider: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -34818,8 +33137,9 @@ func ctxTo_fyne_CloudProvider(ps *env.ProgramState, v env.RyeCtx) (fyne.CloudPro } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.CloudProvider: arg 0: callback result: expected native", + "context to fyne.CloudProvider: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -34828,27 +33148,28 @@ func ctxTo_fyne_CloudProvider(ps *env.ProgramState, v env.RyeCtx) (fyne.CloudPro return res } default: - return nil, errors.New("context to fyne.CloudProvider: context fn ProviderIcon: expected function") + return nil, errors.New("context to fyne.CloudProvider: context fn ProviderIcon: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["ProviderName"] + ctxObj2, ok := wordToObj["provider-name"] if !ok { return nil, errors.New("context to fyne.CloudProvider: expected context to have function ProviderName") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.CloudProvider: context fn ProviderName: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.CloudProvider: context fn ProviderName: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_ProviderName = func(ctx env.RyeCtx) string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.CloudProvider: arg 0: callback result: expected string", + "context to fyne.CloudProvider: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -34857,76 +33178,42 @@ func ctxTo_fyne_CloudProvider(ps *env.ProgramState, v env.RyeCtx) (fyne.CloudPro return res } default: - return nil, errors.New("context to fyne.CloudProvider: context fn ProviderName: expected function") + return nil, errors.New("context to fyne.CloudProvider: context fn ProviderName: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Cleanup"] + ctxObj3, ok := wordToObj["cleanup"] if !ok { return nil, errors.New("context to fyne.CloudProvider: expected context to have function Cleanup") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.CloudProvider: context fn Cleanup: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.CloudProvider: context fn Cleanup: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Cleanup = func(ctx env.RyeCtx, arg0 fyne.App) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.App)") - } - } + impl.fn_Cleanup = func(ctx env.RyeCtx, farg0 fyne.App) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.App)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.CloudProvider: context fn Cleanup: expected function") + return nil, errors.New("context to fyne.CloudProvider: context fn Cleanup: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Setup"] + ctxObj4, ok := wordToObj["setup"] if !ok { return nil, errors.New("context to fyne.CloudProvider: expected context to have function Setup") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.CloudProvider: context fn Setup: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.CloudProvider: context fn Setup: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Setup = func(ctx env.RyeCtx, arg0 fyne.App) error { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.App)") - } - } + impl.fn_Setup = func(ctx env.RyeCtx, farg0 fyne.App) error { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.App)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -34935,8 +33222,9 @@ func ctxTo_fyne_CloudProvider(ps *env.ProgramState, v env.RyeCtx) (fyne.CloudPro res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.CloudProvider: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.CloudProvider: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -34944,8 +33232,9 @@ func ctxTo_fyne_CloudProvider(ps *env.ProgramState, v env.RyeCtx) (fyne.CloudPro } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.CloudProvider: arg 0: callback result: expected error, string or nil", + "context to fyne.CloudProvider: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -34954,7 +33243,7 @@ func ctxTo_fyne_CloudProvider(ps *env.ProgramState, v env.RyeCtx) (fyne.CloudPro return res } default: - return nil, errors.New("context to fyne.CloudProvider: context fn Setup: expected function") + return nil, errors.New("context to fyne.CloudProvider: context fn Setup: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -34986,57 +33275,42 @@ func ctxTo_fyne_CloudProviderPreferences(ps *env.ProgramState, v env.RyeCtx) (fy impl := &iface_fyne_CloudProviderPreferences{ self: v, } - ctxObj0, ok := wordToObj["CloudPreferences"] + ctxObj0, ok := wordToObj["cloud-preferences"] if !ok { return nil, errors.New("context to fyne.CloudProviderPreferences: expected context to have function CloudPreferences") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.CloudProviderPreferences: context fn CloudPreferences: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.CloudProviderPreferences: context fn CloudPreferences: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_CloudPreferences = func(ctx env.RyeCtx, arg0 fyne.App) fyne.Preferences { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.App)") - } - } + impl.fn_CloudPreferences = func(ctx env.RyeCtx, farg0 fyne.App) fyne.Preferences { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.App)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res fyne.Preferences switch v := ps.Res.(type) { case env.RyeCtx: var err error res, err = ctxTo_fyne_Preferences(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.CloudProviderPreferences: arg 0: callback result: "+err.Error()+"", + "context to fyne.CloudProviderPreferences: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.CloudProviderPreferences: arg 0: callback result: expected native of type fyne.Preferences", + "context to fyne.CloudProviderPreferences: arg 0: callback result: "+"expected native of type fyne.Preferences, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -35044,8 +33318,9 @@ func ctxTo_fyne_CloudProviderPreferences(ps *env.ProgramState, v env.RyeCtx) (fy } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.CloudProviderPreferences: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.CloudProviderPreferences: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -35053,8 +33328,9 @@ func ctxTo_fyne_CloudProviderPreferences(ps *env.ProgramState, v env.RyeCtx) (fy } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.CloudProviderPreferences: arg 0: callback result: expected native", + "context to fyne.CloudProviderPreferences: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -35063,7 +33339,7 @@ func ctxTo_fyne_CloudProviderPreferences(ps *env.ProgramState, v env.RyeCtx) (fy return res } default: - return nil, errors.New("context to fyne.CloudProviderPreferences: context fn CloudPreferences: expected function") + return nil, errors.New("context to fyne.CloudProviderPreferences: context fn CloudPreferences: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -35095,57 +33371,42 @@ func ctxTo_fyne_CloudProviderStorage(ps *env.ProgramState, v env.RyeCtx) (fyne.C impl := &iface_fyne_CloudProviderStorage{ self: v, } - ctxObj0, ok := wordToObj["CloudStorage"] + ctxObj0, ok := wordToObj["cloud-storage"] if !ok { return nil, errors.New("context to fyne.CloudProviderStorage: expected context to have function CloudStorage") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.CloudProviderStorage: context fn CloudStorage: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.CloudProviderStorage: context fn CloudStorage: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_CloudStorage = func(ctx env.RyeCtx, arg0 fyne.App) fyne.Storage { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.App)") - } - } + impl.fn_CloudStorage = func(ctx env.RyeCtx, farg0 fyne.App) fyne.Storage { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.App)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res fyne.Storage switch v := ps.Res.(type) { case env.RyeCtx: var err error res, err = ctxTo_fyne_Storage(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.CloudProviderStorage: arg 0: callback result: "+err.Error()+"", + "context to fyne.CloudProviderStorage: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.Storage) - if !ok { + if vc, ok := v.Value.(fyne.Storage); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.CloudProviderStorage: arg 0: callback result: expected native of type fyne.Storage", + "context to fyne.CloudProviderStorage: arg 0: callback result: "+"expected native of type fyne.Storage, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -35153,8 +33414,9 @@ func ctxTo_fyne_CloudProviderStorage(ps *env.ProgramState, v env.RyeCtx) (fyne.C } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.CloudProviderStorage: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.CloudProviderStorage: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -35162,8 +33424,9 @@ func ctxTo_fyne_CloudProviderStorage(ps *env.ProgramState, v env.RyeCtx) (fyne.C } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.CloudProviderStorage: arg 0: callback result: expected native", + "context to fyne.CloudProviderStorage: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -35172,7 +33435,7 @@ func ctxTo_fyne_CloudProviderStorage(ps *env.ProgramState, v env.RyeCtx) (fyne.C return res } default: - return nil, errors.New("context to fyne.CloudProviderStorage: context fn CloudStorage: expected function") + return nil, errors.New("context to fyne.CloudProviderStorage: context fn CloudStorage: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -35220,14 +33483,14 @@ func ctxTo_fyne_Device(ps *env.ProgramState, v env.RyeCtx) (fyne.Device, error) impl := &iface_fyne_Device{ self: v, } - ctxObj0, ok := wordToObj["Orientation"] + ctxObj0, ok := wordToObj["orientation"] if !ok { return nil, errors.New("context to fyne.Device: expected context to have function Orientation") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Device: context fn Orientation: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Device: context fn Orientation: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Orientation = func(ctx env.RyeCtx) fyne.DeviceOrientation { actualFn := fn @@ -35245,11 +33508,12 @@ func ctxTo_fyne_Device(ps *env.ProgramState, v env.RyeCtx) (fyne.Device, error) res = natVal } else { var u int - if v, ok := ps.Res.(env.Integer); ok { - u = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + u = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Device: arg 0: callback result: expected integer", + "context to fyne.Device: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -35261,27 +33525,28 @@ func ctxTo_fyne_Device(ps *env.ProgramState, v env.RyeCtx) (fyne.Device, error) return res } default: - return nil, errors.New("context to fyne.Device: context fn Orientation: expected function") + return nil, errors.New("context to fyne.Device: context fn Orientation: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["IsMobile"] + ctxObj1, ok := wordToObj["is-mobile"] if !ok { return nil, errors.New("context to fyne.Device: expected context to have function IsMobile") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Device: context fn IsMobile: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Device: context fn IsMobile: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_IsMobile = func(ctx env.RyeCtx) bool { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res bool - if v, ok := ps.Res.(env.Integer); ok { - res = v.Value != 0 + if vc, ok := ps.Res.(env.Integer); ok { + res = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Device: arg 0: callback result: expected integer", + "context to fyne.Device: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -35290,27 +33555,28 @@ func ctxTo_fyne_Device(ps *env.ProgramState, v env.RyeCtx) (fyne.Device, error) return res } default: - return nil, errors.New("context to fyne.Device: context fn IsMobile: expected function") + return nil, errors.New("context to fyne.Device: context fn IsMobile: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["IsBrowser"] + ctxObj2, ok := wordToObj["is-browser"] if !ok { return nil, errors.New("context to fyne.Device: expected context to have function IsBrowser") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Device: context fn IsBrowser: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Device: context fn IsBrowser: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_IsBrowser = func(ctx env.RyeCtx) bool { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res bool - if v, ok := ps.Res.(env.Integer); ok { - res = v.Value != 0 + if vc, ok := ps.Res.(env.Integer); ok { + res = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Device: arg 0: callback result: expected integer", + "context to fyne.Device: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -35319,27 +33585,28 @@ func ctxTo_fyne_Device(ps *env.ProgramState, v env.RyeCtx) (fyne.Device, error) return res } default: - return nil, errors.New("context to fyne.Device: context fn IsBrowser: expected function") + return nil, errors.New("context to fyne.Device: context fn IsBrowser: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["HasKeyboard"] + ctxObj3, ok := wordToObj["has-keyboard"] if !ok { return nil, errors.New("context to fyne.Device: expected context to have function HasKeyboard") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Device: context fn HasKeyboard: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Device: context fn HasKeyboard: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_HasKeyboard = func(ctx env.RyeCtx) bool { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res bool - if v, ok := ps.Res.(env.Integer); ok { - res = v.Value != 0 + if vc, ok := ps.Res.(env.Integer); ok { + res = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Device: arg 0: callback result: expected integer", + "context to fyne.Device: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -35348,46 +33615,30 @@ func ctxTo_fyne_Device(ps *env.ProgramState, v env.RyeCtx) (fyne.Device, error) return res } default: - return nil, errors.New("context to fyne.Device: context fn HasKeyboard: expected function") + return nil, errors.New("context to fyne.Device: context fn HasKeyboard: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["SystemScaleForWindow"] + ctxObj4, ok := wordToObj["system-scale-for-window"] if !ok { return nil, errors.New("context to fyne.Device: expected context to have function SystemScaleForWindow") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Device: context fn SystemScaleForWindow: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Device: context fn SystemScaleForWindow: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SystemScaleForWindow = func(ctx env.RyeCtx, arg0 fyne.Window) float32 { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.Window)") - } - } + impl.fn_SystemScaleForWindow = func(ctx env.RyeCtx, farg0 fyne.Window) float32 { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.Window)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res float32 - if v, ok := ps.Res.(env.Decimal); ok { - res = float32(v.Value) + if vc, ok := ps.Res.(env.Decimal); ok { + res = float32(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Device: arg 0: callback result: expected decimal", + "context to fyne.Device: arg 0: callback result: "+"expected decimal, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -35396,7 +33647,7 @@ func ctxTo_fyne_Device(ps *env.ProgramState, v env.RyeCtx) (fyne.Device, error) return res } default: - return nil, errors.New("context to fyne.Device: context fn SystemScaleForWindow: expected function") + return nil, errors.New("context to fyne.Device: context fn SystemScaleForWindow: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -35436,14 +33687,14 @@ func ctxTo_fyne_Disableable(ps *env.ProgramState, v env.RyeCtx) (fyne.Disableabl impl := &iface_fyne_Disableable{ self: v, } - ctxObj0, ok := wordToObj["Enable"] + ctxObj0, ok := wordToObj["enable"] if !ok { return nil, errors.New("context to fyne.Disableable: expected context to have function Enable") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Disableable: context fn Enable: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Disableable: context fn Enable: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Enable = func(ctx env.RyeCtx) { actualFn := fn @@ -35451,16 +33702,16 @@ func ctxTo_fyne_Disableable(ps *env.ProgramState, v env.RyeCtx) (fyne.Disableabl evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to fyne.Disableable: context fn Enable: expected function") + return nil, errors.New("context to fyne.Disableable: context fn Enable: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Disable"] + ctxObj1, ok := wordToObj["disable"] if !ok { return nil, errors.New("context to fyne.Disableable: expected context to have function Disable") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Disableable: context fn Disable: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Disableable: context fn Disable: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Disable = func(ctx env.RyeCtx) { actualFn := fn @@ -35468,27 +33719,28 @@ func ctxTo_fyne_Disableable(ps *env.ProgramState, v env.RyeCtx) (fyne.Disableabl evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to fyne.Disableable: context fn Disable: expected function") + return nil, errors.New("context to fyne.Disableable: context fn Disable: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Disabled"] + ctxObj2, ok := wordToObj["disabled"] if !ok { return nil, errors.New("context to fyne.Disableable: expected context to have function Disabled") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Disableable: context fn Disabled: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Disableable: context fn Disabled: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Disabled = func(ctx env.RyeCtx) bool { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res bool - if v, ok := ps.Res.(env.Integer); ok { - res = v.Value != 0 + if vc, ok := ps.Res.(env.Integer); ok { + res = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Disableable: arg 0: callback result: expected integer", + "context to fyne.Disableable: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -35497,7 +33749,7 @@ func ctxTo_fyne_Disableable(ps *env.ProgramState, v env.RyeCtx) (fyne.Disableabl return res } default: - return nil, errors.New("context to fyne.Disableable: context fn Disabled: expected function") + return nil, errors.New("context to fyne.Disableable: context fn Disabled: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -35529,24 +33781,24 @@ func ctxTo_fyne_DoubleTappable(ps *env.ProgramState, v env.RyeCtx) (fyne.DoubleT impl := &iface_fyne_DoubleTappable{ self: v, } - ctxObj0, ok := wordToObj["DoubleTapped"] + ctxObj0, ok := wordToObj["double-tapped"] if !ok { return nil, errors.New("context to fyne.DoubleTappable: expected context to have function DoubleTapped") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.DoubleTappable: context fn DoubleTapped: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.DoubleTappable: context fn DoubleTapped: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_DoubleTapped = func(ctx env.RyeCtx, arg0 *fyne.PointEvent) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*fyne.PointEvent)") + impl.fn_DoubleTapped = func(ctx env.RyeCtx, farg0 *fyne.PointEvent) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*fyne.PointEvent)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.DoubleTappable: context fn DoubleTapped: expected function") + return nil, errors.New("context to fyne.DoubleTappable: context fn DoubleTapped: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -35582,33 +33834,33 @@ func ctxTo_fyne_Draggable(ps *env.ProgramState, v env.RyeCtx) (fyne.Draggable, e impl := &iface_fyne_Draggable{ self: v, } - ctxObj0, ok := wordToObj["Dragged"] + ctxObj0, ok := wordToObj["dragged"] if !ok { return nil, errors.New("context to fyne.Draggable: expected context to have function Dragged") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Draggable: context fn Dragged: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Draggable: context fn Dragged: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Dragged = func(ctx env.RyeCtx, arg0 *fyne.DragEvent) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*fyne.DragEvent)") + impl.fn_Dragged = func(ctx env.RyeCtx, farg0 *fyne.DragEvent) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*fyne.DragEvent)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Draggable: context fn Dragged: expected function") + return nil, errors.New("context to fyne.Draggable: context fn Dragged: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["DragEnd"] + ctxObj1, ok := wordToObj["drag-end"] if !ok { return nil, errors.New("context to fyne.Draggable: expected context to have function DragEnd") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Draggable: context fn DragEnd: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Draggable: context fn DragEnd: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_DragEnd = func(ctx env.RyeCtx) { actualFn := fn @@ -35616,7 +33868,7 @@ func ctxTo_fyne_Draggable(ps *env.ProgramState, v env.RyeCtx) (fyne.Draggable, e evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to fyne.Draggable: context fn DragEnd: expected function") + return nil, errors.New("context to fyne.Draggable: context fn DragEnd: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -35684,40 +33936,42 @@ func ctxTo_fyne_Driver(ps *env.ProgramState, v env.RyeCtx) (fyne.Driver, error) impl := &iface_fyne_Driver{ self: v, } - ctxObj0, ok := wordToObj["CreateWindow"] + ctxObj0, ok := wordToObj["create-window"] if !ok { return nil, errors.New("context to fyne.Driver: expected context to have function CreateWindow") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Driver: context fn CreateWindow: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Driver: context fn CreateWindow: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_CreateWindow = func(ctx env.RyeCtx, arg0 string) fyne.Window { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_CreateWindow = func(ctx env.RyeCtx, farg0 string) fyne.Window { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res fyne.Window switch v := ps.Res.(type) { case env.RyeCtx: var err error res, err = ctxTo_fyne_Window(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Driver: arg 0: callback result: "+err.Error()+"", + "context to fyne.Driver: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Driver: arg 0: callback result: expected native of type fyne.Window", + "context to fyne.Driver: arg 0: callback result: "+"expected native of type fyne.Window, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -35725,8 +33979,9 @@ func ctxTo_fyne_Driver(ps *env.ProgramState, v env.RyeCtx) (fyne.Driver, error) } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Driver: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Driver: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -35734,8 +33989,9 @@ func ctxTo_fyne_Driver(ps *env.ProgramState, v env.RyeCtx) (fyne.Driver, error) } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Driver: arg 0: callback result: expected native", + "context to fyne.Driver: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -35744,16 +34000,16 @@ func ctxTo_fyne_Driver(ps *env.ProgramState, v env.RyeCtx) (fyne.Driver, error) return res } default: - return nil, errors.New("context to fyne.Driver: context fn CreateWindow: expected function") + return nil, errors.New("context to fyne.Driver: context fn CreateWindow: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["AllWindows"] + ctxObj1, ok := wordToObj["all-windows"] if !ok { return nil, errors.New("context to fyne.Driver: expected context to have function AllWindows") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Driver: context fn AllWindows: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Driver: context fn AllWindows: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_AllWindows = func(ctx env.RyeCtx) []fyne.Window { actualFn := fn @@ -35769,19 +34025,21 @@ func ctxTo_fyne_Driver(ps *env.ProgramState, v env.RyeCtx) (fyne.Driver, error) var err error res[i], err = ctxTo_fyne_Window(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Driver: arg 0: callback result: block item: "+err.Error()+"", + "context to fyne.Driver: arg 0: callback result: "+"block item: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res[i], ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + res[i] = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Driver: arg 0: callback result: block item: expected native of type fyne.Window", + "context to fyne.Driver: arg 0: callback result: "+"block item: "+"expected native of type fyne.Window, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -35789,8 +34047,9 @@ func ctxTo_fyne_Driver(ps *env.ProgramState, v env.RyeCtx) (fyne.Driver, error) } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Driver: arg 0: callback result: block item: expected integer to be 0 or nil", + "context to fyne.Driver: arg 0: callback result: "+"block item: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -35798,29 +34057,20 @@ func ctxTo_fyne_Driver(ps *env.ProgramState, v env.RyeCtx) (fyne.Driver, error) } res[i] = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Driver: arg 0: callback result: block item: expected native", + "context to fyne.Driver: arg 0: callback result: "+"block item: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]fyne.Window) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Driver: arg 0: callback result: expected native of type []fyne.Window", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Driver: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Driver: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -35828,8 +34078,9 @@ func ctxTo_fyne_Driver(ps *env.ProgramState, v env.RyeCtx) (fyne.Driver, error) } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Driver: arg 0: callback result: expected block, native or nil", + "context to fyne.Driver: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -35838,39 +34089,41 @@ func ctxTo_fyne_Driver(ps *env.ProgramState, v env.RyeCtx) (fyne.Driver, error) return res } default: - return nil, errors.New("context to fyne.Driver: context fn AllWindows: expected function") + return nil, errors.New("context to fyne.Driver: context fn AllWindows: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["RenderedTextSize"] + ctxObj2, ok := wordToObj["rendered-text-size"] if !ok { return nil, errors.New("context to fyne.Driver: expected context to have function RenderedTextSize") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 3 { - return nil, errors.New("context to fyne.Driver: context fn RenderedTextSize: function has invalid number of arguments (expected 3)") + return nil, errors.New("context to fyne.Driver: context fn RenderedTextSize: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RenderedTextSize = func(ctx env.RyeCtx, arg0 string, arg1 float32, arg2 fyne.TextStyle) (fyne.Size, float32) { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewDecimal(float64(arg1)) - arg2Val = *env.NewNative(ps.Idx, &arg2, "Go(*fyne.TextStyle)") + impl.fn_RenderedTextSize = func(ctx env.RyeCtx, farg0 string, farg1 float32, farg2 fyne.TextStyle) (fyne.Size, float32) { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewDecimal(float64(farg1)) + farg2Val = *env.NewNative(ps.Idx, &farg2, "Go(*fyne.TextStyle)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val, farg2Val) var res0 fyne.Size var res1 float32 res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Driver: arg 0: callback result: expected block for multiple return values", + "context to fyne.Driver: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Driver: arg 0: callback result: expected block with 2 return values", + "context to fyne.Driver: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -35878,29 +34131,32 @@ func ctxTo_fyne_Driver(ps *env.ProgramState, v env.RyeCtx) (fyne.Driver, error) } switch v := res.Series.S[0].(type) { case env.Native: - var ok bool - res0, ok = v.Value.(fyne.Size) - if !ok { + if vc, ok := v.Value.(*fyne.Size); ok { + res0 = *vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Driver: arg 0: callback result: expected native of type fyne.Size", + "context to fyne.Driver: arg 0: callback result: "+"expected native of type *fyne.Size, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Driver: arg 0: callback result: expected native", + "context to fyne.Driver: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[1].(env.Decimal); ok { - res1 = float32(v.Value) + if vc, ok := res.Series.S[1].(env.Decimal); ok { + res1 = float32(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Driver: arg 0: callback result: expected decimal", + "context to fyne.Driver: arg 0: callback result: "+"expected decimal, but got "+objectDebugString(ps.Idx, res.Series.S[1]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -35909,59 +34165,44 @@ func ctxTo_fyne_Driver(ps *env.ProgramState, v env.RyeCtx) (fyne.Driver, error) return res0, res1 } default: - return nil, errors.New("context to fyne.Driver: context fn RenderedTextSize: expected function") + return nil, errors.New("context to fyne.Driver: context fn RenderedTextSize: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["CanvasForObject"] + ctxObj3, ok := wordToObj["canvas-for-object"] if !ok { return nil, errors.New("context to fyne.Driver: expected context to have function CanvasForObject") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Driver: context fn CanvasForObject: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Driver: context fn CanvasForObject: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_CanvasForObject = func(ctx env.RyeCtx, arg0 fyne.CanvasObject) fyne.Canvas { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.CanvasObject)") - } - } + impl.fn_CanvasForObject = func(ctx env.RyeCtx, farg0 fyne.CanvasObject) fyne.Canvas { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.CanvasObject)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res fyne.Canvas switch v := ps.Res.(type) { case env.RyeCtx: var err error res, err = ctxTo_fyne_Canvas(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Driver: arg 0: callback result: "+err.Error()+"", + "context to fyne.Driver: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Driver: arg 0: callback result: expected native of type fyne.Canvas", + "context to fyne.Driver: arg 0: callback result: "+"expected native of type fyne.Canvas, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -35969,8 +34210,9 @@ func ctxTo_fyne_Driver(ps *env.ProgramState, v env.RyeCtx) (fyne.Driver, error) } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Driver: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Driver: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -35978,8 +34220,9 @@ func ctxTo_fyne_Driver(ps *env.ProgramState, v env.RyeCtx) (fyne.Driver, error) } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Driver: arg 0: callback result: expected native", + "context to fyne.Driver: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -35988,56 +34231,41 @@ func ctxTo_fyne_Driver(ps *env.ProgramState, v env.RyeCtx) (fyne.Driver, error) return res } default: - return nil, errors.New("context to fyne.Driver: context fn CanvasForObject: expected function") + return nil, errors.New("context to fyne.Driver: context fn CanvasForObject: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["AbsolutePositionForObject"] + ctxObj4, ok := wordToObj["absolute-position-for-object"] if !ok { return nil, errors.New("context to fyne.Driver: expected context to have function AbsolutePositionForObject") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Driver: context fn AbsolutePositionForObject: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Driver: context fn AbsolutePositionForObject: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AbsolutePositionForObject = func(ctx env.RyeCtx, arg0 fyne.CanvasObject) fyne.Position { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.CanvasObject)") - } - } + impl.fn_AbsolutePositionForObject = func(ctx env.RyeCtx, farg0 fyne.CanvasObject) fyne.Position { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.CanvasObject)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res fyne.Position switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(fyne.Position) - if !ok { + if vc, ok := v.Value.(*fyne.Position); ok { + res = *vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Driver: arg 0: callback result: expected native of type fyne.Position", + "context to fyne.Driver: arg 0: callback result: "+"expected native of type *fyne.Position, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Driver: arg 0: callback result: expected native", + "context to fyne.Driver: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -36046,16 +34274,16 @@ func ctxTo_fyne_Driver(ps *env.ProgramState, v env.RyeCtx) (fyne.Driver, error) return res } default: - return nil, errors.New("context to fyne.Driver: context fn AbsolutePositionForObject: expected function") + return nil, errors.New("context to fyne.Driver: context fn AbsolutePositionForObject: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["Device"] + ctxObj5, ok := wordToObj["device"] if !ok { return nil, errors.New("context to fyne.Driver: expected context to have function Device") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Driver: context fn Device: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Driver: context fn Device: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Device = func(ctx env.RyeCtx) fyne.Device { actualFn := fn @@ -36067,19 +34295,21 @@ func ctxTo_fyne_Driver(ps *env.ProgramState, v env.RyeCtx) (fyne.Driver, error) var err error res, err = ctxTo_fyne_Device(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Driver: arg 0: callback result: "+err.Error()+"", + "context to fyne.Driver: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.Device) - if !ok { + if vc, ok := v.Value.(fyne.Device); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Driver: arg 0: callback result: expected native of type fyne.Device", + "context to fyne.Driver: arg 0: callback result: "+"expected native of type fyne.Device, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -36087,8 +34317,9 @@ func ctxTo_fyne_Driver(ps *env.ProgramState, v env.RyeCtx) (fyne.Driver, error) } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Driver: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Driver: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -36096,8 +34327,9 @@ func ctxTo_fyne_Driver(ps *env.ProgramState, v env.RyeCtx) (fyne.Driver, error) } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Driver: arg 0: callback result: expected native", + "context to fyne.Driver: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -36106,16 +34338,16 @@ func ctxTo_fyne_Driver(ps *env.ProgramState, v env.RyeCtx) (fyne.Driver, error) return res } default: - return nil, errors.New("context to fyne.Driver: context fn Device: expected function") + return nil, errors.New("context to fyne.Driver: context fn Device: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["Run"] + ctxObj6, ok := wordToObj["run"] if !ok { return nil, errors.New("context to fyne.Driver: expected context to have function Run") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Driver: context fn Run: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Driver: context fn Run: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Run = func(ctx env.RyeCtx) { actualFn := fn @@ -36123,16 +34355,16 @@ func ctxTo_fyne_Driver(ps *env.ProgramState, v env.RyeCtx) (fyne.Driver, error) evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to fyne.Driver: context fn Run: expected function") + return nil, errors.New("context to fyne.Driver: context fn Run: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["Quit"] + ctxObj7, ok := wordToObj["quit"] if !ok { return nil, errors.New("context to fyne.Driver: expected context to have function Quit") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Driver: context fn Quit: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Driver: context fn Quit: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Quit = func(ctx env.RyeCtx) { actualFn := fn @@ -36140,45 +34372,45 @@ func ctxTo_fyne_Driver(ps *env.ProgramState, v env.RyeCtx) (fyne.Driver, error) evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to fyne.Driver: context fn Quit: expected function") + return nil, errors.New("context to fyne.Driver: context fn Quit: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["StartAnimation"] + ctxObj8, ok := wordToObj["start-animation"] if !ok { return nil, errors.New("context to fyne.Driver: expected context to have function StartAnimation") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Driver: context fn StartAnimation: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Driver: context fn StartAnimation: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_StartAnimation = func(ctx env.RyeCtx, arg0 *fyne.Animation) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*fyne.Animation)") + impl.fn_StartAnimation = func(ctx env.RyeCtx, farg0 *fyne.Animation) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*fyne.Animation)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Driver: context fn StartAnimation: expected function") + return nil, errors.New("context to fyne.Driver: context fn StartAnimation: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["StopAnimation"] + ctxObj9, ok := wordToObj["stop-animation"] if !ok { return nil, errors.New("context to fyne.Driver: expected context to have function StopAnimation") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Driver: context fn StopAnimation: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Driver: context fn StopAnimation: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_StopAnimation = func(ctx env.RyeCtx, arg0 *fyne.Animation) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*fyne.Animation)") + impl.fn_StopAnimation = func(ctx env.RyeCtx, farg0 *fyne.Animation) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*fyne.Animation)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Driver: context fn StopAnimation: expected function") + return nil, errors.New("context to fyne.Driver: context fn StopAnimation: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -36222,14 +34454,14 @@ func ctxTo_fyne_Focusable(ps *env.ProgramState, v env.RyeCtx) (fyne.Focusable, e impl := &iface_fyne_Focusable{ self: v, } - ctxObj0, ok := wordToObj["FocusGained"] + ctxObj0, ok := wordToObj["focus-gained"] if !ok { return nil, errors.New("context to fyne.Focusable: expected context to have function FocusGained") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Focusable: context fn FocusGained: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Focusable: context fn FocusGained: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_FocusGained = func(ctx env.RyeCtx) { actualFn := fn @@ -36237,16 +34469,16 @@ func ctxTo_fyne_Focusable(ps *env.ProgramState, v env.RyeCtx) (fyne.Focusable, e evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to fyne.Focusable: context fn FocusGained: expected function") + return nil, errors.New("context to fyne.Focusable: context fn FocusGained: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["FocusLost"] + ctxObj1, ok := wordToObj["focus-lost"] if !ok { return nil, errors.New("context to fyne.Focusable: expected context to have function FocusLost") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Focusable: context fn FocusLost: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Focusable: context fn FocusLost: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_FocusLost = func(ctx env.RyeCtx) { actualFn := fn @@ -36254,45 +34486,45 @@ func ctxTo_fyne_Focusable(ps *env.ProgramState, v env.RyeCtx) (fyne.Focusable, e evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to fyne.Focusable: context fn FocusLost: expected function") + return nil, errors.New("context to fyne.Focusable: context fn FocusLost: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["TypedRune"] + ctxObj2, ok := wordToObj["typed-rune"] if !ok { return nil, errors.New("context to fyne.Focusable: expected context to have function TypedRune") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Focusable: context fn TypedRune: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Focusable: context fn TypedRune: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_TypedRune = func(ctx env.RyeCtx, arg0 rune) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(rune)") + impl.fn_TypedRune = func(ctx env.RyeCtx, farg0 rune) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(rune)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Focusable: context fn TypedRune: expected function") + return nil, errors.New("context to fyne.Focusable: context fn TypedRune: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["TypedKey"] + ctxObj3, ok := wordToObj["typed-key"] if !ok { return nil, errors.New("context to fyne.Focusable: expected context to have function TypedKey") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Focusable: context fn TypedKey: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Focusable: context fn TypedKey: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_TypedKey = func(ctx env.RyeCtx, arg0 *fyne.KeyEvent) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*fyne.KeyEvent)") + impl.fn_TypedKey = func(ctx env.RyeCtx, farg0 *fyne.KeyEvent) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*fyne.KeyEvent)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Focusable: context fn TypedKey: expected function") + return nil, errors.New("context to fyne.Focusable: context fn TypedKey: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -36332,14 +34564,14 @@ func ctxTo_fyne_KeyboardShortcut(ps *env.ProgramState, v env.RyeCtx) (fyne.Keybo impl := &iface_fyne_KeyboardShortcut{ self: v, } - ctxObj0, ok := wordToObj["Key"] + ctxObj0, ok := wordToObj["key"] if !ok { return nil, errors.New("context to fyne.KeyboardShortcut: expected context to have function Key") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.KeyboardShortcut: context fn Key: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.KeyboardShortcut: context fn Key: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Key = func(ctx env.RyeCtx) fyne.KeyName { actualFn := fn @@ -36357,11 +34589,12 @@ func ctxTo_fyne_KeyboardShortcut(ps *env.ProgramState, v env.RyeCtx) (fyne.Keybo res = natVal } else { var u string - if v, ok := ps.Res.(env.String); ok { - u = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + u = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.KeyboardShortcut: arg 0: callback result: expected string", + "context to fyne.KeyboardShortcut: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -36373,16 +34606,16 @@ func ctxTo_fyne_KeyboardShortcut(ps *env.ProgramState, v env.RyeCtx) (fyne.Keybo return res } default: - return nil, errors.New("context to fyne.KeyboardShortcut: context fn Key: expected function") + return nil, errors.New("context to fyne.KeyboardShortcut: context fn Key: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Mod"] + ctxObj1, ok := wordToObj["mod"] if !ok { return nil, errors.New("context to fyne.KeyboardShortcut: expected context to have function Mod") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.KeyboardShortcut: context fn Mod: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.KeyboardShortcut: context fn Mod: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Mod = func(ctx env.RyeCtx) fyne.KeyModifier { actualFn := fn @@ -36400,11 +34633,12 @@ func ctxTo_fyne_KeyboardShortcut(ps *env.ProgramState, v env.RyeCtx) (fyne.Keybo res = natVal } else { var u int - if v, ok := ps.Res.(env.Integer); ok { - u = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + u = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.KeyboardShortcut: arg 0: callback result: expected integer", + "context to fyne.KeyboardShortcut: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -36416,27 +34650,28 @@ func ctxTo_fyne_KeyboardShortcut(ps *env.ProgramState, v env.RyeCtx) (fyne.Keybo return res } default: - return nil, errors.New("context to fyne.KeyboardShortcut: context fn Mod: expected function") + return nil, errors.New("context to fyne.KeyboardShortcut: context fn Mod: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["ShortcutName"] + ctxObj2, ok := wordToObj["shortcut-name"] if !ok { return nil, errors.New("context to fyne.KeyboardShortcut: expected context to have function ShortcutName") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.KeyboardShortcut: context fn ShortcutName: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.KeyboardShortcut: context fn ShortcutName: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_ShortcutName = func(ctx env.RyeCtx) string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.KeyboardShortcut: arg 0: callback result: expected string", + "context to fyne.KeyboardShortcut: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -36445,7 +34680,7 @@ func ctxTo_fyne_KeyboardShortcut(ps *env.ProgramState, v env.RyeCtx) (fyne.Keybo return res } default: - return nil, errors.New("context to fyne.KeyboardShortcut: context fn ShortcutName: expected function") + return nil, errors.New("context to fyne.KeyboardShortcut: context fn ShortcutName: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -36481,103 +34716,71 @@ func ctxTo_fyne_Layout(ps *env.ProgramState, v env.RyeCtx) (fyne.Layout, error) impl := &iface_fyne_Layout{ self: v, } - ctxObj0, ok := wordToObj["Layout"] + ctxObj0, ok := wordToObj["layout"] if !ok { return nil, errors.New("context to fyne.Layout: expected context to have function Layout") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to fyne.Layout: context fn Layout: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to fyne.Layout: context fn Layout: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Layout = func(ctx env.RyeCtx, arg0 []fyne.CanvasObject, arg1 fyne.Size) { - var arg0Val, arg1Val env.Object + impl.fn_Layout = func(ctx env.RyeCtx, farg0 []fyne.CanvasObject, farg1 fyne.Size) { + var farg0Val, farg1Val env.Object { - items := make([]env.Object, len(arg0)) - for i, it := range arg0 { - { - typ := reflect.TypeOf(it) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - items[i] = *env.NewNative(ps.Idx, it, typRyeName) - } else { - items[i] = *env.NewNative(ps.Idx, it, "Go(fyne.CanvasObject)") - } - } + items := make([]env.Object, len(farg0)) + for i, it := range farg0 { + items[i] = ifaceToNative(ps.Idx, it, "Go(fyne.CanvasObject)") } - arg0Val = *env.NewBlock(*env.NewTSeries(items)) + farg0Val = *env.NewBlock(*env.NewTSeries(items)) } - arg1Val = *env.NewNative(ps.Idx, &arg1, "Go(*fyne.Size)") + farg1Val = *env.NewNative(ps.Idx, &farg1, "Go(*fyne.Size)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) } default: - return nil, errors.New("context to fyne.Layout: context fn Layout: expected function") + return nil, errors.New("context to fyne.Layout: context fn Layout: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["MinSize"] + ctxObj1, ok := wordToObj["min-size"] if !ok { return nil, errors.New("context to fyne.Layout: expected context to have function MinSize") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Layout: context fn MinSize: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Layout: context fn MinSize: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_MinSize = func(ctx env.RyeCtx, arg0 []fyne.CanvasObject) fyne.Size { - var arg0Val env.Object + impl.fn_MinSize = func(ctx env.RyeCtx, farg0 []fyne.CanvasObject) fyne.Size { + var farg0Val env.Object { - items := make([]env.Object, len(arg0)) - for i, it := range arg0 { - { - typ := reflect.TypeOf(it) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - items[i] = *env.NewNative(ps.Idx, it, typRyeName) - } else { - items[i] = *env.NewNative(ps.Idx, it, "Go(fyne.CanvasObject)") - } - } + items := make([]env.Object, len(farg0)) + for i, it := range farg0 { + items[i] = ifaceToNative(ps.Idx, it, "Go(fyne.CanvasObject)") } - arg0Val = *env.NewBlock(*env.NewTSeries(items)) + farg0Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res fyne.Size switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(fyne.Size) - if !ok { + if vc, ok := v.Value.(*fyne.Size); ok { + res = *vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Layout: arg 0: callback result: expected native of type fyne.Size", + "context to fyne.Layout: arg 0: callback result: "+"expected native of type *fyne.Size, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Layout: arg 0: callback result: expected native", + "context to fyne.Layout: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -36586,7 +34789,7 @@ func ctxTo_fyne_Layout(ps *env.ProgramState, v env.RyeCtx) (fyne.Layout, error) return res } default: - return nil, errors.New("context to fyne.Layout: context fn MinSize: expected function") + return nil, errors.New("context to fyne.Layout: context fn MinSize: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -36698,14 +34901,14 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem impl := &iface_fyne_LegacyTheme{ self: v, } - ctxObj0, ok := wordToObj["BackgroundColor"] + ctxObj0, ok := wordToObj["background-color"] if !ok { return nil, errors.New("context to fyne.LegacyTheme: expected context to have function BackgroundColor") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.LegacyTheme: context fn BackgroundColor: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.LegacyTheme: context fn BackgroundColor: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_BackgroundColor = func(ctx env.RyeCtx) color.Color { actualFn := fn @@ -36714,19 +34917,21 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem var res color.Color switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native of type color.Color", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native of type color.Color, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -36735,16 +34940,16 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem return res } default: - return nil, errors.New("context to fyne.LegacyTheme: context fn BackgroundColor: expected function") + return nil, errors.New("context to fyne.LegacyTheme: context fn BackgroundColor: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["ButtonColor"] + ctxObj1, ok := wordToObj["button-color"] if !ok { return nil, errors.New("context to fyne.LegacyTheme: expected context to have function ButtonColor") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.LegacyTheme: context fn ButtonColor: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.LegacyTheme: context fn ButtonColor: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_ButtonColor = func(ctx env.RyeCtx) color.Color { actualFn := fn @@ -36753,19 +34958,21 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem var res color.Color switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native of type color.Color", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native of type color.Color, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -36774,16 +34981,16 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem return res } default: - return nil, errors.New("context to fyne.LegacyTheme: context fn ButtonColor: expected function") + return nil, errors.New("context to fyne.LegacyTheme: context fn ButtonColor: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["DisabledButtonColor"] + ctxObj2, ok := wordToObj["disabled-button-color"] if !ok { return nil, errors.New("context to fyne.LegacyTheme: expected context to have function DisabledButtonColor") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.LegacyTheme: context fn DisabledButtonColor: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.LegacyTheme: context fn DisabledButtonColor: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_DisabledButtonColor = func(ctx env.RyeCtx) color.Color { actualFn := fn @@ -36792,19 +34999,21 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem var res color.Color switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native of type color.Color", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native of type color.Color, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -36813,16 +35022,16 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem return res } default: - return nil, errors.New("context to fyne.LegacyTheme: context fn DisabledButtonColor: expected function") + return nil, errors.New("context to fyne.LegacyTheme: context fn DisabledButtonColor: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["TextColor"] + ctxObj3, ok := wordToObj["text-color"] if !ok { return nil, errors.New("context to fyne.LegacyTheme: expected context to have function TextColor") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.LegacyTheme: context fn TextColor: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.LegacyTheme: context fn TextColor: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_TextColor = func(ctx env.RyeCtx) color.Color { actualFn := fn @@ -36831,19 +35040,21 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem var res color.Color switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native of type color.Color", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native of type color.Color, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -36852,16 +35063,16 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem return res } default: - return nil, errors.New("context to fyne.LegacyTheme: context fn TextColor: expected function") + return nil, errors.New("context to fyne.LegacyTheme: context fn TextColor: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["DisabledTextColor"] + ctxObj4, ok := wordToObj["disabled-text-color"] if !ok { return nil, errors.New("context to fyne.LegacyTheme: expected context to have function DisabledTextColor") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.LegacyTheme: context fn DisabledTextColor: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.LegacyTheme: context fn DisabledTextColor: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_DisabledTextColor = func(ctx env.RyeCtx) color.Color { actualFn := fn @@ -36870,19 +35081,21 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem var res color.Color switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native of type color.Color", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native of type color.Color, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -36891,16 +35104,16 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem return res } default: - return nil, errors.New("context to fyne.LegacyTheme: context fn DisabledTextColor: expected function") + return nil, errors.New("context to fyne.LegacyTheme: context fn DisabledTextColor: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["PlaceHolderColor"] + ctxObj5, ok := wordToObj["place-holder-color"] if !ok { return nil, errors.New("context to fyne.LegacyTheme: expected context to have function PlaceHolderColor") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.LegacyTheme: context fn PlaceHolderColor: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.LegacyTheme: context fn PlaceHolderColor: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_PlaceHolderColor = func(ctx env.RyeCtx) color.Color { actualFn := fn @@ -36909,19 +35122,21 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem var res color.Color switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native of type color.Color", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native of type color.Color, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -36930,16 +35145,16 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem return res } default: - return nil, errors.New("context to fyne.LegacyTheme: context fn PlaceHolderColor: expected function") + return nil, errors.New("context to fyne.LegacyTheme: context fn PlaceHolderColor: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["PrimaryColor"] + ctxObj6, ok := wordToObj["primary-color"] if !ok { return nil, errors.New("context to fyne.LegacyTheme: expected context to have function PrimaryColor") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.LegacyTheme: context fn PrimaryColor: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.LegacyTheme: context fn PrimaryColor: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_PrimaryColor = func(ctx env.RyeCtx) color.Color { actualFn := fn @@ -36948,19 +35163,21 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem var res color.Color switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native of type color.Color", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native of type color.Color, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -36969,16 +35186,16 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem return res } default: - return nil, errors.New("context to fyne.LegacyTheme: context fn PrimaryColor: expected function") + return nil, errors.New("context to fyne.LegacyTheme: context fn PrimaryColor: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["HoverColor"] + ctxObj7, ok := wordToObj["hover-color"] if !ok { return nil, errors.New("context to fyne.LegacyTheme: expected context to have function HoverColor") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.LegacyTheme: context fn HoverColor: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.LegacyTheme: context fn HoverColor: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_HoverColor = func(ctx env.RyeCtx) color.Color { actualFn := fn @@ -36987,19 +35204,21 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem var res color.Color switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native of type color.Color", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native of type color.Color, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37008,16 +35227,16 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem return res } default: - return nil, errors.New("context to fyne.LegacyTheme: context fn HoverColor: expected function") + return nil, errors.New("context to fyne.LegacyTheme: context fn HoverColor: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["FocusColor"] + ctxObj8, ok := wordToObj["focus-color"] if !ok { return nil, errors.New("context to fyne.LegacyTheme: expected context to have function FocusColor") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.LegacyTheme: context fn FocusColor: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.LegacyTheme: context fn FocusColor: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_FocusColor = func(ctx env.RyeCtx) color.Color { actualFn := fn @@ -37026,19 +35245,21 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem var res color.Color switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native of type color.Color", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native of type color.Color, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37047,16 +35268,16 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem return res } default: - return nil, errors.New("context to fyne.LegacyTheme: context fn FocusColor: expected function") + return nil, errors.New("context to fyne.LegacyTheme: context fn FocusColor: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["ScrollBarColor"] + ctxObj9, ok := wordToObj["scroll-bar-color"] if !ok { return nil, errors.New("context to fyne.LegacyTheme: expected context to have function ScrollBarColor") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.LegacyTheme: context fn ScrollBarColor: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.LegacyTheme: context fn ScrollBarColor: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_ScrollBarColor = func(ctx env.RyeCtx) color.Color { actualFn := fn @@ -37065,19 +35286,21 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem var res color.Color switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native of type color.Color", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native of type color.Color, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37086,16 +35309,16 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem return res } default: - return nil, errors.New("context to fyne.LegacyTheme: context fn ScrollBarColor: expected function") + return nil, errors.New("context to fyne.LegacyTheme: context fn ScrollBarColor: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj10, ok := wordToObj["ShadowColor"] + ctxObj10, ok := wordToObj["shadow-color"] if !ok { return nil, errors.New("context to fyne.LegacyTheme: expected context to have function ShadowColor") } switch fn := ctxObj10.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.LegacyTheme: context fn ShadowColor: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.LegacyTheme: context fn ShadowColor: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_ShadowColor = func(ctx env.RyeCtx) color.Color { actualFn := fn @@ -37104,19 +35327,21 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem var res color.Color switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native of type color.Color", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native of type color.Color, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37125,27 +35350,28 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem return res } default: - return nil, errors.New("context to fyne.LegacyTheme: context fn ShadowColor: expected function") + return nil, errors.New("context to fyne.LegacyTheme: context fn ShadowColor: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj11, ok := wordToObj["TextSize"] + ctxObj11, ok := wordToObj["text-size"] if !ok { return nil, errors.New("context to fyne.LegacyTheme: expected context to have function TextSize") } switch fn := ctxObj11.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.LegacyTheme: context fn TextSize: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.LegacyTheme: context fn TextSize: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_TextSize = func(ctx env.RyeCtx) int { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res int - if v, ok := ps.Res.(env.Integer); ok { - res = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + res = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected integer", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37154,16 +35380,16 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem return res } default: - return nil, errors.New("context to fyne.LegacyTheme: context fn TextSize: expected function") + return nil, errors.New("context to fyne.LegacyTheme: context fn TextSize: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj12, ok := wordToObj["TextFont"] + ctxObj12, ok := wordToObj["text-font"] if !ok { return nil, errors.New("context to fyne.LegacyTheme: expected context to have function TextFont") } switch fn := ctxObj12.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.LegacyTheme: context fn TextFont: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.LegacyTheme: context fn TextFont: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_TextFont = func(ctx env.RyeCtx) fyne.Resource { actualFn := fn @@ -37175,19 +35401,21 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem var err error res, err = ctxTo_fyne_Resource(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: "+err.Error()+"", + "context to fyne.LegacyTheme: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native of type fyne.Resource", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native of type fyne.Resource, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37195,8 +35423,9 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37204,8 +35433,9 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37214,16 +35444,16 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem return res } default: - return nil, errors.New("context to fyne.LegacyTheme: context fn TextFont: expected function") + return nil, errors.New("context to fyne.LegacyTheme: context fn TextFont: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj13, ok := wordToObj["TextBoldFont"] + ctxObj13, ok := wordToObj["text-bold-font"] if !ok { return nil, errors.New("context to fyne.LegacyTheme: expected context to have function TextBoldFont") } switch fn := ctxObj13.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.LegacyTheme: context fn TextBoldFont: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.LegacyTheme: context fn TextBoldFont: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_TextBoldFont = func(ctx env.RyeCtx) fyne.Resource { actualFn := fn @@ -37235,19 +35465,21 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem var err error res, err = ctxTo_fyne_Resource(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: "+err.Error()+"", + "context to fyne.LegacyTheme: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native of type fyne.Resource", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native of type fyne.Resource, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37255,8 +35487,9 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37264,8 +35497,9 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37274,16 +35508,16 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem return res } default: - return nil, errors.New("context to fyne.LegacyTheme: context fn TextBoldFont: expected function") + return nil, errors.New("context to fyne.LegacyTheme: context fn TextBoldFont: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj14, ok := wordToObj["TextItalicFont"] + ctxObj14, ok := wordToObj["text-italic-font"] if !ok { return nil, errors.New("context to fyne.LegacyTheme: expected context to have function TextItalicFont") } switch fn := ctxObj14.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.LegacyTheme: context fn TextItalicFont: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.LegacyTheme: context fn TextItalicFont: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_TextItalicFont = func(ctx env.RyeCtx) fyne.Resource { actualFn := fn @@ -37295,19 +35529,21 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem var err error res, err = ctxTo_fyne_Resource(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: "+err.Error()+"", + "context to fyne.LegacyTheme: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native of type fyne.Resource", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native of type fyne.Resource, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37315,8 +35551,9 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37324,8 +35561,9 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37334,16 +35572,16 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem return res } default: - return nil, errors.New("context to fyne.LegacyTheme: context fn TextItalicFont: expected function") + return nil, errors.New("context to fyne.LegacyTheme: context fn TextItalicFont: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj15, ok := wordToObj["TextBoldItalicFont"] + ctxObj15, ok := wordToObj["text-bold-italic-font"] if !ok { return nil, errors.New("context to fyne.LegacyTheme: expected context to have function TextBoldItalicFont") } switch fn := ctxObj15.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.LegacyTheme: context fn TextBoldItalicFont: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.LegacyTheme: context fn TextBoldItalicFont: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_TextBoldItalicFont = func(ctx env.RyeCtx) fyne.Resource { actualFn := fn @@ -37355,19 +35593,21 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem var err error res, err = ctxTo_fyne_Resource(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: "+err.Error()+"", + "context to fyne.LegacyTheme: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native of type fyne.Resource", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native of type fyne.Resource, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37375,8 +35615,9 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37384,8 +35625,9 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37394,16 +35636,16 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem return res } default: - return nil, errors.New("context to fyne.LegacyTheme: context fn TextBoldItalicFont: expected function") + return nil, errors.New("context to fyne.LegacyTheme: context fn TextBoldItalicFont: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj16, ok := wordToObj["TextMonospaceFont"] + ctxObj16, ok := wordToObj["text-monospace-font"] if !ok { return nil, errors.New("context to fyne.LegacyTheme: expected context to have function TextMonospaceFont") } switch fn := ctxObj16.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.LegacyTheme: context fn TextMonospaceFont: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.LegacyTheme: context fn TextMonospaceFont: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_TextMonospaceFont = func(ctx env.RyeCtx) fyne.Resource { actualFn := fn @@ -37415,19 +35657,21 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem var err error res, err = ctxTo_fyne_Resource(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: "+err.Error()+"", + "context to fyne.LegacyTheme: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native of type fyne.Resource", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native of type fyne.Resource, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37435,8 +35679,9 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37444,8 +35689,9 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected native", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37454,27 +35700,28 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem return res } default: - return nil, errors.New("context to fyne.LegacyTheme: context fn TextMonospaceFont: expected function") + return nil, errors.New("context to fyne.LegacyTheme: context fn TextMonospaceFont: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj17, ok := wordToObj["Padding"] + ctxObj17, ok := wordToObj["padding"] if !ok { return nil, errors.New("context to fyne.LegacyTheme: expected context to have function Padding") } switch fn := ctxObj17.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.LegacyTheme: context fn Padding: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.LegacyTheme: context fn Padding: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Padding = func(ctx env.RyeCtx) int { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res int - if v, ok := ps.Res.(env.Integer); ok { - res = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + res = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected integer", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37483,27 +35730,28 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem return res } default: - return nil, errors.New("context to fyne.LegacyTheme: context fn Padding: expected function") + return nil, errors.New("context to fyne.LegacyTheme: context fn Padding: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj18, ok := wordToObj["IconInlineSize"] + ctxObj18, ok := wordToObj["icon-inline-size"] if !ok { return nil, errors.New("context to fyne.LegacyTheme: expected context to have function IconInlineSize") } switch fn := ctxObj18.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.LegacyTheme: context fn IconInlineSize: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.LegacyTheme: context fn IconInlineSize: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_IconInlineSize = func(ctx env.RyeCtx) int { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res int - if v, ok := ps.Res.(env.Integer); ok { - res = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + res = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected integer", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37512,27 +35760,28 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem return res } default: - return nil, errors.New("context to fyne.LegacyTheme: context fn IconInlineSize: expected function") + return nil, errors.New("context to fyne.LegacyTheme: context fn IconInlineSize: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj19, ok := wordToObj["ScrollBarSize"] + ctxObj19, ok := wordToObj["scroll-bar-size"] if !ok { return nil, errors.New("context to fyne.LegacyTheme: expected context to have function ScrollBarSize") } switch fn := ctxObj19.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.LegacyTheme: context fn ScrollBarSize: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.LegacyTheme: context fn ScrollBarSize: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_ScrollBarSize = func(ctx env.RyeCtx) int { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res int - if v, ok := ps.Res.(env.Integer); ok { - res = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + res = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected integer", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37541,27 +35790,28 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem return res } default: - return nil, errors.New("context to fyne.LegacyTheme: context fn ScrollBarSize: expected function") + return nil, errors.New("context to fyne.LegacyTheme: context fn ScrollBarSize: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj20, ok := wordToObj["ScrollBarSmallSize"] + ctxObj20, ok := wordToObj["scroll-bar-small-size"] if !ok { return nil, errors.New("context to fyne.LegacyTheme: expected context to have function ScrollBarSmallSize") } switch fn := ctxObj20.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.LegacyTheme: context fn ScrollBarSmallSize: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.LegacyTheme: context fn ScrollBarSmallSize: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_ScrollBarSmallSize = func(ctx env.RyeCtx) int { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res int - if v, ok := ps.Res.(env.Integer); ok { - res = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + res = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.LegacyTheme: arg 0: callback result: expected integer", + "context to fyne.LegacyTheme: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37570,7 +35820,7 @@ func ctxTo_fyne_LegacyTheme(ps *env.ProgramState, v env.RyeCtx) (fyne.LegacyThem return res } default: - return nil, errors.New("context to fyne.LegacyTheme: context fn ScrollBarSmallSize: expected function") + return nil, errors.New("context to fyne.LegacyTheme: context fn ScrollBarSmallSize: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -37614,81 +35864,93 @@ func ctxTo_fyne_Lifecycle(ps *env.ProgramState, v env.RyeCtx) (fyne.Lifecycle, e impl := &iface_fyne_Lifecycle{ self: v, } - ctxObj0, ok := wordToObj["SetOnEnteredForeground"] + ctxObj0, ok := wordToObj["set-on-entered-foreground"] if !ok { return nil, errors.New("context to fyne.Lifecycle: expected context to have function SetOnEnteredForeground") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Lifecycle: context fn SetOnEnteredForeground: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Lifecycle: context fn SetOnEnteredForeground: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetOnEnteredForeground = func(ctx env.RyeCtx, arg0 func()) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(func())") + impl.fn_SetOnEnteredForeground = func(ctx env.RyeCtx, farg0 func()) { + var farg0Val env.Object + farg0Val = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + farg0() + return nil + }, 0, false, false, "Returned func") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Lifecycle: context fn SetOnEnteredForeground: expected function") + return nil, errors.New("context to fyne.Lifecycle: context fn SetOnEnteredForeground: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["SetOnExitedForeground"] + ctxObj1, ok := wordToObj["set-on-exited-foreground"] if !ok { return nil, errors.New("context to fyne.Lifecycle: expected context to have function SetOnExitedForeground") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Lifecycle: context fn SetOnExitedForeground: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Lifecycle: context fn SetOnExitedForeground: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetOnExitedForeground = func(ctx env.RyeCtx, arg0 func()) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(func())") + impl.fn_SetOnExitedForeground = func(ctx env.RyeCtx, farg0 func()) { + var farg0Val env.Object + farg0Val = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + farg0() + return nil + }, 0, false, false, "Returned func") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Lifecycle: context fn SetOnExitedForeground: expected function") + return nil, errors.New("context to fyne.Lifecycle: context fn SetOnExitedForeground: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["SetOnStarted"] + ctxObj2, ok := wordToObj["set-on-started"] if !ok { return nil, errors.New("context to fyne.Lifecycle: expected context to have function SetOnStarted") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Lifecycle: context fn SetOnStarted: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Lifecycle: context fn SetOnStarted: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetOnStarted = func(ctx env.RyeCtx, arg0 func()) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(func())") + impl.fn_SetOnStarted = func(ctx env.RyeCtx, farg0 func()) { + var farg0Val env.Object + farg0Val = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + farg0() + return nil + }, 0, false, false, "Returned func") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Lifecycle: context fn SetOnStarted: expected function") + return nil, errors.New("context to fyne.Lifecycle: context fn SetOnStarted: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["SetOnStopped"] + ctxObj3, ok := wordToObj["set-on-stopped"] if !ok { return nil, errors.New("context to fyne.Lifecycle: expected context to have function SetOnStopped") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Lifecycle: context fn SetOnStopped: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Lifecycle: context fn SetOnStopped: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetOnStopped = func(ctx env.RyeCtx, arg0 func()) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(func())") + impl.fn_SetOnStopped = func(ctx env.RyeCtx, farg0 func()) { + var farg0Val env.Object + farg0Val = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + farg0() + return nil + }, 0, false, false, "Returned func") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Lifecycle: context fn SetOnStopped: expected function") + return nil, errors.New("context to fyne.Lifecycle: context fn SetOnStopped: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -37756,14 +36018,14 @@ func ctxTo_fyne_ListableURI(ps *env.ProgramState, v env.RyeCtx) (fyne.ListableUR impl := &iface_fyne_ListableURI{ self: v, } - ctxObj0, ok := wordToObj["List"] + ctxObj0, ok := wordToObj["list"] if !ok { return nil, errors.New("context to fyne.ListableURI: expected context to have function List") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.ListableURI: context fn List: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.ListableURI: context fn List: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_List = func(ctx env.RyeCtx) ([]fyne.URI, error) { actualFn := fn @@ -37773,16 +36035,18 @@ func ctxTo_fyne_ListableURI(ps *env.ProgramState, v env.RyeCtx) (fyne.ListableUR var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.ListableURI: arg 0: callback result: expected block for multiple return values", + "context to fyne.ListableURI: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.ListableURI: arg 0: callback result: expected block with 2 return values", + "context to fyne.ListableURI: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37797,19 +36061,21 @@ func ctxTo_fyne_ListableURI(ps *env.ProgramState, v env.RyeCtx) (fyne.ListableUR var err error res0[i], err = ctxTo_fyne_URI(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.ListableURI: arg 0: callback result: block item: "+err.Error()+"", + "context to fyne.ListableURI: arg 0: callback result: "+"block item: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0[i], ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + res0[i] = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.ListableURI: arg 0: callback result: block item: expected native of type fyne.URI", + "context to fyne.ListableURI: arg 0: callback result: "+"block item: "+"expected native of type fyne.URI, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37817,8 +36083,9 @@ func ctxTo_fyne_ListableURI(ps *env.ProgramState, v env.RyeCtx) (fyne.ListableUR } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.ListableURI: arg 0: callback result: block item: expected integer to be 0 or nil", + "context to fyne.ListableURI: arg 0: callback result: "+"block item: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37826,29 +36093,20 @@ func ctxTo_fyne_ListableURI(ps *env.ProgramState, v env.RyeCtx) (fyne.ListableUR } res0[i] = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.ListableURI: arg 0: callback result: block item: expected native", + "context to fyne.ListableURI: arg 0: callback result: "+"block item: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } } - case env.Native: - var ok bool - res0, ok = v.Value.([]fyne.URI) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.ListableURI: arg 0: callback result: expected native of type []fyne.URI", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.ListableURI: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.ListableURI: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37856,8 +36114,9 @@ func ctxTo_fyne_ListableURI(ps *env.ProgramState, v env.RyeCtx) (fyne.ListableUR } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.ListableURI: arg 0: callback result: expected block, native or nil", + "context to fyne.ListableURI: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37870,8 +36129,9 @@ func ctxTo_fyne_ListableURI(ps *env.ProgramState, v env.RyeCtx) (fyne.ListableUR res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.ListableURI: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.ListableURI: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37879,8 +36139,9 @@ func ctxTo_fyne_ListableURI(ps *env.ProgramState, v env.RyeCtx) (fyne.ListableUR } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.ListableURI: arg 0: callback result: expected error, string or nil", + "context to fyne.ListableURI: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37889,27 +36150,28 @@ func ctxTo_fyne_ListableURI(ps *env.ProgramState, v env.RyeCtx) (fyne.ListableUR return res0, res1 } default: - return nil, errors.New("context to fyne.ListableURI: context fn List: expected function") + return nil, errors.New("context to fyne.ListableURI: context fn List: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Extension"] + ctxObj1, ok := wordToObj["extension"] if !ok { return nil, errors.New("context to fyne.ListableURI: expected context to have function Extension") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.ListableURI: context fn Extension: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.ListableURI: context fn Extension: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Extension = func(ctx env.RyeCtx) string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.ListableURI: arg 0: callback result: expected string", + "context to fyne.ListableURI: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37918,27 +36180,28 @@ func ctxTo_fyne_ListableURI(ps *env.ProgramState, v env.RyeCtx) (fyne.ListableUR return res } default: - return nil, errors.New("context to fyne.ListableURI: context fn Extension: expected function") + return nil, errors.New("context to fyne.ListableURI: context fn Extension: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Name"] + ctxObj2, ok := wordToObj["name"] if !ok { return nil, errors.New("context to fyne.ListableURI: expected context to have function Name") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.ListableURI: context fn Name: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.ListableURI: context fn Name: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Name = func(ctx env.RyeCtx) string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.ListableURI: arg 0: callback result: expected string", + "context to fyne.ListableURI: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37947,27 +36210,28 @@ func ctxTo_fyne_ListableURI(ps *env.ProgramState, v env.RyeCtx) (fyne.ListableUR return res } default: - return nil, errors.New("context to fyne.ListableURI: context fn Name: expected function") + return nil, errors.New("context to fyne.ListableURI: context fn Name: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["MimeType"] + ctxObj3, ok := wordToObj["mime-type"] if !ok { return nil, errors.New("context to fyne.ListableURI: expected context to have function MimeType") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.ListableURI: context fn MimeType: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.ListableURI: context fn MimeType: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_MimeType = func(ctx env.RyeCtx) string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.ListableURI: arg 0: callback result: expected string", + "context to fyne.ListableURI: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -37976,27 +36240,28 @@ func ctxTo_fyne_ListableURI(ps *env.ProgramState, v env.RyeCtx) (fyne.ListableUR return res } default: - return nil, errors.New("context to fyne.ListableURI: context fn MimeType: expected function") + return nil, errors.New("context to fyne.ListableURI: context fn MimeType: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Scheme"] + ctxObj4, ok := wordToObj["scheme"] if !ok { return nil, errors.New("context to fyne.ListableURI: expected context to have function Scheme") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.ListableURI: context fn Scheme: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.ListableURI: context fn Scheme: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Scheme = func(ctx env.RyeCtx) string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.ListableURI: arg 0: callback result: expected string", + "context to fyne.ListableURI: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -38005,27 +36270,28 @@ func ctxTo_fyne_ListableURI(ps *env.ProgramState, v env.RyeCtx) (fyne.ListableUR return res } default: - return nil, errors.New("context to fyne.ListableURI: context fn Scheme: expected function") + return nil, errors.New("context to fyne.ListableURI: context fn Scheme: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["Authority"] + ctxObj5, ok := wordToObj["authority"] if !ok { return nil, errors.New("context to fyne.ListableURI: expected context to have function Authority") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.ListableURI: context fn Authority: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.ListableURI: context fn Authority: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Authority = func(ctx env.RyeCtx) string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.ListableURI: arg 0: callback result: expected string", + "context to fyne.ListableURI: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -38034,27 +36300,28 @@ func ctxTo_fyne_ListableURI(ps *env.ProgramState, v env.RyeCtx) (fyne.ListableUR return res } default: - return nil, errors.New("context to fyne.ListableURI: context fn Authority: expected function") + return nil, errors.New("context to fyne.ListableURI: context fn Authority: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["Path"] + ctxObj6, ok := wordToObj["path"] if !ok { return nil, errors.New("context to fyne.ListableURI: expected context to have function Path") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.ListableURI: context fn Path: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.ListableURI: context fn Path: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Path = func(ctx env.RyeCtx) string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.ListableURI: arg 0: callback result: expected string", + "context to fyne.ListableURI: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -38063,27 +36330,28 @@ func ctxTo_fyne_ListableURI(ps *env.ProgramState, v env.RyeCtx) (fyne.ListableUR return res } default: - return nil, errors.New("context to fyne.ListableURI: context fn Path: expected function") + return nil, errors.New("context to fyne.ListableURI: context fn Path: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["Query"] + ctxObj7, ok := wordToObj["query"] if !ok { return nil, errors.New("context to fyne.ListableURI: expected context to have function Query") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.ListableURI: context fn Query: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.ListableURI: context fn Query: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Query = func(ctx env.RyeCtx) string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.ListableURI: arg 0: callback result: expected string", + "context to fyne.ListableURI: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -38092,27 +36360,28 @@ func ctxTo_fyne_ListableURI(ps *env.ProgramState, v env.RyeCtx) (fyne.ListableUR return res } default: - return nil, errors.New("context to fyne.ListableURI: context fn Query: expected function") + return nil, errors.New("context to fyne.ListableURI: context fn Query: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["Fragment"] + ctxObj8, ok := wordToObj["fragment"] if !ok { return nil, errors.New("context to fyne.ListableURI: expected context to have function Fragment") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.ListableURI: context fn Fragment: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.ListableURI: context fn Fragment: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Fragment = func(ctx env.RyeCtx) string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.ListableURI: arg 0: callback result: expected string", + "context to fyne.ListableURI: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -38121,27 +36390,28 @@ func ctxTo_fyne_ListableURI(ps *env.ProgramState, v env.RyeCtx) (fyne.ListableUR return res } default: - return nil, errors.New("context to fyne.ListableURI: context fn Fragment: expected function") + return nil, errors.New("context to fyne.ListableURI: context fn Fragment: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["String"] + ctxObj9, ok := wordToObj["string"] if !ok { return nil, errors.New("context to fyne.ListableURI: expected context to have function String") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.ListableURI: context fn String: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.ListableURI: context fn String: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_String = func(ctx env.RyeCtx) string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.ListableURI: arg 0: callback result: expected string", + "context to fyne.ListableURI: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -38150,7 +36420,7 @@ func ctxTo_fyne_ListableURI(ps *env.ProgramState, v env.RyeCtx) (fyne.ListableUR return res } default: - return nil, errors.New("context to fyne.ListableURI: context fn String: expected function") + return nil, errors.New("context to fyne.ListableURI: context fn String: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -38194,50 +36464,33 @@ func ctxTo_fyne_OverlayStack(ps *env.ProgramState, v env.RyeCtx) (fyne.OverlaySt impl := &iface_fyne_OverlayStack{ self: v, } - ctxObj0, ok := wordToObj["Add"] + ctxObj0, ok := wordToObj["add"] if !ok { return nil, errors.New("context to fyne.OverlayStack: expected context to have function Add") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.OverlayStack: context fn Add: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.OverlayStack: context fn Add: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Add = func(ctx env.RyeCtx, arg0 fyne.CanvasObject) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.CanvasObject)") - } - } + impl.fn_Add = func(ctx env.RyeCtx, farg0 fyne.CanvasObject) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.CanvasObject)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.OverlayStack: context fn Add: expected function") + return nil, errors.New("context to fyne.OverlayStack: context fn Add: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["List"] + ctxObj1, ok := wordToObj["list"] if !ok { return nil, errors.New("context to fyne.OverlayStack: expected context to have function List") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.OverlayStack: context fn List: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.OverlayStack: context fn List: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_List = func(ctx env.RyeCtx) []fyne.CanvasObject { actualFn := fn @@ -38253,19 +36506,21 @@ func ctxTo_fyne_OverlayStack(ps *env.ProgramState, v env.RyeCtx) (fyne.OverlaySt var err error res[i], err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.OverlayStack: arg 0: callback result: block item: "+err.Error()+"", + "context to fyne.OverlayStack: arg 0: callback result: "+"block item: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res[i], ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + res[i] = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.OverlayStack: arg 0: callback result: block item: expected native of type fyne.CanvasObject", + "context to fyne.OverlayStack: arg 0: callback result: "+"block item: "+"expected native of type fyne.CanvasObject, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -38273,8 +36528,9 @@ func ctxTo_fyne_OverlayStack(ps *env.ProgramState, v env.RyeCtx) (fyne.OverlaySt } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.OverlayStack: arg 0: callback result: block item: expected integer to be 0 or nil", + "context to fyne.OverlayStack: arg 0: callback result: "+"block item: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -38282,29 +36538,20 @@ func ctxTo_fyne_OverlayStack(ps *env.ProgramState, v env.RyeCtx) (fyne.OverlaySt } res[i] = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.OverlayStack: arg 0: callback result: block item: expected native", + "context to fyne.OverlayStack: arg 0: callback result: "+"block item: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]fyne.CanvasObject) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.OverlayStack: arg 0: callback result: expected native of type []fyne.CanvasObject", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.OverlayStack: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.OverlayStack: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -38312,8 +36559,9 @@ func ctxTo_fyne_OverlayStack(ps *env.ProgramState, v env.RyeCtx) (fyne.OverlaySt } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.OverlayStack: arg 0: callback result: expected block, native or nil", + "context to fyne.OverlayStack: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -38322,52 +36570,35 @@ func ctxTo_fyne_OverlayStack(ps *env.ProgramState, v env.RyeCtx) (fyne.OverlaySt return res } default: - return nil, errors.New("context to fyne.OverlayStack: context fn List: expected function") + return nil, errors.New("context to fyne.OverlayStack: context fn List: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Remove"] + ctxObj2, ok := wordToObj["remove"] if !ok { return nil, errors.New("context to fyne.OverlayStack: expected context to have function Remove") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.OverlayStack: context fn Remove: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.OverlayStack: context fn Remove: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Remove = func(ctx env.RyeCtx, arg0 fyne.CanvasObject) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.CanvasObject)") - } - } + impl.fn_Remove = func(ctx env.RyeCtx, farg0 fyne.CanvasObject) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.CanvasObject)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.OverlayStack: context fn Remove: expected function") + return nil, errors.New("context to fyne.OverlayStack: context fn Remove: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Top"] + ctxObj3, ok := wordToObj["top"] if !ok { return nil, errors.New("context to fyne.OverlayStack: expected context to have function Top") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.OverlayStack: context fn Top: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.OverlayStack: context fn Top: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Top = func(ctx env.RyeCtx) fyne.CanvasObject { actualFn := fn @@ -38379,19 +36610,21 @@ func ctxTo_fyne_OverlayStack(ps *env.ProgramState, v env.RyeCtx) (fyne.OverlaySt var err error res, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.OverlayStack: arg 0: callback result: "+err.Error()+"", + "context to fyne.OverlayStack: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.OverlayStack: arg 0: callback result: expected native of type fyne.CanvasObject", + "context to fyne.OverlayStack: arg 0: callback result: "+"expected native of type fyne.CanvasObject, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -38399,8 +36632,9 @@ func ctxTo_fyne_OverlayStack(ps *env.ProgramState, v env.RyeCtx) (fyne.OverlaySt } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.OverlayStack: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.OverlayStack: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -38408,8 +36642,9 @@ func ctxTo_fyne_OverlayStack(ps *env.ProgramState, v env.RyeCtx) (fyne.OverlaySt } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.OverlayStack: arg 0: callback result: expected native", + "context to fyne.OverlayStack: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -38418,7 +36653,7 @@ func ctxTo_fyne_OverlayStack(ps *env.ProgramState, v env.RyeCtx) (fyne.OverlaySt return res } default: - return nil, errors.New("context to fyne.OverlayStack: context fn Top: expected function") + return nil, errors.New("context to fyne.OverlayStack: context fn Top: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -38554,27 +36789,28 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference impl := &iface_fyne_Preferences{ self: v, } - ctxObj0, ok := wordToObj["Bool"] + ctxObj0, ok := wordToObj["bool"] if !ok { return nil, errors.New("context to fyne.Preferences: expected context to have function Bool") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Preferences: context fn Bool: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Preferences: context fn Bool: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Bool = func(ctx env.RyeCtx, arg0 string) bool { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_Bool = func(ctx env.RyeCtx, farg0 string) bool { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res bool - if v, ok := ps.Res.(env.Integer); ok { - res = v.Value != 0 + if vc, ok := ps.Res.(env.Integer); ok { + res = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected integer", + "context to fyne.Preferences: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -38583,30 +36819,31 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference return res } default: - return nil, errors.New("context to fyne.Preferences: context fn Bool: expected function") + return nil, errors.New("context to fyne.Preferences: context fn Bool: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["BoolWithFallback"] + ctxObj1, ok := wordToObj["bool-with-fallback"] if !ok { return nil, errors.New("context to fyne.Preferences: expected context to have function BoolWithFallback") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to fyne.Preferences: context fn BoolWithFallback: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to fyne.Preferences: context fn BoolWithFallback: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_BoolWithFallback = func(ctx env.RyeCtx, arg0 string, arg1 bool) bool { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewInteger(boolToInt64(arg1)) + impl.fn_BoolWithFallback = func(ctx env.RyeCtx, farg0 string, farg1 bool) bool { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewInteger(boolToInt64(farg1)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res bool - if v, ok := ps.Res.(env.Integer); ok { - res = v.Value != 0 + if vc, ok := ps.Res.(env.Integer); ok { + res = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected integer", + "context to fyne.Preferences: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -38615,74 +36852,65 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference return res } default: - return nil, errors.New("context to fyne.Preferences: context fn BoolWithFallback: expected function") + return nil, errors.New("context to fyne.Preferences: context fn BoolWithFallback: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["SetBool"] + ctxObj2, ok := wordToObj["set-bool"] if !ok { return nil, errors.New("context to fyne.Preferences: expected context to have function SetBool") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to fyne.Preferences: context fn SetBool: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to fyne.Preferences: context fn SetBool: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetBool = func(ctx env.RyeCtx, arg0 string, arg1 bool) { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewInteger(boolToInt64(arg1)) + impl.fn_SetBool = func(ctx env.RyeCtx, farg0 string, farg1 bool) { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewInteger(boolToInt64(farg1)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) } default: - return nil, errors.New("context to fyne.Preferences: context fn SetBool: expected function") + return nil, errors.New("context to fyne.Preferences: context fn SetBool: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["BoolList"] + ctxObj3, ok := wordToObj["bool-list"] if !ok { return nil, errors.New("context to fyne.Preferences: expected context to have function BoolList") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Preferences: context fn BoolList: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Preferences: context fn BoolList: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_BoolList = func(ctx env.RyeCtx, arg0 string) []bool { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_BoolList = func(ctx env.RyeCtx, farg0 string) []bool { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res []bool switch v := ps.Res.(type) { case env.Block: res = make([]bool, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.Integer); ok { - res[i] = v.Value != 0 + if vc, ok := it.(env.Integer); ok { + res[i] = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: block item: expected integer", + "context to fyne.Preferences: arg 0: callback result: "+"block item: "+"expected integer, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]bool) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected native of type []bool", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Preferences: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -38690,8 +36918,9 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected block, native or nil", + "context to fyne.Preferences: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -38700,61 +36929,52 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference return res } default: - return nil, errors.New("context to fyne.Preferences: context fn BoolList: expected function") + return nil, errors.New("context to fyne.Preferences: context fn BoolList: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["BoolListWithFallback"] + ctxObj4, ok := wordToObj["bool-list-with-fallback"] if !ok { return nil, errors.New("context to fyne.Preferences: expected context to have function BoolListWithFallback") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to fyne.Preferences: context fn BoolListWithFallback: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to fyne.Preferences: context fn BoolListWithFallback: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_BoolListWithFallback = func(ctx env.RyeCtx, arg0 string, arg1 []bool) []bool { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_BoolListWithFallback = func(ctx env.RyeCtx, farg0 string, farg1 []bool) []bool { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) { - items := make([]env.Object, len(arg1)) - for i, it := range arg1 { + items := make([]env.Object, len(farg1)) + for i, it := range farg1 { items[i] = *env.NewInteger(boolToInt64(it)) } - arg1Val = *env.NewBlock(*env.NewTSeries(items)) + farg1Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res []bool switch v := ps.Res.(type) { case env.Block: res = make([]bool, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.Integer); ok { - res[i] = v.Value != 0 + if vc, ok := it.(env.Integer); ok { + res[i] = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: block item: expected integer", + "context to fyne.Preferences: arg 0: callback result: "+"block item: "+"expected integer, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]bool) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected native of type []bool", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Preferences: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -38762,8 +36982,9 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected block, native or nil", + "context to fyne.Preferences: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -38772,55 +36993,56 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference return res } default: - return nil, errors.New("context to fyne.Preferences: context fn BoolListWithFallback: expected function") + return nil, errors.New("context to fyne.Preferences: context fn BoolListWithFallback: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["SetBoolList"] + ctxObj5, ok := wordToObj["set-bool-list"] if !ok { return nil, errors.New("context to fyne.Preferences: expected context to have function SetBoolList") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to fyne.Preferences: context fn SetBoolList: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to fyne.Preferences: context fn SetBoolList: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetBoolList = func(ctx env.RyeCtx, arg0 string, arg1 []bool) { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_SetBoolList = func(ctx env.RyeCtx, farg0 string, farg1 []bool) { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) { - items := make([]env.Object, len(arg1)) - for i, it := range arg1 { + items := make([]env.Object, len(farg1)) + for i, it := range farg1 { items[i] = *env.NewInteger(boolToInt64(it)) } - arg1Val = *env.NewBlock(*env.NewTSeries(items)) + farg1Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) } default: - return nil, errors.New("context to fyne.Preferences: context fn SetBoolList: expected function") + return nil, errors.New("context to fyne.Preferences: context fn SetBoolList: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["Float"] + ctxObj6, ok := wordToObj["float"] if !ok { return nil, errors.New("context to fyne.Preferences: expected context to have function Float") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Preferences: context fn Float: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Preferences: context fn Float: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Float = func(ctx env.RyeCtx, arg0 string) float64 { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_Float = func(ctx env.RyeCtx, farg0 string) float64 { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res float64 - if v, ok := ps.Res.(env.Decimal); ok { - res = float64(v.Value) + if vc, ok := ps.Res.(env.Decimal); ok { + res = float64(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected decimal", + "context to fyne.Preferences: arg 0: callback result: "+"expected decimal, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -38829,30 +37051,31 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference return res } default: - return nil, errors.New("context to fyne.Preferences: context fn Float: expected function") + return nil, errors.New("context to fyne.Preferences: context fn Float: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["FloatWithFallback"] + ctxObj7, ok := wordToObj["float-with-fallback"] if !ok { return nil, errors.New("context to fyne.Preferences: expected context to have function FloatWithFallback") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to fyne.Preferences: context fn FloatWithFallback: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to fyne.Preferences: context fn FloatWithFallback: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_FloatWithFallback = func(ctx env.RyeCtx, arg0 string, arg1 float64) float64 { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewDecimal(float64(arg1)) + impl.fn_FloatWithFallback = func(ctx env.RyeCtx, farg0 string, farg1 float64) float64 { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewDecimal(float64(farg1)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res float64 - if v, ok := ps.Res.(env.Decimal); ok { - res = float64(v.Value) + if vc, ok := ps.Res.(env.Decimal); ok { + res = float64(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected decimal", + "context to fyne.Preferences: arg 0: callback result: "+"expected decimal, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -38861,74 +37084,65 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference return res } default: - return nil, errors.New("context to fyne.Preferences: context fn FloatWithFallback: expected function") + return nil, errors.New("context to fyne.Preferences: context fn FloatWithFallback: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["SetFloat"] + ctxObj8, ok := wordToObj["set-float"] if !ok { return nil, errors.New("context to fyne.Preferences: expected context to have function SetFloat") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to fyne.Preferences: context fn SetFloat: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to fyne.Preferences: context fn SetFloat: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetFloat = func(ctx env.RyeCtx, arg0 string, arg1 float64) { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewDecimal(float64(arg1)) + impl.fn_SetFloat = func(ctx env.RyeCtx, farg0 string, farg1 float64) { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewDecimal(float64(farg1)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) } default: - return nil, errors.New("context to fyne.Preferences: context fn SetFloat: expected function") + return nil, errors.New("context to fyne.Preferences: context fn SetFloat: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["FloatList"] + ctxObj9, ok := wordToObj["float-list"] if !ok { return nil, errors.New("context to fyne.Preferences: expected context to have function FloatList") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Preferences: context fn FloatList: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Preferences: context fn FloatList: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_FloatList = func(ctx env.RyeCtx, arg0 string) []float64 { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_FloatList = func(ctx env.RyeCtx, farg0 string) []float64 { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res []float64 switch v := ps.Res.(type) { case env.Block: res = make([]float64, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.Decimal); ok { - res[i] = float64(v.Value) + if vc, ok := it.(env.Decimal); ok { + res[i] = float64(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: block item: expected decimal", + "context to fyne.Preferences: arg 0: callback result: "+"block item: "+"expected decimal, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]float64) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected native of type []float64", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Preferences: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -38936,8 +37150,9 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected block, native or nil", + "context to fyne.Preferences: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -38946,61 +37161,52 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference return res } default: - return nil, errors.New("context to fyne.Preferences: context fn FloatList: expected function") + return nil, errors.New("context to fyne.Preferences: context fn FloatList: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj10, ok := wordToObj["FloatListWithFallback"] + ctxObj10, ok := wordToObj["float-list-with-fallback"] if !ok { return nil, errors.New("context to fyne.Preferences: expected context to have function FloatListWithFallback") } switch fn := ctxObj10.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to fyne.Preferences: context fn FloatListWithFallback: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to fyne.Preferences: context fn FloatListWithFallback: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_FloatListWithFallback = func(ctx env.RyeCtx, arg0 string, arg1 []float64) []float64 { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_FloatListWithFallback = func(ctx env.RyeCtx, farg0 string, farg1 []float64) []float64 { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) { - items := make([]env.Object, len(arg1)) - for i, it := range arg1 { + items := make([]env.Object, len(farg1)) + for i, it := range farg1 { items[i] = *env.NewDecimal(float64(it)) } - arg1Val = *env.NewBlock(*env.NewTSeries(items)) + farg1Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res []float64 switch v := ps.Res.(type) { case env.Block: res = make([]float64, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.Decimal); ok { - res[i] = float64(v.Value) + if vc, ok := it.(env.Decimal); ok { + res[i] = float64(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: block item: expected decimal", + "context to fyne.Preferences: arg 0: callback result: "+"block item: "+"expected decimal, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]float64) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected native of type []float64", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Preferences: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -39008,8 +37214,9 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected block, native or nil", + "context to fyne.Preferences: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -39018,55 +37225,56 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference return res } default: - return nil, errors.New("context to fyne.Preferences: context fn FloatListWithFallback: expected function") + return nil, errors.New("context to fyne.Preferences: context fn FloatListWithFallback: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj11, ok := wordToObj["SetFloatList"] + ctxObj11, ok := wordToObj["set-float-list"] if !ok { return nil, errors.New("context to fyne.Preferences: expected context to have function SetFloatList") } switch fn := ctxObj11.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to fyne.Preferences: context fn SetFloatList: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to fyne.Preferences: context fn SetFloatList: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetFloatList = func(ctx env.RyeCtx, arg0 string, arg1 []float64) { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_SetFloatList = func(ctx env.RyeCtx, farg0 string, farg1 []float64) { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) { - items := make([]env.Object, len(arg1)) - for i, it := range arg1 { + items := make([]env.Object, len(farg1)) + for i, it := range farg1 { items[i] = *env.NewDecimal(float64(it)) } - arg1Val = *env.NewBlock(*env.NewTSeries(items)) + farg1Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) } default: - return nil, errors.New("context to fyne.Preferences: context fn SetFloatList: expected function") + return nil, errors.New("context to fyne.Preferences: context fn SetFloatList: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj12, ok := wordToObj["Int"] + ctxObj12, ok := wordToObj["int"] if !ok { return nil, errors.New("context to fyne.Preferences: expected context to have function Int") } switch fn := ctxObj12.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Preferences: context fn Int: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Preferences: context fn Int: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Int = func(ctx env.RyeCtx, arg0 string) int { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_Int = func(ctx env.RyeCtx, farg0 string) int { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res int - if v, ok := ps.Res.(env.Integer); ok { - res = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + res = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected integer", + "context to fyne.Preferences: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -39075,30 +37283,31 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference return res } default: - return nil, errors.New("context to fyne.Preferences: context fn Int: expected function") + return nil, errors.New("context to fyne.Preferences: context fn Int: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj13, ok := wordToObj["IntWithFallback"] + ctxObj13, ok := wordToObj["int-with-fallback"] if !ok { return nil, errors.New("context to fyne.Preferences: expected context to have function IntWithFallback") } switch fn := ctxObj13.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to fyne.Preferences: context fn IntWithFallback: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to fyne.Preferences: context fn IntWithFallback: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_IntWithFallback = func(ctx env.RyeCtx, arg0 string, arg1 int) int { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewInteger(int64(arg1)) + impl.fn_IntWithFallback = func(ctx env.RyeCtx, farg0 string, farg1 int) int { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewInteger(int64(farg1)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res int - if v, ok := ps.Res.(env.Integer); ok { - res = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + res = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected integer", + "context to fyne.Preferences: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -39107,74 +37316,65 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference return res } default: - return nil, errors.New("context to fyne.Preferences: context fn IntWithFallback: expected function") + return nil, errors.New("context to fyne.Preferences: context fn IntWithFallback: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj14, ok := wordToObj["SetInt"] + ctxObj14, ok := wordToObj["set-int"] if !ok { return nil, errors.New("context to fyne.Preferences: expected context to have function SetInt") } switch fn := ctxObj14.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to fyne.Preferences: context fn SetInt: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to fyne.Preferences: context fn SetInt: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetInt = func(ctx env.RyeCtx, arg0 string, arg1 int) { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewInteger(int64(arg1)) + impl.fn_SetInt = func(ctx env.RyeCtx, farg0 string, farg1 int) { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewInteger(int64(farg1)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) } default: - return nil, errors.New("context to fyne.Preferences: context fn SetInt: expected function") + return nil, errors.New("context to fyne.Preferences: context fn SetInt: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj15, ok := wordToObj["IntList"] + ctxObj15, ok := wordToObj["int-list"] if !ok { return nil, errors.New("context to fyne.Preferences: expected context to have function IntList") } switch fn := ctxObj15.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Preferences: context fn IntList: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Preferences: context fn IntList: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_IntList = func(ctx env.RyeCtx, arg0 string) []int { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_IntList = func(ctx env.RyeCtx, farg0 string) []int { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res []int switch v := ps.Res.(type) { case env.Block: res = make([]int, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.Integer); ok { - res[i] = int(v.Value) + if vc, ok := it.(env.Integer); ok { + res[i] = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: block item: expected integer", + "context to fyne.Preferences: arg 0: callback result: "+"block item: "+"expected integer, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]int) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected native of type []int", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Preferences: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -39182,8 +37382,9 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected block, native or nil", + "context to fyne.Preferences: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -39192,61 +37393,52 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference return res } default: - return nil, errors.New("context to fyne.Preferences: context fn IntList: expected function") + return nil, errors.New("context to fyne.Preferences: context fn IntList: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj16, ok := wordToObj["IntListWithFallback"] + ctxObj16, ok := wordToObj["int-list-with-fallback"] if !ok { return nil, errors.New("context to fyne.Preferences: expected context to have function IntListWithFallback") } switch fn := ctxObj16.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to fyne.Preferences: context fn IntListWithFallback: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to fyne.Preferences: context fn IntListWithFallback: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_IntListWithFallback = func(ctx env.RyeCtx, arg0 string, arg1 []int) []int { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_IntListWithFallback = func(ctx env.RyeCtx, farg0 string, farg1 []int) []int { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) { - items := make([]env.Object, len(arg1)) - for i, it := range arg1 { + items := make([]env.Object, len(farg1)) + for i, it := range farg1 { items[i] = *env.NewInteger(int64(it)) } - arg1Val = *env.NewBlock(*env.NewTSeries(items)) + farg1Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res []int switch v := ps.Res.(type) { case env.Block: res = make([]int, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.Integer); ok { - res[i] = int(v.Value) + if vc, ok := it.(env.Integer); ok { + res[i] = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: block item: expected integer", + "context to fyne.Preferences: arg 0: callback result: "+"block item: "+"expected integer, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]int) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected native of type []int", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Preferences: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -39254,8 +37446,9 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected block, native or nil", + "context to fyne.Preferences: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -39264,55 +37457,56 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference return res } default: - return nil, errors.New("context to fyne.Preferences: context fn IntListWithFallback: expected function") + return nil, errors.New("context to fyne.Preferences: context fn IntListWithFallback: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj17, ok := wordToObj["SetIntList"] + ctxObj17, ok := wordToObj["set-int-list"] if !ok { return nil, errors.New("context to fyne.Preferences: expected context to have function SetIntList") } switch fn := ctxObj17.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to fyne.Preferences: context fn SetIntList: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to fyne.Preferences: context fn SetIntList: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetIntList = func(ctx env.RyeCtx, arg0 string, arg1 []int) { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_SetIntList = func(ctx env.RyeCtx, farg0 string, farg1 []int) { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) { - items := make([]env.Object, len(arg1)) - for i, it := range arg1 { + items := make([]env.Object, len(farg1)) + for i, it := range farg1 { items[i] = *env.NewInteger(int64(it)) } - arg1Val = *env.NewBlock(*env.NewTSeries(items)) + farg1Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) } default: - return nil, errors.New("context to fyne.Preferences: context fn SetIntList: expected function") + return nil, errors.New("context to fyne.Preferences: context fn SetIntList: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj18, ok := wordToObj["String"] + ctxObj18, ok := wordToObj["string"] if !ok { return nil, errors.New("context to fyne.Preferences: expected context to have function String") } switch fn := ctxObj18.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Preferences: context fn String: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Preferences: context fn String: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_String = func(ctx env.RyeCtx, arg0 string) string { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_String = func(ctx env.RyeCtx, farg0 string) string { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected string", + "context to fyne.Preferences: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -39321,30 +37515,31 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference return res } default: - return nil, errors.New("context to fyne.Preferences: context fn String: expected function") + return nil, errors.New("context to fyne.Preferences: context fn String: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj19, ok := wordToObj["StringWithFallback"] + ctxObj19, ok := wordToObj["string-with-fallback"] if !ok { return nil, errors.New("context to fyne.Preferences: expected context to have function StringWithFallback") } switch fn := ctxObj19.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to fyne.Preferences: context fn StringWithFallback: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to fyne.Preferences: context fn StringWithFallback: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_StringWithFallback = func(ctx env.RyeCtx, arg0 string, arg1 string) string { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) + impl.fn_StringWithFallback = func(ctx env.RyeCtx, farg0 string, farg1 string) string { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected string", + "context to fyne.Preferences: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -39353,74 +37548,65 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference return res } default: - return nil, errors.New("context to fyne.Preferences: context fn StringWithFallback: expected function") + return nil, errors.New("context to fyne.Preferences: context fn StringWithFallback: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj20, ok := wordToObj["SetString"] + ctxObj20, ok := wordToObj["set-string"] if !ok { return nil, errors.New("context to fyne.Preferences: expected context to have function SetString") } switch fn := ctxObj20.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to fyne.Preferences: context fn SetString: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to fyne.Preferences: context fn SetString: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetString = func(ctx env.RyeCtx, arg0 string, arg1 string) { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) - arg1Val = *env.NewString(arg1) + impl.fn_SetString = func(ctx env.RyeCtx, farg0 string, farg1 string) { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) + farg1Val = *env.NewString(farg1) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) } default: - return nil, errors.New("context to fyne.Preferences: context fn SetString: expected function") + return nil, errors.New("context to fyne.Preferences: context fn SetString: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj21, ok := wordToObj["StringList"] + ctxObj21, ok := wordToObj["string-list"] if !ok { return nil, errors.New("context to fyne.Preferences: expected context to have function StringList") } switch fn := ctxObj21.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Preferences: context fn StringList: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Preferences: context fn StringList: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_StringList = func(ctx env.RyeCtx, arg0 string) []string { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_StringList = func(ctx env.RyeCtx, farg0 string) []string { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res []string switch v := ps.Res.(type) { case env.Block: res = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - res[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + res[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: block item: expected string", + "context to fyne.Preferences: arg 0: callback result: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Preferences: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -39428,8 +37614,9 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected block, native or nil", + "context to fyne.Preferences: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -39438,61 +37625,52 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference return res } default: - return nil, errors.New("context to fyne.Preferences: context fn StringList: expected function") + return nil, errors.New("context to fyne.Preferences: context fn StringList: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj22, ok := wordToObj["StringListWithFallback"] + ctxObj22, ok := wordToObj["string-list-with-fallback"] if !ok { return nil, errors.New("context to fyne.Preferences: expected context to have function StringListWithFallback") } switch fn := ctxObj22.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to fyne.Preferences: context fn StringListWithFallback: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to fyne.Preferences: context fn StringListWithFallback: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_StringListWithFallback = func(ctx env.RyeCtx, arg0 string, arg1 []string) []string { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_StringListWithFallback = func(ctx env.RyeCtx, farg0 string, farg1 []string) []string { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) { - items := make([]env.Object, len(arg1)) - for i, it := range arg1 { + items := make([]env.Object, len(farg1)) + for i, it := range farg1 { items[i] = *env.NewString(it) } - arg1Val = *env.NewBlock(*env.NewTSeries(items)) + farg1Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res []string switch v := ps.Res.(type) { case env.Block: res = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - res[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + res[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: block item: expected string", + "context to fyne.Preferences: arg 0: callback result: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Preferences: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -39500,8 +37678,9 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected block, native or nil", + "context to fyne.Preferences: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -39510,80 +37689,83 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference return res } default: - return nil, errors.New("context to fyne.Preferences: context fn StringListWithFallback: expected function") + return nil, errors.New("context to fyne.Preferences: context fn StringListWithFallback: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj23, ok := wordToObj["SetStringList"] + ctxObj23, ok := wordToObj["set-string-list"] if !ok { return nil, errors.New("context to fyne.Preferences: expected context to have function SetStringList") } switch fn := ctxObj23.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to fyne.Preferences: context fn SetStringList: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to fyne.Preferences: context fn SetStringList: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetStringList = func(ctx env.RyeCtx, arg0 string, arg1 []string) { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_SetStringList = func(ctx env.RyeCtx, farg0 string, farg1 []string) { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(farg0) { - items := make([]env.Object, len(arg1)) - for i, it := range arg1 { + items := make([]env.Object, len(farg1)) + for i, it := range farg1 { items[i] = *env.NewString(it) } - arg1Val = *env.NewBlock(*env.NewTSeries(items)) + farg1Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) } default: - return nil, errors.New("context to fyne.Preferences: context fn SetStringList: expected function") + return nil, errors.New("context to fyne.Preferences: context fn SetStringList: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj24, ok := wordToObj["RemoveValue"] + ctxObj24, ok := wordToObj["remove-value"] if !ok { return nil, errors.New("context to fyne.Preferences: expected context to have function RemoveValue") } switch fn := ctxObj24.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Preferences: context fn RemoveValue: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Preferences: context fn RemoveValue: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveValue = func(ctx env.RyeCtx, arg0 string) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_RemoveValue = func(ctx env.RyeCtx, farg0 string) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Preferences: context fn RemoveValue: expected function") + return nil, errors.New("context to fyne.Preferences: context fn RemoveValue: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj25, ok := wordToObj["AddChangeListener"] + ctxObj25, ok := wordToObj["add-change-listener"] if !ok { return nil, errors.New("context to fyne.Preferences: expected context to have function AddChangeListener") } switch fn := ctxObj25.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Preferences: context fn AddChangeListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Preferences: context fn AddChangeListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddChangeListener = func(ctx env.RyeCtx, arg0 func()) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(func())") + impl.fn_AddChangeListener = func(ctx env.RyeCtx, farg0 func()) { + var farg0Val env.Object + farg0Val = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + farg0() + return nil + }, 0, false, false, "Returned func") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Preferences: context fn AddChangeListener: expected function") + return nil, errors.New("context to fyne.Preferences: context fn AddChangeListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj26, ok := wordToObj["ChangeListeners"] + ctxObj26, ok := wordToObj["change-listeners"] if !ok { return nil, errors.New("context to fyne.Preferences: expected context to have function ChangeListeners") } switch fn := ctxObj26.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Preferences: context fn ChangeListeners: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Preferences: context fn ChangeListeners: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_ChangeListeners = func(ctx env.RyeCtx) []func() { actualFn := fn @@ -39597,8 +37779,9 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference switch fn := it.(type) { case env.Function: if fn.Argsn != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: block item: function has invalid number of arguments (expected 0)", + "context to fyne.Preferences: arg 0: callback result: "+"block item: "+"expected 0 function arguments, but got "+strconv.Itoa(fn.Argsn), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -39611,8 +37794,9 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference } case env.Integer: if fn.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: block item: expected integer to be 0 or nil", + "context to fyne.Preferences: arg 0: callback result: "+"block item: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(fn.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -39620,29 +37804,20 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference } res[i] = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: block item: expected function or nil", + "context to fyne.Preferences: arg 0: callback result: "+"block item: "+"expected function or nil, but got "+objectDebugString(ps.Idx, fn), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]func()) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected native of type []func()", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Preferences: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -39650,8 +37825,9 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Preferences: arg 0: callback result: expected block, native or nil", + "context to fyne.Preferences: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -39660,7 +37836,7 @@ func ctxTo_fyne_Preferences(ps *env.ProgramState, v env.RyeCtx) (fyne.Preference return res } default: - return nil, errors.New("context to fyne.Preferences: context fn ChangeListeners: expected function") + return nil, errors.New("context to fyne.Preferences: context fn ChangeListeners: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -39696,25 +37872,26 @@ func ctxTo_fyne_Resource(ps *env.ProgramState, v env.RyeCtx) (fyne.Resource, err impl := &iface_fyne_Resource{ self: v, } - ctxObj0, ok := wordToObj["Name"] + ctxObj0, ok := wordToObj["name"] if !ok { return nil, errors.New("context to fyne.Resource: expected context to have function Name") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Resource: context fn Name: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Resource: context fn Name: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Name = func(ctx env.RyeCtx) string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Resource: arg 0: callback result: expected string", + "context to fyne.Resource: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -39723,16 +37900,16 @@ func ctxTo_fyne_Resource(ps *env.ProgramState, v env.RyeCtx) (fyne.Resource, err return res } default: - return nil, errors.New("context to fyne.Resource: context fn Name: expected function") + return nil, errors.New("context to fyne.Resource: context fn Name: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Content"] + ctxObj1, ok := wordToObj["content"] if !ok { return nil, errors.New("context to fyne.Resource: expected context to have function Content") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Resource: context fn Content: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Resource: context fn Content: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Content = func(ctx env.RyeCtx) []byte { actualFn := fn @@ -39745,40 +37922,32 @@ func ctxTo_fyne_Resource(ps *env.ProgramState, v env.RyeCtx) (fyne.Resource, err for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - res[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + res[i] = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Resource: arg 0: callback result: block item: expected native of type byte", + "context to fyne.Resource: arg 0: callback result: "+"block item: "+"expected native of type byte, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Resource: arg 0: callback result: block item: expected native", + "context to fyne.Resource: arg 0: callback result: "+"block item: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]byte) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Resource: arg 0: callback result: expected native of type []byte", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Resource: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Resource: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -39786,8 +37955,9 @@ func ctxTo_fyne_Resource(ps *env.ProgramState, v env.RyeCtx) (fyne.Resource, err } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Resource: arg 0: callback result: expected block, native or nil", + "context to fyne.Resource: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -39796,7 +37966,7 @@ func ctxTo_fyne_Resource(ps *env.ProgramState, v env.RyeCtx) (fyne.Resource, err return res } default: - return nil, errors.New("context to fyne.Resource: context fn Content: expected function") + return nil, errors.New("context to fyne.Resource: context fn Content: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -39828,24 +37998,24 @@ func ctxTo_fyne_Scrollable(ps *env.ProgramState, v env.RyeCtx) (fyne.Scrollable, impl := &iface_fyne_Scrollable{ self: v, } - ctxObj0, ok := wordToObj["Scrolled"] + ctxObj0, ok := wordToObj["scrolled"] if !ok { return nil, errors.New("context to fyne.Scrollable: expected context to have function Scrolled") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Scrollable: context fn Scrolled: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Scrollable: context fn Scrolled: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Scrolled = func(ctx env.RyeCtx, arg0 *fyne.ScrollEvent) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*fyne.ScrollEvent)") + impl.fn_Scrolled = func(ctx env.RyeCtx, farg0 *fyne.ScrollEvent) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*fyne.ScrollEvent)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Scrollable: context fn Scrolled: expected function") + return nil, errors.New("context to fyne.Scrollable: context fn Scrolled: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -39877,24 +38047,24 @@ func ctxTo_fyne_SecondaryTappable(ps *env.ProgramState, v env.RyeCtx) (fyne.Seco impl := &iface_fyne_SecondaryTappable{ self: v, } - ctxObj0, ok := wordToObj["TappedSecondary"] + ctxObj0, ok := wordToObj["tapped-secondary"] if !ok { return nil, errors.New("context to fyne.SecondaryTappable: expected context to have function TappedSecondary") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.SecondaryTappable: context fn TappedSecondary: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.SecondaryTappable: context fn TappedSecondary: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_TappedSecondary = func(ctx env.RyeCtx, arg0 *fyne.PointEvent) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*fyne.PointEvent)") + impl.fn_TappedSecondary = func(ctx env.RyeCtx, farg0 *fyne.PointEvent) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*fyne.PointEvent)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.SecondaryTappable: context fn TappedSecondary: expected function") + return nil, errors.New("context to fyne.SecondaryTappable: context fn TappedSecondary: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -39954,14 +38124,14 @@ func ctxTo_fyne_Settings(ps *env.ProgramState, v env.RyeCtx) (fyne.Settings, err impl := &iface_fyne_Settings{ self: v, } - ctxObj0, ok := wordToObj["Theme"] + ctxObj0, ok := wordToObj["theme"] if !ok { return nil, errors.New("context to fyne.Settings: expected context to have function Theme") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Settings: context fn Theme: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Settings: context fn Theme: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Theme = func(ctx env.RyeCtx) fyne.Theme { actualFn := fn @@ -39973,19 +38143,21 @@ func ctxTo_fyne_Settings(ps *env.ProgramState, v env.RyeCtx) (fyne.Settings, err var err error res, err = ctxTo_fyne_Theme(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Settings: arg 0: callback result: "+err.Error()+"", + "context to fyne.Settings: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.Theme) - if !ok { + if vc, ok := v.Value.(fyne.Theme); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Settings: arg 0: callback result: expected native of type fyne.Theme", + "context to fyne.Settings: arg 0: callback result: "+"expected native of type fyne.Theme, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -39993,8 +38165,9 @@ func ctxTo_fyne_Settings(ps *env.ProgramState, v env.RyeCtx) (fyne.Settings, err } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Settings: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Settings: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40002,8 +38175,9 @@ func ctxTo_fyne_Settings(ps *env.ProgramState, v env.RyeCtx) (fyne.Settings, err } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Settings: arg 0: callback result: expected native", + "context to fyne.Settings: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40012,52 +38186,35 @@ func ctxTo_fyne_Settings(ps *env.ProgramState, v env.RyeCtx) (fyne.Settings, err return res } default: - return nil, errors.New("context to fyne.Settings: context fn Theme: expected function") + return nil, errors.New("context to fyne.Settings: context fn Theme: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["SetTheme"] + ctxObj1, ok := wordToObj["set-theme"] if !ok { return nil, errors.New("context to fyne.Settings: expected context to have function SetTheme") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Settings: context fn SetTheme: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Settings: context fn SetTheme: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetTheme = func(ctx env.RyeCtx, arg0 fyne.Theme) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.Theme)") - } - } + impl.fn_SetTheme = func(ctx env.RyeCtx, farg0 fyne.Theme) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.Theme)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Settings: context fn SetTheme: expected function") + return nil, errors.New("context to fyne.Settings: context fn SetTheme: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["ThemeVariant"] + ctxObj2, ok := wordToObj["theme-variant"] if !ok { return nil, errors.New("context to fyne.Settings: expected context to have function ThemeVariant") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Settings: context fn ThemeVariant: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Settings: context fn ThemeVariant: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_ThemeVariant = func(ctx env.RyeCtx) fyne.ThemeVariant { actualFn := fn @@ -40075,11 +38232,12 @@ func ctxTo_fyne_Settings(ps *env.ProgramState, v env.RyeCtx) (fyne.Settings, err res = natVal } else { var u uint - if v, ok := ps.Res.(env.Integer); ok { - u = uint(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + u = uint(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Settings: arg 0: callback result: expected integer", + "context to fyne.Settings: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40091,27 +38249,28 @@ func ctxTo_fyne_Settings(ps *env.ProgramState, v env.RyeCtx) (fyne.Settings, err return res } default: - return nil, errors.New("context to fyne.Settings: context fn ThemeVariant: expected function") + return nil, errors.New("context to fyne.Settings: context fn ThemeVariant: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Scale"] + ctxObj3, ok := wordToObj["scale"] if !ok { return nil, errors.New("context to fyne.Settings: expected context to have function Scale") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Settings: context fn Scale: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Settings: context fn Scale: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Scale = func(ctx env.RyeCtx) float32 { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res float32 - if v, ok := ps.Res.(env.Decimal); ok { - res = float32(v.Value) + if vc, ok := ps.Res.(env.Decimal); ok { + res = float32(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Settings: arg 0: callback result: expected decimal", + "context to fyne.Settings: arg 0: callback result: "+"expected decimal, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40120,27 +38279,28 @@ func ctxTo_fyne_Settings(ps *env.ProgramState, v env.RyeCtx) (fyne.Settings, err return res } default: - return nil, errors.New("context to fyne.Settings: context fn Scale: expected function") + return nil, errors.New("context to fyne.Settings: context fn Scale: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["PrimaryColor"] + ctxObj4, ok := wordToObj["primary-color"] if !ok { return nil, errors.New("context to fyne.Settings: expected context to have function PrimaryColor") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Settings: context fn PrimaryColor: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Settings: context fn PrimaryColor: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_PrimaryColor = func(ctx env.RyeCtx) string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Settings: arg 0: callback result: expected string", + "context to fyne.Settings: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40149,35 +38309,35 @@ func ctxTo_fyne_Settings(ps *env.ProgramState, v env.RyeCtx) (fyne.Settings, err return res } default: - return nil, errors.New("context to fyne.Settings: context fn PrimaryColor: expected function") + return nil, errors.New("context to fyne.Settings: context fn PrimaryColor: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["AddChangeListener"] + ctxObj5, ok := wordToObj["add-change-listener"] if !ok { return nil, errors.New("context to fyne.Settings: expected context to have function AddChangeListener") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Settings: context fn AddChangeListener: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Settings: context fn AddChangeListener: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_AddChangeListener = func(ctx env.RyeCtx, arg0 chan fyne.Settings) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(chan fyne.Settings)") + impl.fn_AddChangeListener = func(ctx env.RyeCtx, farg0 chan fyne.Settings) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(chan fyne.Settings)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Settings: context fn AddChangeListener: expected function") + return nil, errors.New("context to fyne.Settings: context fn AddChangeListener: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["BuildType"] + ctxObj6, ok := wordToObj["build-type"] if !ok { return nil, errors.New("context to fyne.Settings: expected context to have function BuildType") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Settings: context fn BuildType: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Settings: context fn BuildType: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_BuildType = func(ctx env.RyeCtx) fyne.BuildType { actualFn := fn @@ -40195,11 +38355,12 @@ func ctxTo_fyne_Settings(ps *env.ProgramState, v env.RyeCtx) (fyne.Settings, err res = natVal } else { var u int - if v, ok := ps.Res.(env.Integer); ok { - u = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + u = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Settings: arg 0: callback result: expected integer", + "context to fyne.Settings: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40211,27 +38372,28 @@ func ctxTo_fyne_Settings(ps *env.ProgramState, v env.RyeCtx) (fyne.Settings, err return res } default: - return nil, errors.New("context to fyne.Settings: context fn BuildType: expected function") + return nil, errors.New("context to fyne.Settings: context fn BuildType: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["ShowAnimations"] + ctxObj7, ok := wordToObj["show-animations"] if !ok { return nil, errors.New("context to fyne.Settings: expected context to have function ShowAnimations") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Settings: context fn ShowAnimations: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Settings: context fn ShowAnimations: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_ShowAnimations = func(ctx env.RyeCtx) bool { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res bool - if v, ok := ps.Res.(env.Integer); ok { - res = v.Value != 0 + if vc, ok := ps.Res.(env.Integer); ok { + res = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Settings: arg 0: callback result: expected integer", + "context to fyne.Settings: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40240,7 +38402,7 @@ func ctxTo_fyne_Settings(ps *env.ProgramState, v env.RyeCtx) (fyne.Settings, err return res } default: - return nil, errors.New("context to fyne.Settings: context fn ShowAnimations: expected function") + return nil, errors.New("context to fyne.Settings: context fn ShowAnimations: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -40272,25 +38434,26 @@ func ctxTo_fyne_Shortcut(ps *env.ProgramState, v env.RyeCtx) (fyne.Shortcut, err impl := &iface_fyne_Shortcut{ self: v, } - ctxObj0, ok := wordToObj["ShortcutName"] + ctxObj0, ok := wordToObj["shortcut-name"] if !ok { return nil, errors.New("context to fyne.Shortcut: expected context to have function ShortcutName") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Shortcut: context fn ShortcutName: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Shortcut: context fn ShortcutName: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_ShortcutName = func(ctx env.RyeCtx) string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Shortcut: arg 0: callback result: expected string", + "context to fyne.Shortcut: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40299,7 +38462,7 @@ func ctxTo_fyne_Shortcut(ps *env.ProgramState, v env.RyeCtx) (fyne.Shortcut, err return res } default: - return nil, errors.New("context to fyne.Shortcut: context fn ShortcutName: expected function") + return nil, errors.New("context to fyne.Shortcut: context fn ShortcutName: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -40331,41 +38494,24 @@ func ctxTo_fyne_Shortcutable(ps *env.ProgramState, v env.RyeCtx) (fyne.Shortcuta impl := &iface_fyne_Shortcutable{ self: v, } - ctxObj0, ok := wordToObj["TypedShortcut"] + ctxObj0, ok := wordToObj["typed-shortcut"] if !ok { return nil, errors.New("context to fyne.Shortcutable: expected context to have function TypedShortcut") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Shortcutable: context fn TypedShortcut: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Shortcutable: context fn TypedShortcut: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_TypedShortcut = func(ctx env.RyeCtx, arg0 fyne.Shortcut) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.Shortcut)") - } - } + impl.fn_TypedShortcut = func(ctx env.RyeCtx, farg0 fyne.Shortcut) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.Shortcut)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Shortcutable: context fn TypedShortcut: expected function") + return nil, errors.New("context to fyne.Shortcutable: context fn TypedShortcut: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -40417,14 +38563,14 @@ func ctxTo_fyne_Storage(ps *env.ProgramState, v env.RyeCtx) (fyne.Storage, error impl := &iface_fyne_Storage{ self: v, } - ctxObj0, ok := wordToObj["RootURI"] + ctxObj0, ok := wordToObj["root-uri"] if !ok { return nil, errors.New("context to fyne.Storage: expected context to have function RootURI") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Storage: context fn RootURI: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Storage: context fn RootURI: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_RootURI = func(ctx env.RyeCtx) fyne.URI { actualFn := fn @@ -40436,19 +38582,21 @@ func ctxTo_fyne_Storage(ps *env.ProgramState, v env.RyeCtx) (fyne.Storage, error var err error res, err = ctxTo_fyne_URI(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: "+err.Error()+"", + "context to fyne.Storage: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: expected native of type fyne.URI", + "context to fyne.Storage: arg 0: callback result: "+"expected native of type fyne.URI, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40456,8 +38604,9 @@ func ctxTo_fyne_Storage(ps *env.ProgramState, v env.RyeCtx) (fyne.Storage, error } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Storage: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40465,8 +38614,9 @@ func ctxTo_fyne_Storage(ps *env.ProgramState, v env.RyeCtx) (fyne.Storage, error } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: expected native", + "context to fyne.Storage: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40475,37 +38625,39 @@ func ctxTo_fyne_Storage(ps *env.ProgramState, v env.RyeCtx) (fyne.Storage, error return res } default: - return nil, errors.New("context to fyne.Storage: context fn RootURI: expected function") + return nil, errors.New("context to fyne.Storage: context fn RootURI: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Create"] + ctxObj1, ok := wordToObj["create"] if !ok { return nil, errors.New("context to fyne.Storage: expected context to have function Create") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Storage: context fn Create: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Storage: context fn Create: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Create = func(ctx env.RyeCtx, arg0 string) (fyne.URIWriteCloser, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_Create = func(ctx env.RyeCtx, farg0 string) (fyne.URIWriteCloser, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 fyne.URIWriteCloser var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: expected block for multiple return values", + "context to fyne.Storage: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: expected block with 2 return values", + "context to fyne.Storage: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40516,19 +38668,21 @@ func ctxTo_fyne_Storage(ps *env.ProgramState, v env.RyeCtx) (fyne.Storage, error var err error res0, err = ctxTo_fyne_URIWriteCloser(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: "+err.Error()+"", + "context to fyne.Storage: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(fyne.URIWriteCloser) - if !ok { + if vc, ok := v.Value.(fyne.URIWriteCloser); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: expected native of type fyne.URIWriteCloser", + "context to fyne.Storage: arg 0: callback result: "+"expected native of type fyne.URIWriteCloser, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40536,8 +38690,9 @@ func ctxTo_fyne_Storage(ps *env.ProgramState, v env.RyeCtx) (fyne.Storage, error } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Storage: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40545,8 +38700,9 @@ func ctxTo_fyne_Storage(ps *env.ProgramState, v env.RyeCtx) (fyne.Storage, error } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: expected native", + "context to fyne.Storage: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40559,8 +38715,9 @@ func ctxTo_fyne_Storage(ps *env.ProgramState, v env.RyeCtx) (fyne.Storage, error res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Storage: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40568,8 +38725,9 @@ func ctxTo_fyne_Storage(ps *env.ProgramState, v env.RyeCtx) (fyne.Storage, error } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: expected error, string or nil", + "context to fyne.Storage: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40578,37 +38736,39 @@ func ctxTo_fyne_Storage(ps *env.ProgramState, v env.RyeCtx) (fyne.Storage, error return res0, res1 } default: - return nil, errors.New("context to fyne.Storage: context fn Create: expected function") + return nil, errors.New("context to fyne.Storage: context fn Create: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Open"] + ctxObj2, ok := wordToObj["open"] if !ok { return nil, errors.New("context to fyne.Storage: expected context to have function Open") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Storage: context fn Open: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Storage: context fn Open: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Open = func(ctx env.RyeCtx, arg0 string) (fyne.URIReadCloser, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_Open = func(ctx env.RyeCtx, farg0 string) (fyne.URIReadCloser, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 fyne.URIReadCloser var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: expected block for multiple return values", + "context to fyne.Storage: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: expected block with 2 return values", + "context to fyne.Storage: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40619,19 +38779,21 @@ func ctxTo_fyne_Storage(ps *env.ProgramState, v env.RyeCtx) (fyne.Storage, error var err error res0, err = ctxTo_fyne_URIReadCloser(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: "+err.Error()+"", + "context to fyne.Storage: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(fyne.URIReadCloser) - if !ok { + if vc, ok := v.Value.(fyne.URIReadCloser); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: expected native of type fyne.URIReadCloser", + "context to fyne.Storage: arg 0: callback result: "+"expected native of type fyne.URIReadCloser, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40639,8 +38801,9 @@ func ctxTo_fyne_Storage(ps *env.ProgramState, v env.RyeCtx) (fyne.Storage, error } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Storage: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40648,8 +38811,9 @@ func ctxTo_fyne_Storage(ps *env.ProgramState, v env.RyeCtx) (fyne.Storage, error } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: expected native", + "context to fyne.Storage: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40662,8 +38826,9 @@ func ctxTo_fyne_Storage(ps *env.ProgramState, v env.RyeCtx) (fyne.Storage, error res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Storage: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40671,8 +38836,9 @@ func ctxTo_fyne_Storage(ps *env.ProgramState, v env.RyeCtx) (fyne.Storage, error } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: expected error, string or nil", + "context to fyne.Storage: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40681,37 +38847,39 @@ func ctxTo_fyne_Storage(ps *env.ProgramState, v env.RyeCtx) (fyne.Storage, error return res0, res1 } default: - return nil, errors.New("context to fyne.Storage: context fn Open: expected function") + return nil, errors.New("context to fyne.Storage: context fn Open: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Save"] + ctxObj3, ok := wordToObj["save"] if !ok { return nil, errors.New("context to fyne.Storage: expected context to have function Save") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Storage: context fn Save: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Storage: context fn Save: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Save = func(ctx env.RyeCtx, arg0 string) (fyne.URIWriteCloser, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_Save = func(ctx env.RyeCtx, farg0 string) (fyne.URIWriteCloser, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 fyne.URIWriteCloser var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: expected block for multiple return values", + "context to fyne.Storage: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: expected block with 2 return values", + "context to fyne.Storage: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40722,19 +38890,21 @@ func ctxTo_fyne_Storage(ps *env.ProgramState, v env.RyeCtx) (fyne.Storage, error var err error res0, err = ctxTo_fyne_URIWriteCloser(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: "+err.Error()+"", + "context to fyne.Storage: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(fyne.URIWriteCloser) - if !ok { + if vc, ok := v.Value.(fyne.URIWriteCloser); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: expected native of type fyne.URIWriteCloser", + "context to fyne.Storage: arg 0: callback result: "+"expected native of type fyne.URIWriteCloser, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40742,8 +38912,9 @@ func ctxTo_fyne_Storage(ps *env.ProgramState, v env.RyeCtx) (fyne.Storage, error } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Storage: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40751,8 +38922,9 @@ func ctxTo_fyne_Storage(ps *env.ProgramState, v env.RyeCtx) (fyne.Storage, error } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: expected native", + "context to fyne.Storage: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40765,8 +38937,9 @@ func ctxTo_fyne_Storage(ps *env.ProgramState, v env.RyeCtx) (fyne.Storage, error res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Storage: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40774,8 +38947,9 @@ func ctxTo_fyne_Storage(ps *env.ProgramState, v env.RyeCtx) (fyne.Storage, error } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: expected error, string or nil", + "context to fyne.Storage: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40784,23 +38958,23 @@ func ctxTo_fyne_Storage(ps *env.ProgramState, v env.RyeCtx) (fyne.Storage, error return res0, res1 } default: - return nil, errors.New("context to fyne.Storage: context fn Save: expected function") + return nil, errors.New("context to fyne.Storage: context fn Save: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Remove"] + ctxObj4, ok := wordToObj["remove"] if !ok { return nil, errors.New("context to fyne.Storage: expected context to have function Remove") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Storage: context fn Remove: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Storage: context fn Remove: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Remove = func(ctx env.RyeCtx, arg0 string) error { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_Remove = func(ctx env.RyeCtx, farg0 string) error { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -40809,8 +38983,9 @@ func ctxTo_fyne_Storage(ps *env.ProgramState, v env.RyeCtx) (fyne.Storage, error res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Storage: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40818,8 +38993,9 @@ func ctxTo_fyne_Storage(ps *env.ProgramState, v env.RyeCtx) (fyne.Storage, error } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: expected error, string or nil", + "context to fyne.Storage: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40828,16 +39004,16 @@ func ctxTo_fyne_Storage(ps *env.ProgramState, v env.RyeCtx) (fyne.Storage, error return res } default: - return nil, errors.New("context to fyne.Storage: context fn Remove: expected function") + return nil, errors.New("context to fyne.Storage: context fn Remove: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["List"] + ctxObj5, ok := wordToObj["list"] if !ok { return nil, errors.New("context to fyne.Storage: expected context to have function List") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Storage: context fn List: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Storage: context fn List: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_List = func(ctx env.RyeCtx) []string { actualFn := fn @@ -40848,32 +39024,23 @@ func ctxTo_fyne_Storage(ps *env.ProgramState, v env.RyeCtx) (fyne.Storage, error case env.Block: res = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - res[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + res[i] = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: block item: expected string", + "context to fyne.Storage: arg 0: callback result: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]string) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: expected native of type []string", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Storage: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40881,8 +39048,9 @@ func ctxTo_fyne_Storage(ps *env.ProgramState, v env.RyeCtx) (fyne.Storage, error } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Storage: arg 0: callback result: expected block, native or nil", + "context to fyne.Storage: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40891,7 +39059,7 @@ func ctxTo_fyne_Storage(ps *env.ProgramState, v env.RyeCtx) (fyne.Storage, error return res } default: - return nil, errors.New("context to fyne.Storage: context fn List: expected function") + return nil, errors.New("context to fyne.Storage: context fn List: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -40923,25 +39091,26 @@ func ctxTo_fyne_Tabbable(ps *env.ProgramState, v env.RyeCtx) (fyne.Tabbable, err impl := &iface_fyne_Tabbable{ self: v, } - ctxObj0, ok := wordToObj["AcceptsTab"] + ctxObj0, ok := wordToObj["accepts-tab"] if !ok { return nil, errors.New("context to fyne.Tabbable: expected context to have function AcceptsTab") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Tabbable: context fn AcceptsTab: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Tabbable: context fn AcceptsTab: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_AcceptsTab = func(ctx env.RyeCtx) bool { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res bool - if v, ok := ps.Res.(env.Integer); ok { - res = v.Value != 0 + if vc, ok := ps.Res.(env.Integer); ok { + res = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Tabbable: arg 0: callback result: expected integer", + "context to fyne.Tabbable: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -40950,7 +39119,7 @@ func ctxTo_fyne_Tabbable(ps *env.ProgramState, v env.RyeCtx) (fyne.Tabbable, err return res } default: - return nil, errors.New("context to fyne.Tabbable: context fn AcceptsTab: expected function") + return nil, errors.New("context to fyne.Tabbable: context fn AcceptsTab: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -40982,24 +39151,24 @@ func ctxTo_fyne_Tappable(ps *env.ProgramState, v env.RyeCtx) (fyne.Tappable, err impl := &iface_fyne_Tappable{ self: v, } - ctxObj0, ok := wordToObj["Tapped"] + ctxObj0, ok := wordToObj["tapped"] if !ok { return nil, errors.New("context to fyne.Tappable: expected context to have function Tapped") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Tappable: context fn Tapped: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Tappable: context fn Tapped: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Tapped = func(ctx env.RyeCtx, arg0 *fyne.PointEvent) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*fyne.PointEvent)") + impl.fn_Tapped = func(ctx env.RyeCtx, farg0 *fyne.PointEvent) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*fyne.PointEvent)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Tappable: context fn Tapped: expected function") + return nil, errors.New("context to fyne.Tappable: context fn Tapped: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -41043,38 +39212,40 @@ func ctxTo_fyne_Theme(ps *env.ProgramState, v env.RyeCtx) (fyne.Theme, error) { impl := &iface_fyne_Theme{ self: v, } - ctxObj0, ok := wordToObj["Color"] + ctxObj0, ok := wordToObj["color"] if !ok { return nil, errors.New("context to fyne.Theme: expected context to have function Color") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to fyne.Theme: context fn Color: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to fyne.Theme: context fn Color: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Color = func(ctx env.RyeCtx, arg0 fyne.ThemeColorName, arg1 fyne.ThemeVariant) color.Color { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewString(string(arg0)) - arg1Val = *env.NewInteger(int64(uint(arg1))) + impl.fn_Color = func(ctx env.RyeCtx, farg0 fyne.ThemeColorName, farg1 fyne.ThemeVariant) color.Color { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewString(string(farg0)) + farg1Val = *env.NewInteger(int64(uint(farg1))) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res color.Color switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Theme: arg 0: callback result: expected native of type color.Color", + "context to fyne.Theme: arg 0: callback result: "+"expected native of type color.Color, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Theme: arg 0: callback result: expected native", + "context to fyne.Theme: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41083,42 +39254,44 @@ func ctxTo_fyne_Theme(ps *env.ProgramState, v env.RyeCtx) (fyne.Theme, error) { return res } default: - return nil, errors.New("context to fyne.Theme: context fn Color: expected function") + return nil, errors.New("context to fyne.Theme: context fn Color: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Font"] + ctxObj1, ok := wordToObj["font"] if !ok { return nil, errors.New("context to fyne.Theme: expected context to have function Font") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Theme: context fn Font: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Theme: context fn Font: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Font = func(ctx env.RyeCtx, arg0 fyne.TextStyle) fyne.Resource { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, &arg0, "Go(*fyne.TextStyle)") + impl.fn_Font = func(ctx env.RyeCtx, farg0 fyne.TextStyle) fyne.Resource { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, &farg0, "Go(*fyne.TextStyle)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res fyne.Resource switch v := ps.Res.(type) { case env.RyeCtx: var err error res, err = ctxTo_fyne_Resource(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Theme: arg 0: callback result: "+err.Error()+"", + "context to fyne.Theme: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Theme: arg 0: callback result: expected native of type fyne.Resource", + "context to fyne.Theme: arg 0: callback result: "+"expected native of type fyne.Resource, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41126,8 +39299,9 @@ func ctxTo_fyne_Theme(ps *env.ProgramState, v env.RyeCtx) (fyne.Theme, error) { } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Theme: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Theme: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41135,8 +39309,9 @@ func ctxTo_fyne_Theme(ps *env.ProgramState, v env.RyeCtx) (fyne.Theme, error) { } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Theme: arg 0: callback result: expected native", + "context to fyne.Theme: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41145,42 +39320,44 @@ func ctxTo_fyne_Theme(ps *env.ProgramState, v env.RyeCtx) (fyne.Theme, error) { return res } default: - return nil, errors.New("context to fyne.Theme: context fn Font: expected function") + return nil, errors.New("context to fyne.Theme: context fn Font: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Icon"] + ctxObj2, ok := wordToObj["icon"] if !ok { return nil, errors.New("context to fyne.Theme: expected context to have function Icon") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Theme: context fn Icon: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Theme: context fn Icon: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Icon = func(ctx env.RyeCtx, arg0 fyne.ThemeIconName) fyne.Resource { - var arg0Val env.Object - arg0Val = *env.NewString(string(arg0)) + impl.fn_Icon = func(ctx env.RyeCtx, farg0 fyne.ThemeIconName) fyne.Resource { + var farg0Val env.Object + farg0Val = *env.NewString(string(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res fyne.Resource switch v := ps.Res.(type) { case env.RyeCtx: var err error res, err = ctxTo_fyne_Resource(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Theme: arg 0: callback result: "+err.Error()+"", + "context to fyne.Theme: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Theme: arg 0: callback result: expected native of type fyne.Resource", + "context to fyne.Theme: arg 0: callback result: "+"expected native of type fyne.Resource, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41188,8 +39365,9 @@ func ctxTo_fyne_Theme(ps *env.ProgramState, v env.RyeCtx) (fyne.Theme, error) { } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Theme: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Theme: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41197,8 +39375,9 @@ func ctxTo_fyne_Theme(ps *env.ProgramState, v env.RyeCtx) (fyne.Theme, error) { } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Theme: arg 0: callback result: expected native", + "context to fyne.Theme: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41207,29 +39386,30 @@ func ctxTo_fyne_Theme(ps *env.ProgramState, v env.RyeCtx) (fyne.Theme, error) { return res } default: - return nil, errors.New("context to fyne.Theme: context fn Icon: expected function") + return nil, errors.New("context to fyne.Theme: context fn Icon: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Size"] + ctxObj3, ok := wordToObj["size"] if !ok { return nil, errors.New("context to fyne.Theme: expected context to have function Size") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Theme: context fn Size: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Theme: context fn Size: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Size = func(ctx env.RyeCtx, arg0 fyne.ThemeSizeName) float32 { - var arg0Val env.Object - arg0Val = *env.NewString(string(arg0)) + impl.fn_Size = func(ctx env.RyeCtx, farg0 fyne.ThemeSizeName) float32 { + var farg0Val env.Object + farg0Val = *env.NewString(string(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res float32 - if v, ok := ps.Res.(env.Decimal); ok { - res = float32(v.Value) + if vc, ok := ps.Res.(env.Decimal); ok { + res = float32(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Theme: arg 0: callback result: expected decimal", + "context to fyne.Theme: arg 0: callback result: "+"expected decimal, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41238,7 +39418,7 @@ func ctxTo_fyne_Theme(ps *env.ProgramState, v env.RyeCtx) (fyne.Theme, error) { return res } default: - return nil, errors.New("context to fyne.Theme: context fn Size: expected function") + return nil, errors.New("context to fyne.Theme: context fn Size: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -41302,25 +39482,26 @@ func ctxTo_fyne_URI(ps *env.ProgramState, v env.RyeCtx) (fyne.URI, error) { impl := &iface_fyne_URI{ self: v, } - ctxObj0, ok := wordToObj["Extension"] + ctxObj0, ok := wordToObj["extension"] if !ok { return nil, errors.New("context to fyne.URI: expected context to have function Extension") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.URI: context fn Extension: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.URI: context fn Extension: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Extension = func(ctx env.RyeCtx) string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URI: arg 0: callback result: expected string", + "context to fyne.URI: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41329,27 +39510,28 @@ func ctxTo_fyne_URI(ps *env.ProgramState, v env.RyeCtx) (fyne.URI, error) { return res } default: - return nil, errors.New("context to fyne.URI: context fn Extension: expected function") + return nil, errors.New("context to fyne.URI: context fn Extension: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Name"] + ctxObj1, ok := wordToObj["name"] if !ok { return nil, errors.New("context to fyne.URI: expected context to have function Name") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.URI: context fn Name: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.URI: context fn Name: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Name = func(ctx env.RyeCtx) string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URI: arg 0: callback result: expected string", + "context to fyne.URI: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41358,27 +39540,28 @@ func ctxTo_fyne_URI(ps *env.ProgramState, v env.RyeCtx) (fyne.URI, error) { return res } default: - return nil, errors.New("context to fyne.URI: context fn Name: expected function") + return nil, errors.New("context to fyne.URI: context fn Name: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["MimeType"] + ctxObj2, ok := wordToObj["mime-type"] if !ok { return nil, errors.New("context to fyne.URI: expected context to have function MimeType") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.URI: context fn MimeType: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.URI: context fn MimeType: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_MimeType = func(ctx env.RyeCtx) string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URI: arg 0: callback result: expected string", + "context to fyne.URI: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41387,27 +39570,28 @@ func ctxTo_fyne_URI(ps *env.ProgramState, v env.RyeCtx) (fyne.URI, error) { return res } default: - return nil, errors.New("context to fyne.URI: context fn MimeType: expected function") + return nil, errors.New("context to fyne.URI: context fn MimeType: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Scheme"] + ctxObj3, ok := wordToObj["scheme"] if !ok { return nil, errors.New("context to fyne.URI: expected context to have function Scheme") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.URI: context fn Scheme: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.URI: context fn Scheme: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Scheme = func(ctx env.RyeCtx) string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URI: arg 0: callback result: expected string", + "context to fyne.URI: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41416,27 +39600,28 @@ func ctxTo_fyne_URI(ps *env.ProgramState, v env.RyeCtx) (fyne.URI, error) { return res } default: - return nil, errors.New("context to fyne.URI: context fn Scheme: expected function") + return nil, errors.New("context to fyne.URI: context fn Scheme: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Authority"] + ctxObj4, ok := wordToObj["authority"] if !ok { return nil, errors.New("context to fyne.URI: expected context to have function Authority") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.URI: context fn Authority: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.URI: context fn Authority: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Authority = func(ctx env.RyeCtx) string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URI: arg 0: callback result: expected string", + "context to fyne.URI: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41445,27 +39630,28 @@ func ctxTo_fyne_URI(ps *env.ProgramState, v env.RyeCtx) (fyne.URI, error) { return res } default: - return nil, errors.New("context to fyne.URI: context fn Authority: expected function") + return nil, errors.New("context to fyne.URI: context fn Authority: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["Path"] + ctxObj5, ok := wordToObj["path"] if !ok { return nil, errors.New("context to fyne.URI: expected context to have function Path") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.URI: context fn Path: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.URI: context fn Path: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Path = func(ctx env.RyeCtx) string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URI: arg 0: callback result: expected string", + "context to fyne.URI: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41474,27 +39660,28 @@ func ctxTo_fyne_URI(ps *env.ProgramState, v env.RyeCtx) (fyne.URI, error) { return res } default: - return nil, errors.New("context to fyne.URI: context fn Path: expected function") + return nil, errors.New("context to fyne.URI: context fn Path: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["Query"] + ctxObj6, ok := wordToObj["query"] if !ok { return nil, errors.New("context to fyne.URI: expected context to have function Query") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.URI: context fn Query: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.URI: context fn Query: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Query = func(ctx env.RyeCtx) string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URI: arg 0: callback result: expected string", + "context to fyne.URI: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41503,27 +39690,28 @@ func ctxTo_fyne_URI(ps *env.ProgramState, v env.RyeCtx) (fyne.URI, error) { return res } default: - return nil, errors.New("context to fyne.URI: context fn Query: expected function") + return nil, errors.New("context to fyne.URI: context fn Query: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["Fragment"] + ctxObj7, ok := wordToObj["fragment"] if !ok { return nil, errors.New("context to fyne.URI: expected context to have function Fragment") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.URI: context fn Fragment: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.URI: context fn Fragment: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Fragment = func(ctx env.RyeCtx) string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URI: arg 0: callback result: expected string", + "context to fyne.URI: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41532,27 +39720,28 @@ func ctxTo_fyne_URI(ps *env.ProgramState, v env.RyeCtx) (fyne.URI, error) { return res } default: - return nil, errors.New("context to fyne.URI: context fn Fragment: expected function") + return nil, errors.New("context to fyne.URI: context fn Fragment: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["String"] + ctxObj8, ok := wordToObj["string"] if !ok { return nil, errors.New("context to fyne.URI: expected context to have function String") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.URI: context fn String: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.URI: context fn String: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_String = func(ctx env.RyeCtx) string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URI: arg 0: callback result: expected string", + "context to fyne.URI: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41561,7 +39750,7 @@ func ctxTo_fyne_URI(ps *env.ProgramState, v env.RyeCtx) (fyne.URI, error) { return res } default: - return nil, errors.New("context to fyne.URI: context fn String: expected function") + return nil, errors.New("context to fyne.URI: context fn String: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -41601,14 +39790,14 @@ func ctxTo_fyne_URIReadCloser(ps *env.ProgramState, v env.RyeCtx) (fyne.URIReadC impl := &iface_fyne_URIReadCloser{ self: v, } - ctxObj0, ok := wordToObj["URI"] + ctxObj0, ok := wordToObj["uri"] if !ok { return nil, errors.New("context to fyne.URIReadCloser: expected context to have function URI") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.URIReadCloser: context fn URI: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.URIReadCloser: context fn URI: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_URI = func(ctx env.RyeCtx) fyne.URI { actualFn := fn @@ -41620,19 +39809,21 @@ func ctxTo_fyne_URIReadCloser(ps *env.ProgramState, v env.RyeCtx) (fyne.URIReadC var err error res, err = ctxTo_fyne_URI(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URIReadCloser: arg 0: callback result: "+err.Error()+"", + "context to fyne.URIReadCloser: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URIReadCloser: arg 0: callback result: expected native of type fyne.URI", + "context to fyne.URIReadCloser: arg 0: callback result: "+"expected native of type fyne.URI, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41640,8 +39831,9 @@ func ctxTo_fyne_URIReadCloser(ps *env.ProgramState, v env.RyeCtx) (fyne.URIReadC } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URIReadCloser: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.URIReadCloser: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41649,8 +39841,9 @@ func ctxTo_fyne_URIReadCloser(ps *env.ProgramState, v env.RyeCtx) (fyne.URIReadC } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URIReadCloser: arg 0: callback result: expected native", + "context to fyne.URIReadCloser: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41659,53 +39852,56 @@ func ctxTo_fyne_URIReadCloser(ps *env.ProgramState, v env.RyeCtx) (fyne.URIReadC return res } default: - return nil, errors.New("context to fyne.URIReadCloser: context fn URI: expected function") + return nil, errors.New("context to fyne.URIReadCloser: context fn URI: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Read"] + ctxObj1, ok := wordToObj["read"] if !ok { return nil, errors.New("context to fyne.URIReadCloser: expected context to have function Read") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.URIReadCloser: context fn Read: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.URIReadCloser: context fn Read: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Read = func(ctx env.RyeCtx, arg0 []byte) (int, error) { - var arg0Val env.Object + impl.fn_Read = func(ctx env.RyeCtx, farg0 []byte) (int, error) { + var farg0Val env.Object { - items := make([]env.Object, len(arg0)) - for i, it := range arg0 { + items := make([]env.Object, len(farg0)) + for i, it := range farg0 { items[i] = *env.NewNative(ps.Idx, it, "Go(byte)") } - arg0Val = *env.NewBlock(*env.NewTSeries(items)) + farg0Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 int var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URIReadCloser: arg 0: callback result: expected block for multiple return values", + "context to fyne.URIReadCloser: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URIReadCloser: arg 0: callback result: expected block with 2 return values", + "context to fyne.URIReadCloser: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = int(v.Value) + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URIReadCloser: arg 0: callback result: expected integer", + "context to fyne.URIReadCloser: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41718,8 +39914,9 @@ func ctxTo_fyne_URIReadCloser(ps *env.ProgramState, v env.RyeCtx) (fyne.URIReadC res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URIReadCloser: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.URIReadCloser: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41727,8 +39924,9 @@ func ctxTo_fyne_URIReadCloser(ps *env.ProgramState, v env.RyeCtx) (fyne.URIReadC } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URIReadCloser: arg 0: callback result: expected error, string or nil", + "context to fyne.URIReadCloser: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41737,16 +39935,16 @@ func ctxTo_fyne_URIReadCloser(ps *env.ProgramState, v env.RyeCtx) (fyne.URIReadC return res0, res1 } default: - return nil, errors.New("context to fyne.URIReadCloser: context fn Read: expected function") + return nil, errors.New("context to fyne.URIReadCloser: context fn Read: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Close"] + ctxObj2, ok := wordToObj["close"] if !ok { return nil, errors.New("context to fyne.URIReadCloser: expected context to have function Close") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.URIReadCloser: context fn Close: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.URIReadCloser: context fn Close: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Close = func(ctx env.RyeCtx) error { actualFn := fn @@ -41760,8 +39958,9 @@ func ctxTo_fyne_URIReadCloser(ps *env.ProgramState, v env.RyeCtx) (fyne.URIReadC res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URIReadCloser: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.URIReadCloser: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41769,8 +39968,9 @@ func ctxTo_fyne_URIReadCloser(ps *env.ProgramState, v env.RyeCtx) (fyne.URIReadC } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URIReadCloser: arg 0: callback result: expected error, string or nil", + "context to fyne.URIReadCloser: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41779,7 +39979,7 @@ func ctxTo_fyne_URIReadCloser(ps *env.ProgramState, v env.RyeCtx) (fyne.URIReadC return res } default: - return nil, errors.New("context to fyne.URIReadCloser: context fn Close: expected function") + return nil, errors.New("context to fyne.URIReadCloser: context fn Close: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -41819,14 +40019,14 @@ func ctxTo_fyne_URIWriteCloser(ps *env.ProgramState, v env.RyeCtx) (fyne.URIWrit impl := &iface_fyne_URIWriteCloser{ self: v, } - ctxObj0, ok := wordToObj["URI"] + ctxObj0, ok := wordToObj["uri"] if !ok { return nil, errors.New("context to fyne.URIWriteCloser: expected context to have function URI") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.URIWriteCloser: context fn URI: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.URIWriteCloser: context fn URI: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_URI = func(ctx env.RyeCtx) fyne.URI { actualFn := fn @@ -41838,19 +40038,21 @@ func ctxTo_fyne_URIWriteCloser(ps *env.ProgramState, v env.RyeCtx) (fyne.URIWrit var err error res, err = ctxTo_fyne_URI(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URIWriteCloser: arg 0: callback result: "+err.Error()+"", + "context to fyne.URIWriteCloser: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URIWriteCloser: arg 0: callback result: expected native of type fyne.URI", + "context to fyne.URIWriteCloser: arg 0: callback result: "+"expected native of type fyne.URI, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41858,8 +40060,9 @@ func ctxTo_fyne_URIWriteCloser(ps *env.ProgramState, v env.RyeCtx) (fyne.URIWrit } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URIWriteCloser: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.URIWriteCloser: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41867,8 +40070,9 @@ func ctxTo_fyne_URIWriteCloser(ps *env.ProgramState, v env.RyeCtx) (fyne.URIWrit } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URIWriteCloser: arg 0: callback result: expected native", + "context to fyne.URIWriteCloser: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41877,53 +40081,56 @@ func ctxTo_fyne_URIWriteCloser(ps *env.ProgramState, v env.RyeCtx) (fyne.URIWrit return res } default: - return nil, errors.New("context to fyne.URIWriteCloser: context fn URI: expected function") + return nil, errors.New("context to fyne.URIWriteCloser: context fn URI: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Write"] + ctxObj1, ok := wordToObj["write"] if !ok { return nil, errors.New("context to fyne.URIWriteCloser: expected context to have function Write") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.URIWriteCloser: context fn Write: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.URIWriteCloser: context fn Write: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Write = func(ctx env.RyeCtx, arg0 []byte) (int, error) { - var arg0Val env.Object + impl.fn_Write = func(ctx env.RyeCtx, farg0 []byte) (int, error) { + var farg0Val env.Object { - items := make([]env.Object, len(arg0)) - for i, it := range arg0 { + items := make([]env.Object, len(farg0)) + for i, it := range farg0 { items[i] = *env.NewNative(ps.Idx, it, "Go(byte)") } - arg0Val = *env.NewBlock(*env.NewTSeries(items)) + farg0Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 int var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URIWriteCloser: arg 0: callback result: expected block for multiple return values", + "context to fyne.URIWriteCloser: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URIWriteCloser: arg 0: callback result: expected block with 2 return values", + "context to fyne.URIWriteCloser: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = int(v.Value) + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URIWriteCloser: arg 0: callback result: expected integer", + "context to fyne.URIWriteCloser: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41936,8 +40143,9 @@ func ctxTo_fyne_URIWriteCloser(ps *env.ProgramState, v env.RyeCtx) (fyne.URIWrit res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URIWriteCloser: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.URIWriteCloser: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41945,8 +40153,9 @@ func ctxTo_fyne_URIWriteCloser(ps *env.ProgramState, v env.RyeCtx) (fyne.URIWrit } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URIWriteCloser: arg 0: callback result: expected error, string or nil", + "context to fyne.URIWriteCloser: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41955,16 +40164,16 @@ func ctxTo_fyne_URIWriteCloser(ps *env.ProgramState, v env.RyeCtx) (fyne.URIWrit return res0, res1 } default: - return nil, errors.New("context to fyne.URIWriteCloser: context fn Write: expected function") + return nil, errors.New("context to fyne.URIWriteCloser: context fn Write: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Close"] + ctxObj2, ok := wordToObj["close"] if !ok { return nil, errors.New("context to fyne.URIWriteCloser: expected context to have function Close") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.URIWriteCloser: context fn Close: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.URIWriteCloser: context fn Close: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Close = func(ctx env.RyeCtx) error { actualFn := fn @@ -41978,8 +40187,9 @@ func ctxTo_fyne_URIWriteCloser(ps *env.ProgramState, v env.RyeCtx) (fyne.URIWrit res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URIWriteCloser: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.URIWriteCloser: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41987,8 +40197,9 @@ func ctxTo_fyne_URIWriteCloser(ps *env.ProgramState, v env.RyeCtx) (fyne.URIWrit } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.URIWriteCloser: arg 0: callback result: expected error, string or nil", + "context to fyne.URIWriteCloser: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -41997,7 +40208,7 @@ func ctxTo_fyne_URIWriteCloser(ps *env.ProgramState, v env.RyeCtx) (fyne.URIWrit return res } default: - return nil, errors.New("context to fyne.URIWriteCloser: context fn Close: expected function") + return nil, errors.New("context to fyne.URIWriteCloser: context fn Close: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -42033,14 +40244,14 @@ func ctxTo_fyne_Validatable(ps *env.ProgramState, v env.RyeCtx) (fyne.Validatabl impl := &iface_fyne_Validatable{ self: v, } - ctxObj0, ok := wordToObj["Validate"] + ctxObj0, ok := wordToObj["validate"] if !ok { return nil, errors.New("context to fyne.Validatable: expected context to have function Validate") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Validatable: context fn Validate: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Validatable: context fn Validate: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Validate = func(ctx env.RyeCtx) error { actualFn := fn @@ -42054,8 +40265,9 @@ func ctxTo_fyne_Validatable(ps *env.ProgramState, v env.RyeCtx) (fyne.Validatabl res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Validatable: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Validatable: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -42063,8 +40275,9 @@ func ctxTo_fyne_Validatable(ps *env.ProgramState, v env.RyeCtx) (fyne.Validatabl } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Validatable: arg 0: callback result: expected error, string or nil", + "context to fyne.Validatable: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -42073,26 +40286,45 @@ func ctxTo_fyne_Validatable(ps *env.ProgramState, v env.RyeCtx) (fyne.Validatabl return res } default: - return nil, errors.New("context to fyne.Validatable: context fn Validate: expected function") + return nil, errors.New("context to fyne.Validatable: context fn Validate: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["SetOnValidationChanged"] + ctxObj1, ok := wordToObj["set-on-validation-changed"] if !ok { return nil, errors.New("context to fyne.Validatable: expected context to have function SetOnValidationChanged") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Validatable: context fn SetOnValidationChanged: function has invalid number of arguments (expected 1)") - } - impl.fn_SetOnValidationChanged = func(ctx env.RyeCtx, arg0 func(error)) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(func(error))") + return nil, errors.New("context to fyne.Validatable: context fn SetOnValidationChanged: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) + } + impl.fn_SetOnValidationChanged = func(ctx env.RyeCtx, farg0 func(error)) { + var farg0Val env.Object + farg0Val = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val error + switch v := arg0.(type) { + case env.String: + arg0Val = errors.New(v.Value) + case env.Error: + arg0Val = errors.New(v.Print(*ps.Idx)) + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("context to fyne.Validatable: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg0Val = nil + default: + ps.FailureFlag = true + return env.NewError("context to fyne.Validatable: arg 1: " + "expected error, string or nil, but got " + objectDebugString(ps.Idx, v)) + } + farg0(arg0Val) + return nil + }, 1, false, false, "Returned func") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Validatable: context fn SetOnValidationChanged: expected function") + return nil, errors.New("context to fyne.Validatable: context fn SetOnValidationChanged: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -42128,14 +40360,14 @@ func ctxTo_fyne_Vector2(ps *env.ProgramState, v env.RyeCtx) (fyne.Vector2, error impl := &iface_fyne_Vector2{ self: v, } - ctxObj0, ok := wordToObj["Components"] + ctxObj0, ok := wordToObj["components"] if !ok { return nil, errors.New("context to fyne.Vector2: expected context to have function Components") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Vector2: context fn Components: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Vector2: context fn Components: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Components = func(ctx env.RyeCtx) (float32, float32) { actualFn := fn @@ -42145,36 +40377,40 @@ func ctxTo_fyne_Vector2(ps *env.ProgramState, v env.RyeCtx) (fyne.Vector2, error var res1 float32 res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Vector2: arg 0: callback result: expected block for multiple return values", + "context to fyne.Vector2: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Vector2: arg 0: callback result: expected block with 2 return values", + "context to fyne.Vector2: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Decimal); ok { - res0 = float32(v.Value) + if vc, ok := res.Series.S[0].(env.Decimal); ok { + res0 = float32(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Vector2: arg 0: callback result: expected decimal", + "context to fyne.Vector2: arg 0: callback result: "+"expected decimal, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[1].(env.Decimal); ok { - res1 = float32(v.Value) + if vc, ok := res.Series.S[1].(env.Decimal); ok { + res1 = float32(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Vector2: arg 0: callback result: expected decimal", + "context to fyne.Vector2: arg 0: callback result: "+"expected decimal, but got "+objectDebugString(ps.Idx, res.Series.S[1]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -42183,27 +40419,28 @@ func ctxTo_fyne_Vector2(ps *env.ProgramState, v env.RyeCtx) (fyne.Vector2, error return res0, res1 } default: - return nil, errors.New("context to fyne.Vector2: context fn Components: expected function") + return nil, errors.New("context to fyne.Vector2: context fn Components: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["IsZero"] + ctxObj1, ok := wordToObj["is-zero"] if !ok { return nil, errors.New("context to fyne.Vector2: expected context to have function IsZero") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Vector2: context fn IsZero: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Vector2: context fn IsZero: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_IsZero = func(ctx env.RyeCtx) bool { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res bool - if v, ok := ps.Res.(env.Integer); ok { - res = v.Value != 0 + if vc, ok := ps.Res.(env.Integer); ok { + res = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Vector2: arg 0: callback result: expected integer", + "context to fyne.Vector2: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -42212,7 +40449,7 @@ func ctxTo_fyne_Vector2(ps *env.ProgramState, v env.RyeCtx) (fyne.Vector2, error return res } default: - return nil, errors.New("context to fyne.Vector2: context fn IsZero: expected function") + return nil, errors.New("context to fyne.Vector2: context fn IsZero: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -42280,14 +40517,14 @@ func ctxTo_fyne_Widget(ps *env.ProgramState, v env.RyeCtx) (fyne.Widget, error) impl := &iface_fyne_Widget{ self: v, } - ctxObj0, ok := wordToObj["CreateRenderer"] + ctxObj0, ok := wordToObj["create-renderer"] if !ok { return nil, errors.New("context to fyne.Widget: expected context to have function CreateRenderer") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Widget: context fn CreateRenderer: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Widget: context fn CreateRenderer: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_CreateRenderer = func(ctx env.RyeCtx) fyne.WidgetRenderer { actualFn := fn @@ -42299,19 +40536,21 @@ func ctxTo_fyne_Widget(ps *env.ProgramState, v env.RyeCtx) (fyne.Widget, error) var err error res, err = ctxTo_fyne_WidgetRenderer(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Widget: arg 0: callback result: "+err.Error()+"", + "context to fyne.Widget: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.WidgetRenderer) - if !ok { + if vc, ok := v.Value.(fyne.WidgetRenderer); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Widget: arg 0: callback result: expected native of type fyne.WidgetRenderer", + "context to fyne.Widget: arg 0: callback result: "+"expected native of type fyne.WidgetRenderer, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -42319,8 +40558,9 @@ func ctxTo_fyne_Widget(ps *env.ProgramState, v env.RyeCtx) (fyne.Widget, error) } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Widget: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Widget: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -42328,8 +40568,9 @@ func ctxTo_fyne_Widget(ps *env.ProgramState, v env.RyeCtx) (fyne.Widget, error) } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Widget: arg 0: callback result: expected native", + "context to fyne.Widget: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -42338,16 +40579,16 @@ func ctxTo_fyne_Widget(ps *env.ProgramState, v env.RyeCtx) (fyne.Widget, error) return res } default: - return nil, errors.New("context to fyne.Widget: context fn CreateRenderer: expected function") + return nil, errors.New("context to fyne.Widget: context fn CreateRenderer: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["MinSize"] + ctxObj1, ok := wordToObj["min-size"] if !ok { return nil, errors.New("context to fyne.Widget: expected context to have function MinSize") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Widget: context fn MinSize: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Widget: context fn MinSize: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_MinSize = func(ctx env.RyeCtx) fyne.Size { actualFn := fn @@ -42356,19 +40597,21 @@ func ctxTo_fyne_Widget(ps *env.ProgramState, v env.RyeCtx) (fyne.Widget, error) var res fyne.Size switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(fyne.Size) - if !ok { + if vc, ok := v.Value.(*fyne.Size); ok { + res = *vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Widget: arg 0: callback result: expected native of type fyne.Size", + "context to fyne.Widget: arg 0: callback result: "+"expected native of type *fyne.Size, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Widget: arg 0: callback result: expected native", + "context to fyne.Widget: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -42377,35 +40620,35 @@ func ctxTo_fyne_Widget(ps *env.ProgramState, v env.RyeCtx) (fyne.Widget, error) return res } default: - return nil, errors.New("context to fyne.Widget: context fn MinSize: expected function") + return nil, errors.New("context to fyne.Widget: context fn MinSize: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Move"] + ctxObj2, ok := wordToObj["move"] if !ok { return nil, errors.New("context to fyne.Widget: expected context to have function Move") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Widget: context fn Move: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Widget: context fn Move: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Move = func(ctx env.RyeCtx, arg0 fyne.Position) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, &arg0, "Go(*fyne.Position)") + impl.fn_Move = func(ctx env.RyeCtx, farg0 fyne.Position) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, &farg0, "Go(*fyne.Position)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Widget: context fn Move: expected function") + return nil, errors.New("context to fyne.Widget: context fn Move: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Position"] + ctxObj3, ok := wordToObj["position"] if !ok { return nil, errors.New("context to fyne.Widget: expected context to have function Position") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Widget: context fn Position: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Widget: context fn Position: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Position = func(ctx env.RyeCtx) fyne.Position { actualFn := fn @@ -42414,19 +40657,21 @@ func ctxTo_fyne_Widget(ps *env.ProgramState, v env.RyeCtx) (fyne.Widget, error) var res fyne.Position switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(fyne.Position) - if !ok { + if vc, ok := v.Value.(*fyne.Position); ok { + res = *vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Widget: arg 0: callback result: expected native of type fyne.Position", + "context to fyne.Widget: arg 0: callback result: "+"expected native of type *fyne.Position, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Widget: arg 0: callback result: expected native", + "context to fyne.Widget: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -42435,35 +40680,35 @@ func ctxTo_fyne_Widget(ps *env.ProgramState, v env.RyeCtx) (fyne.Widget, error) return res } default: - return nil, errors.New("context to fyne.Widget: context fn Position: expected function") + return nil, errors.New("context to fyne.Widget: context fn Position: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Resize"] + ctxObj4, ok := wordToObj["resize"] if !ok { return nil, errors.New("context to fyne.Widget: expected context to have function Resize") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Widget: context fn Resize: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Widget: context fn Resize: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Resize = func(ctx env.RyeCtx, arg0 fyne.Size) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, &arg0, "Go(*fyne.Size)") + impl.fn_Resize = func(ctx env.RyeCtx, farg0 fyne.Size) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, &farg0, "Go(*fyne.Size)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Widget: context fn Resize: expected function") + return nil, errors.New("context to fyne.Widget: context fn Resize: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["Size"] + ctxObj5, ok := wordToObj["size"] if !ok { return nil, errors.New("context to fyne.Widget: expected context to have function Size") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Widget: context fn Size: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Widget: context fn Size: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Size = func(ctx env.RyeCtx) fyne.Size { actualFn := fn @@ -42472,19 +40717,21 @@ func ctxTo_fyne_Widget(ps *env.ProgramState, v env.RyeCtx) (fyne.Widget, error) var res fyne.Size switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(fyne.Size) - if !ok { + if vc, ok := v.Value.(*fyne.Size); ok { + res = *vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Widget: arg 0: callback result: expected native of type fyne.Size", + "context to fyne.Widget: arg 0: callback result: "+"expected native of type *fyne.Size, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Widget: arg 0: callback result: expected native", + "context to fyne.Widget: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -42493,16 +40740,16 @@ func ctxTo_fyne_Widget(ps *env.ProgramState, v env.RyeCtx) (fyne.Widget, error) return res } default: - return nil, errors.New("context to fyne.Widget: context fn Size: expected function") + return nil, errors.New("context to fyne.Widget: context fn Size: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["Hide"] + ctxObj6, ok := wordToObj["hide"] if !ok { return nil, errors.New("context to fyne.Widget: expected context to have function Hide") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Widget: context fn Hide: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Widget: context fn Hide: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Hide = func(ctx env.RyeCtx) { actualFn := fn @@ -42510,27 +40757,28 @@ func ctxTo_fyne_Widget(ps *env.ProgramState, v env.RyeCtx) (fyne.Widget, error) evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to fyne.Widget: context fn Hide: expected function") + return nil, errors.New("context to fyne.Widget: context fn Hide: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["Visible"] + ctxObj7, ok := wordToObj["visible"] if !ok { return nil, errors.New("context to fyne.Widget: expected context to have function Visible") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Widget: context fn Visible: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Widget: context fn Visible: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Visible = func(ctx env.RyeCtx) bool { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res bool - if v, ok := ps.Res.(env.Integer); ok { - res = v.Value != 0 + if vc, ok := ps.Res.(env.Integer); ok { + res = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Widget: arg 0: callback result: expected integer", + "context to fyne.Widget: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -42539,16 +40787,16 @@ func ctxTo_fyne_Widget(ps *env.ProgramState, v env.RyeCtx) (fyne.Widget, error) return res } default: - return nil, errors.New("context to fyne.Widget: context fn Visible: expected function") + return nil, errors.New("context to fyne.Widget: context fn Visible: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["Show"] + ctxObj8, ok := wordToObj["show"] if !ok { return nil, errors.New("context to fyne.Widget: expected context to have function Show") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Widget: context fn Show: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Widget: context fn Show: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Show = func(ctx env.RyeCtx) { actualFn := fn @@ -42556,16 +40804,16 @@ func ctxTo_fyne_Widget(ps *env.ProgramState, v env.RyeCtx) (fyne.Widget, error) evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to fyne.Widget: context fn Show: expected function") + return nil, errors.New("context to fyne.Widget: context fn Show: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["Refresh"] + ctxObj9, ok := wordToObj["refresh"] if !ok { return nil, errors.New("context to fyne.Widget: expected context to have function Refresh") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Widget: context fn Refresh: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Widget: context fn Refresh: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Refresh = func(ctx env.RyeCtx) { actualFn := fn @@ -42573,7 +40821,7 @@ func ctxTo_fyne_Widget(ps *env.ProgramState, v env.RyeCtx) (fyne.Widget, error) evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to fyne.Widget: context fn Refresh: expected function") + return nil, errors.New("context to fyne.Widget: context fn Refresh: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -42621,14 +40869,14 @@ func ctxTo_fyne_WidgetRenderer(ps *env.ProgramState, v env.RyeCtx) (fyne.WidgetR impl := &iface_fyne_WidgetRenderer{ self: v, } - ctxObj0, ok := wordToObj["Destroy"] + ctxObj0, ok := wordToObj["destroy"] if !ok { return nil, errors.New("context to fyne.WidgetRenderer: expected context to have function Destroy") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.WidgetRenderer: context fn Destroy: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.WidgetRenderer: context fn Destroy: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Destroy = func(ctx env.RyeCtx) { actualFn := fn @@ -42636,35 +40884,35 @@ func ctxTo_fyne_WidgetRenderer(ps *env.ProgramState, v env.RyeCtx) (fyne.WidgetR evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to fyne.WidgetRenderer: context fn Destroy: expected function") + return nil, errors.New("context to fyne.WidgetRenderer: context fn Destroy: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Layout"] + ctxObj1, ok := wordToObj["layout"] if !ok { return nil, errors.New("context to fyne.WidgetRenderer: expected context to have function Layout") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.WidgetRenderer: context fn Layout: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.WidgetRenderer: context fn Layout: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Layout = func(ctx env.RyeCtx, arg0 fyne.Size) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, &arg0, "Go(*fyne.Size)") + impl.fn_Layout = func(ctx env.RyeCtx, farg0 fyne.Size) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, &farg0, "Go(*fyne.Size)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.WidgetRenderer: context fn Layout: expected function") + return nil, errors.New("context to fyne.WidgetRenderer: context fn Layout: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["MinSize"] + ctxObj2, ok := wordToObj["min-size"] if !ok { return nil, errors.New("context to fyne.WidgetRenderer: expected context to have function MinSize") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.WidgetRenderer: context fn MinSize: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.WidgetRenderer: context fn MinSize: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_MinSize = func(ctx env.RyeCtx) fyne.Size { actualFn := fn @@ -42673,19 +40921,21 @@ func ctxTo_fyne_WidgetRenderer(ps *env.ProgramState, v env.RyeCtx) (fyne.WidgetR var res fyne.Size switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(fyne.Size) - if !ok { + if vc, ok := v.Value.(*fyne.Size); ok { + res = *vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.WidgetRenderer: arg 0: callback result: expected native of type fyne.Size", + "context to fyne.WidgetRenderer: arg 0: callback result: "+"expected native of type *fyne.Size, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.WidgetRenderer: arg 0: callback result: expected native", + "context to fyne.WidgetRenderer: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -42694,16 +40944,16 @@ func ctxTo_fyne_WidgetRenderer(ps *env.ProgramState, v env.RyeCtx) (fyne.WidgetR return res } default: - return nil, errors.New("context to fyne.WidgetRenderer: context fn MinSize: expected function") + return nil, errors.New("context to fyne.WidgetRenderer: context fn MinSize: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Objects"] + ctxObj3, ok := wordToObj["objects"] if !ok { return nil, errors.New("context to fyne.WidgetRenderer: expected context to have function Objects") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.WidgetRenderer: context fn Objects: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.WidgetRenderer: context fn Objects: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Objects = func(ctx env.RyeCtx) []fyne.CanvasObject { actualFn := fn @@ -42719,19 +40969,21 @@ func ctxTo_fyne_WidgetRenderer(ps *env.ProgramState, v env.RyeCtx) (fyne.WidgetR var err error res[i], err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.WidgetRenderer: arg 0: callback result: block item: "+err.Error()+"", + "context to fyne.WidgetRenderer: arg 0: callback result: "+"block item: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res[i], ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + res[i] = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.WidgetRenderer: arg 0: callback result: block item: expected native of type fyne.CanvasObject", + "context to fyne.WidgetRenderer: arg 0: callback result: "+"block item: "+"expected native of type fyne.CanvasObject, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -42739,8 +40991,9 @@ func ctxTo_fyne_WidgetRenderer(ps *env.ProgramState, v env.RyeCtx) (fyne.WidgetR } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.WidgetRenderer: arg 0: callback result: block item: expected integer to be 0 or nil", + "context to fyne.WidgetRenderer: arg 0: callback result: "+"block item: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -42748,29 +41001,20 @@ func ctxTo_fyne_WidgetRenderer(ps *env.ProgramState, v env.RyeCtx) (fyne.WidgetR } res[i] = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.WidgetRenderer: arg 0: callback result: block item: expected native", + "context to fyne.WidgetRenderer: arg 0: callback result: "+"block item: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]fyne.CanvasObject) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.WidgetRenderer: arg 0: callback result: expected native of type []fyne.CanvasObject", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.WidgetRenderer: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.WidgetRenderer: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -42778,8 +41022,9 @@ func ctxTo_fyne_WidgetRenderer(ps *env.ProgramState, v env.RyeCtx) (fyne.WidgetR } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.WidgetRenderer: arg 0: callback result: expected block, native or nil", + "context to fyne.WidgetRenderer: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -42788,16 +41033,16 @@ func ctxTo_fyne_WidgetRenderer(ps *env.ProgramState, v env.RyeCtx) (fyne.WidgetR return res } default: - return nil, errors.New("context to fyne.WidgetRenderer: context fn Objects: expected function") + return nil, errors.New("context to fyne.WidgetRenderer: context fn Objects: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Refresh"] + ctxObj4, ok := wordToObj["refresh"] if !ok { return nil, errors.New("context to fyne.WidgetRenderer: expected context to have function Refresh") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.WidgetRenderer: context fn Refresh: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.WidgetRenderer: context fn Refresh: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Refresh = func(ctx env.RyeCtx) { actualFn := fn @@ -42805,7 +41050,7 @@ func ctxTo_fyne_WidgetRenderer(ps *env.ProgramState, v env.RyeCtx) (fyne.WidgetR evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to fyne.WidgetRenderer: context fn Refresh: expected function") + return nil, errors.New("context to fyne.WidgetRenderer: context fn Refresh: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -42941,25 +41186,26 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) impl := &iface_fyne_Window{ self: v, } - ctxObj0, ok := wordToObj["Title"] + ctxObj0, ok := wordToObj["title"] if !ok { return nil, errors.New("context to fyne.Window: expected context to have function Title") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Window: context fn Title: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Window: context fn Title: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Title = func(ctx env.RyeCtx) string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Window: arg 0: callback result: expected string", + "context to fyne.Window: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -42968,46 +41214,47 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) return res } default: - return nil, errors.New("context to fyne.Window: context fn Title: expected function") + return nil, errors.New("context to fyne.Window: context fn Title: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["SetTitle"] + ctxObj1, ok := wordToObj["set-title"] if !ok { return nil, errors.New("context to fyne.Window: expected context to have function SetTitle") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Window: context fn SetTitle: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Window: context fn SetTitle: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetTitle = func(ctx env.RyeCtx, arg0 string) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_SetTitle = func(ctx env.RyeCtx, farg0 string) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Window: context fn SetTitle: expected function") + return nil, errors.New("context to fyne.Window: context fn SetTitle: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["FullScreen"] + ctxObj2, ok := wordToObj["full-screen"] if !ok { return nil, errors.New("context to fyne.Window: expected context to have function FullScreen") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Window: context fn FullScreen: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Window: context fn FullScreen: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_FullScreen = func(ctx env.RyeCtx) bool { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res bool - if v, ok := ps.Res.(env.Integer); ok { - res = v.Value != 0 + if vc, ok := ps.Res.(env.Integer); ok { + res = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Window: arg 0: callback result: expected integer", + "context to fyne.Window: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -43016,54 +41263,54 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) return res } default: - return nil, errors.New("context to fyne.Window: context fn FullScreen: expected function") + return nil, errors.New("context to fyne.Window: context fn FullScreen: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["SetFullScreen"] + ctxObj3, ok := wordToObj["set-full-screen"] if !ok { return nil, errors.New("context to fyne.Window: expected context to have function SetFullScreen") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Window: context fn SetFullScreen: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Window: context fn SetFullScreen: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetFullScreen = func(ctx env.RyeCtx, arg0 bool) { - var arg0Val env.Object - arg0Val = *env.NewInteger(boolToInt64(arg0)) + impl.fn_SetFullScreen = func(ctx env.RyeCtx, farg0 bool) { + var farg0Val env.Object + farg0Val = *env.NewInteger(boolToInt64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Window: context fn SetFullScreen: expected function") + return nil, errors.New("context to fyne.Window: context fn SetFullScreen: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Resize"] + ctxObj4, ok := wordToObj["resize"] if !ok { return nil, errors.New("context to fyne.Window: expected context to have function Resize") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Window: context fn Resize: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Window: context fn Resize: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Resize = func(ctx env.RyeCtx, arg0 fyne.Size) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, &arg0, "Go(*fyne.Size)") + impl.fn_Resize = func(ctx env.RyeCtx, farg0 fyne.Size) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, &farg0, "Go(*fyne.Size)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Window: context fn Resize: expected function") + return nil, errors.New("context to fyne.Window: context fn Resize: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["RequestFocus"] + ctxObj5, ok := wordToObj["request-focus"] if !ok { return nil, errors.New("context to fyne.Window: expected context to have function RequestFocus") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Window: context fn RequestFocus: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Window: context fn RequestFocus: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_RequestFocus = func(ctx env.RyeCtx) { actualFn := fn @@ -43071,27 +41318,28 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to fyne.Window: context fn RequestFocus: expected function") + return nil, errors.New("context to fyne.Window: context fn RequestFocus: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["FixedSize"] + ctxObj6, ok := wordToObj["fixed-size"] if !ok { return nil, errors.New("context to fyne.Window: expected context to have function FixedSize") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Window: context fn FixedSize: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Window: context fn FixedSize: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_FixedSize = func(ctx env.RyeCtx) bool { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res bool - if v, ok := ps.Res.(env.Integer); ok { - res = v.Value != 0 + if vc, ok := ps.Res.(env.Integer); ok { + res = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Window: arg 0: callback result: expected integer", + "context to fyne.Window: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -43100,35 +41348,35 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) return res } default: - return nil, errors.New("context to fyne.Window: context fn FixedSize: expected function") + return nil, errors.New("context to fyne.Window: context fn FixedSize: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["SetFixedSize"] + ctxObj7, ok := wordToObj["set-fixed-size"] if !ok { return nil, errors.New("context to fyne.Window: expected context to have function SetFixedSize") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Window: context fn SetFixedSize: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Window: context fn SetFixedSize: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetFixedSize = func(ctx env.RyeCtx, arg0 bool) { - var arg0Val env.Object - arg0Val = *env.NewInteger(boolToInt64(arg0)) + impl.fn_SetFixedSize = func(ctx env.RyeCtx, farg0 bool) { + var farg0Val env.Object + farg0Val = *env.NewInteger(boolToInt64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Window: context fn SetFixedSize: expected function") + return nil, errors.New("context to fyne.Window: context fn SetFixedSize: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["CenterOnScreen"] + ctxObj8, ok := wordToObj["center-on-screen"] if !ok { return nil, errors.New("context to fyne.Window: expected context to have function CenterOnScreen") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Window: context fn CenterOnScreen: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Window: context fn CenterOnScreen: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_CenterOnScreen = func(ctx env.RyeCtx) { actualFn := fn @@ -43136,27 +41384,28 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to fyne.Window: context fn CenterOnScreen: expected function") + return nil, errors.New("context to fyne.Window: context fn CenterOnScreen: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["Padded"] + ctxObj9, ok := wordToObj["padded"] if !ok { return nil, errors.New("context to fyne.Window: expected context to have function Padded") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Window: context fn Padded: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Window: context fn Padded: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Padded = func(ctx env.RyeCtx) bool { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res bool - if v, ok := ps.Res.(env.Integer); ok { - res = v.Value != 0 + if vc, ok := ps.Res.(env.Integer); ok { + res = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Window: arg 0: callback result: expected integer", + "context to fyne.Window: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -43165,35 +41414,35 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) return res } default: - return nil, errors.New("context to fyne.Window: context fn Padded: expected function") + return nil, errors.New("context to fyne.Window: context fn Padded: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj10, ok := wordToObj["SetPadded"] + ctxObj10, ok := wordToObj["set-padded"] if !ok { return nil, errors.New("context to fyne.Window: expected context to have function SetPadded") } switch fn := ctxObj10.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Window: context fn SetPadded: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Window: context fn SetPadded: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetPadded = func(ctx env.RyeCtx, arg0 bool) { - var arg0Val env.Object - arg0Val = *env.NewInteger(boolToInt64(arg0)) + impl.fn_SetPadded = func(ctx env.RyeCtx, farg0 bool) { + var farg0Val env.Object + farg0Val = *env.NewInteger(boolToInt64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Window: context fn SetPadded: expected function") + return nil, errors.New("context to fyne.Window: context fn SetPadded: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj11, ok := wordToObj["Icon"] + ctxObj11, ok := wordToObj["icon"] if !ok { return nil, errors.New("context to fyne.Window: expected context to have function Icon") } switch fn := ctxObj11.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Window: context fn Icon: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Window: context fn Icon: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Icon = func(ctx env.RyeCtx) fyne.Resource { actualFn := fn @@ -43205,19 +41454,21 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) var err error res, err = ctxTo_fyne_Resource(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Window: arg 0: callback result: "+err.Error()+"", + "context to fyne.Window: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Window: arg 0: callback result: expected native of type fyne.Resource", + "context to fyne.Window: arg 0: callback result: "+"expected native of type fyne.Resource, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -43225,8 +41476,9 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Window: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Window: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -43234,8 +41486,9 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Window: arg 0: callback result: expected native", + "context to fyne.Window: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -43244,52 +41497,35 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) return res } default: - return nil, errors.New("context to fyne.Window: context fn Icon: expected function") + return nil, errors.New("context to fyne.Window: context fn Icon: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj12, ok := wordToObj["SetIcon"] + ctxObj12, ok := wordToObj["set-icon"] if !ok { return nil, errors.New("context to fyne.Window: expected context to have function SetIcon") } switch fn := ctxObj12.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Window: context fn SetIcon: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Window: context fn SetIcon: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetIcon = func(ctx env.RyeCtx, arg0 fyne.Resource) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.Resource)") - } - } + impl.fn_SetIcon = func(ctx env.RyeCtx, farg0 fyne.Resource) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.Resource)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Window: context fn SetIcon: expected function") + return nil, errors.New("context to fyne.Window: context fn SetIcon: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj13, ok := wordToObj["SetMaster"] + ctxObj13, ok := wordToObj["set-master"] if !ok { return nil, errors.New("context to fyne.Window: expected context to have function SetMaster") } switch fn := ctxObj13.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Window: context fn SetMaster: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Window: context fn SetMaster: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_SetMaster = func(ctx env.RyeCtx) { actualFn := fn @@ -43297,16 +41533,16 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to fyne.Window: context fn SetMaster: expected function") + return nil, errors.New("context to fyne.Window: context fn SetMaster: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj14, ok := wordToObj["MainMenu"] + ctxObj14, ok := wordToObj["main-menu"] if !ok { return nil, errors.New("context to fyne.Window: expected context to have function MainMenu") } switch fn := ctxObj14.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Window: context fn MainMenu: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Window: context fn MainMenu: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_MainMenu = func(ctx env.RyeCtx) *fyne.MainMenu { actualFn := fn @@ -43315,11 +41551,12 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) var res *fyne.MainMenu switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(*fyne.MainMenu) - if !ok { + if vc, ok := v.Value.(*fyne.MainMenu); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Window: arg 0: callback result: expected native of type *fyne.MainMenu", + "context to fyne.Window: arg 0: callback result: "+"expected native of type *fyne.MainMenu, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -43327,8 +41564,9 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Window: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Window: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -43336,8 +41574,9 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Window: arg 0: callback result: expected native", + "context to fyne.Window: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -43346,92 +41585,155 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) return res } default: - return nil, errors.New("context to fyne.Window: context fn MainMenu: expected function") + return nil, errors.New("context to fyne.Window: context fn MainMenu: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj15, ok := wordToObj["SetMainMenu"] + ctxObj15, ok := wordToObj["set-main-menu"] if !ok { return nil, errors.New("context to fyne.Window: expected context to have function SetMainMenu") } switch fn := ctxObj15.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Window: context fn SetMainMenu: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Window: context fn SetMainMenu: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetMainMenu = func(ctx env.RyeCtx, arg0 *fyne.MainMenu) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*fyne.MainMenu)") + impl.fn_SetMainMenu = func(ctx env.RyeCtx, farg0 *fyne.MainMenu) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*fyne.MainMenu)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Window: context fn SetMainMenu: expected function") + return nil, errors.New("context to fyne.Window: context fn SetMainMenu: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj16, ok := wordToObj["SetOnClosed"] + ctxObj16, ok := wordToObj["set-on-closed"] if !ok { return nil, errors.New("context to fyne.Window: expected context to have function SetOnClosed") } switch fn := ctxObj16.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Window: context fn SetOnClosed: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Window: context fn SetOnClosed: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetOnClosed = func(ctx env.RyeCtx, arg0 func()) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(func())") + impl.fn_SetOnClosed = func(ctx env.RyeCtx, farg0 func()) { + var farg0Val env.Object + farg0Val = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + farg0() + return nil + }, 0, false, false, "Returned func") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Window: context fn SetOnClosed: expected function") + return nil, errors.New("context to fyne.Window: context fn SetOnClosed: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj17, ok := wordToObj["SetCloseIntercept"] + ctxObj17, ok := wordToObj["set-close-intercept"] if !ok { return nil, errors.New("context to fyne.Window: expected context to have function SetCloseIntercept") } switch fn := ctxObj17.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Window: context fn SetCloseIntercept: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Window: context fn SetCloseIntercept: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetCloseIntercept = func(ctx env.RyeCtx, arg0 func()) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(func())") + impl.fn_SetCloseIntercept = func(ctx env.RyeCtx, farg0 func()) { + var farg0Val env.Object + farg0Val = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + farg0() + return nil + }, 0, false, false, "Returned func") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Window: context fn SetCloseIntercept: expected function") + return nil, errors.New("context to fyne.Window: context fn SetCloseIntercept: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj18, ok := wordToObj["SetOnDropped"] + ctxObj18, ok := wordToObj["set-on-dropped"] if !ok { return nil, errors.New("context to fyne.Window: expected context to have function SetOnDropped") } switch fn := ctxObj18.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Window: context fn SetOnDropped: function has invalid number of arguments (expected 1)") - } - impl.fn_SetOnDropped = func(ctx env.RyeCtx, arg0 func(fyne.Position, []fyne.URI)) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(func(fyne.Position, []fyne.URI))") + return nil, errors.New("context to fyne.Window: context fn SetOnDropped: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) + } + impl.fn_SetOnDropped = func(ctx env.RyeCtx, farg0 func(fyne.Position, []fyne.URI)) { + var farg0Val env.Object + farg0Val = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val fyne.Position + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.Position); ok { + arg0Val = *vc + } else { + ps.FailureFlag = true + return env.NewError("context to fyne.Window: arg 1: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) + } + default: + ps.FailureFlag = true + return env.NewError("context to fyne.Window: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var arg1Val []fyne.URI + switch v := arg1.(type) { + case env.Block: + arg1Val = make([]fyne.URI, len(v.Series.S)) + for i, it := range v.Series.S { + switch v := it.(type) { + case env.RyeCtx: + var err error + arg1Val[i], err = ctxTo_fyne_URI(ps, v) + if err != nil { + ps.FailureFlag = true + return env.NewError("context to fyne.Window: arg 2: " + "block item: " + err.Error()) + } + case env.Native: + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val[i] = vc + } else { + ps.FailureFlag = true + return env.NewError("context to fyne.Window: arg 2: " + "block item: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("context to fyne.Window: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg1Val[i] = nil + default: + ps.FailureFlag = true + return env.NewError("context to fyne.Window: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("context to fyne.Window: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg1Val = nil + default: + ps.FailureFlag = true + return env.NewError("context to fyne.Window: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) + } + farg0(arg0Val, arg1Val) + return nil + }, 2, false, false, "Returned func") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Window: context fn SetOnDropped: expected function") + return nil, errors.New("context to fyne.Window: context fn SetOnDropped: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj19, ok := wordToObj["Show"] + ctxObj19, ok := wordToObj["show"] if !ok { return nil, errors.New("context to fyne.Window: expected context to have function Show") } switch fn := ctxObj19.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Window: context fn Show: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Window: context fn Show: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Show = func(ctx env.RyeCtx) { actualFn := fn @@ -43439,16 +41741,16 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to fyne.Window: context fn Show: expected function") + return nil, errors.New("context to fyne.Window: context fn Show: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj20, ok := wordToObj["Hide"] + ctxObj20, ok := wordToObj["hide"] if !ok { return nil, errors.New("context to fyne.Window: expected context to have function Hide") } switch fn := ctxObj20.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Window: context fn Hide: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Window: context fn Hide: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Hide = func(ctx env.RyeCtx) { actualFn := fn @@ -43456,16 +41758,16 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to fyne.Window: context fn Hide: expected function") + return nil, errors.New("context to fyne.Window: context fn Hide: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj21, ok := wordToObj["Close"] + ctxObj21, ok := wordToObj["close"] if !ok { return nil, errors.New("context to fyne.Window: expected context to have function Close") } switch fn := ctxObj21.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Window: context fn Close: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Window: context fn Close: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Close = func(ctx env.RyeCtx) { actualFn := fn @@ -43473,16 +41775,16 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to fyne.Window: context fn Close: expected function") + return nil, errors.New("context to fyne.Window: context fn Close: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj22, ok := wordToObj["ShowAndRun"] + ctxObj22, ok := wordToObj["show-and-run"] if !ok { return nil, errors.New("context to fyne.Window: expected context to have function ShowAndRun") } switch fn := ctxObj22.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Window: context fn ShowAndRun: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Window: context fn ShowAndRun: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_ShowAndRun = func(ctx env.RyeCtx) { actualFn := fn @@ -43490,16 +41792,16 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to fyne.Window: context fn ShowAndRun: expected function") + return nil, errors.New("context to fyne.Window: context fn ShowAndRun: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj23, ok := wordToObj["Content"] + ctxObj23, ok := wordToObj["content"] if !ok { return nil, errors.New("context to fyne.Window: expected context to have function Content") } switch fn := ctxObj23.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Window: context fn Content: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Window: context fn Content: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Content = func(ctx env.RyeCtx) fyne.CanvasObject { actualFn := fn @@ -43511,19 +41813,21 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) var err error res, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Window: arg 0: callback result: "+err.Error()+"", + "context to fyne.Window: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Window: arg 0: callback result: expected native of type fyne.CanvasObject", + "context to fyne.Window: arg 0: callback result: "+"expected native of type fyne.CanvasObject, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -43531,8 +41835,9 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Window: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Window: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -43540,8 +41845,9 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Window: arg 0: callback result: expected native", + "context to fyne.Window: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -43550,52 +41856,35 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) return res } default: - return nil, errors.New("context to fyne.Window: context fn Content: expected function") + return nil, errors.New("context to fyne.Window: context fn Content: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj24, ok := wordToObj["SetContent"] + ctxObj24, ok := wordToObj["set-content"] if !ok { return nil, errors.New("context to fyne.Window: expected context to have function SetContent") } switch fn := ctxObj24.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to fyne.Window: context fn SetContent: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to fyne.Window: context fn SetContent: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetContent = func(ctx env.RyeCtx, arg0 fyne.CanvasObject) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.CanvasObject)") - } - } + impl.fn_SetContent = func(ctx env.RyeCtx, farg0 fyne.CanvasObject) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.CanvasObject)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to fyne.Window: context fn SetContent: expected function") + return nil, errors.New("context to fyne.Window: context fn SetContent: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj25, ok := wordToObj["Canvas"] + ctxObj25, ok := wordToObj["canvas"] if !ok { return nil, errors.New("context to fyne.Window: expected context to have function Canvas") } switch fn := ctxObj25.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Window: context fn Canvas: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Window: context fn Canvas: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Canvas = func(ctx env.RyeCtx) fyne.Canvas { actualFn := fn @@ -43607,19 +41896,21 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) var err error res, err = ctxTo_fyne_Canvas(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Window: arg 0: callback result: "+err.Error()+"", + "context to fyne.Window: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Window: arg 0: callback result: expected native of type fyne.Canvas", + "context to fyne.Window: arg 0: callback result: "+"expected native of type fyne.Canvas, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -43627,8 +41918,9 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Window: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Window: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -43636,8 +41928,9 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Window: arg 0: callback result: expected native", + "context to fyne.Window: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -43646,16 +41939,16 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) return res } default: - return nil, errors.New("context to fyne.Window: context fn Canvas: expected function") + return nil, errors.New("context to fyne.Window: context fn Canvas: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj26, ok := wordToObj["Clipboard"] + ctxObj26, ok := wordToObj["clipboard"] if !ok { return nil, errors.New("context to fyne.Window: expected context to have function Clipboard") } switch fn := ctxObj26.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to fyne.Window: context fn Clipboard: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to fyne.Window: context fn Clipboard: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Clipboard = func(ctx env.RyeCtx) fyne.Clipboard { actualFn := fn @@ -43667,19 +41960,21 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) var err error res, err = ctxTo_fyne_Clipboard(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Window: arg 0: callback result: "+err.Error()+"", + "context to fyne.Window: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.Clipboard) - if !ok { + if vc, ok := v.Value.(fyne.Clipboard); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Window: arg 0: callback result: expected native of type fyne.Clipboard", + "context to fyne.Window: arg 0: callback result: "+"expected native of type fyne.Clipboard, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -43687,8 +41982,9 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Window: arg 0: callback result: expected integer to be 0 or nil", + "context to fyne.Window: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -43696,8 +41992,9 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to fyne.Window: arg 0: callback result: expected native", + "context to fyne.Window: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -43706,7 +42003,7 @@ func ctxTo_fyne_Window(ps *env.ProgramState, v env.RyeCtx) (fyne.Window, error) return res } default: - return nil, errors.New("context to fyne.Window: context fn Clipboard: expected function") + return nil, errors.New("context to fyne.Window: context fn Clipboard: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -43738,51 +42035,54 @@ func ctxTo_io_Reader(ps *env.ProgramState, v env.RyeCtx) (io.Reader, error) { impl := &iface_io_Reader{ self: v, } - ctxObj0, ok := wordToObj["Read"] + ctxObj0, ok := wordToObj["read"] if !ok { return nil, errors.New("context to io.Reader: expected context to have function Read") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to io.Reader: context fn Read: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to io.Reader: context fn Read: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Read = func(ctx env.RyeCtx, arg0 []byte) (int, error) { - var arg0Val env.Object + impl.fn_Read = func(ctx env.RyeCtx, farg0 []byte) (int, error) { + var farg0Val env.Object { - items := make([]env.Object, len(arg0)) - for i, it := range arg0 { + items := make([]env.Object, len(farg0)) + for i, it := range farg0 { items[i] = *env.NewNative(ps.Idx, it, "Go(byte)") } - arg0Val = *env.NewBlock(*env.NewTSeries(items)) + farg0Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 int var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to io.Reader: arg 0: callback result: expected block for multiple return values", + "context to io.Reader: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to io.Reader: arg 0: callback result: expected block with 2 return values", + "context to io.Reader: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = int(v.Value) + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to io.Reader: arg 0: callback result: expected integer", + "context to io.Reader: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -43795,8 +42095,9 @@ func ctxTo_io_Reader(ps *env.ProgramState, v env.RyeCtx) (io.Reader, error) { res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to io.Reader: arg 0: callback result: expected integer to be 0 or nil", + "context to io.Reader: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -43804,8 +42105,9 @@ func ctxTo_io_Reader(ps *env.ProgramState, v env.RyeCtx) (io.Reader, error) { } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to io.Reader: arg 0: callback result: expected error, string or nil", + "context to io.Reader: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -43814,7 +42116,7 @@ func ctxTo_io_Reader(ps *env.ProgramState, v env.RyeCtx) (io.Reader, error) { return res0, res1 } default: - return nil, errors.New("context to io.Reader: context fn Read: expected function") + return nil, errors.New("context to io.Reader: context fn Read: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -43850,25 +42152,26 @@ func ctxTo_layout_SpacerObject(ps *env.ProgramState, v env.RyeCtx) (layout.Space impl := &iface_layout_SpacerObject{ self: v, } - ctxObj0, ok := wordToObj["ExpandVertical"] + ctxObj0, ok := wordToObj["expand-vertical"] if !ok { return nil, errors.New("context to layout.SpacerObject: expected context to have function ExpandVertical") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to layout.SpacerObject: context fn ExpandVertical: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to layout.SpacerObject: context fn ExpandVertical: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_ExpandVertical = func(ctx env.RyeCtx) bool { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res bool - if v, ok := ps.Res.(env.Integer); ok { - res = v.Value != 0 + if vc, ok := ps.Res.(env.Integer); ok { + res = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to layout.SpacerObject: arg 0: callback result: expected integer", + "context to layout.SpacerObject: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -43877,27 +42180,28 @@ func ctxTo_layout_SpacerObject(ps *env.ProgramState, v env.RyeCtx) (layout.Space return res } default: - return nil, errors.New("context to layout.SpacerObject: context fn ExpandVertical: expected function") + return nil, errors.New("context to layout.SpacerObject: context fn ExpandVertical: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["ExpandHorizontal"] + ctxObj1, ok := wordToObj["expand-horizontal"] if !ok { return nil, errors.New("context to layout.SpacerObject: expected context to have function ExpandHorizontal") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to layout.SpacerObject: context fn ExpandHorizontal: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to layout.SpacerObject: context fn ExpandHorizontal: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_ExpandHorizontal = func(ctx env.RyeCtx) bool { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res bool - if v, ok := ps.Res.(env.Integer); ok { - res = v.Value != 0 + if vc, ok := ps.Res.(env.Integer); ok { + res = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to layout.SpacerObject: arg 0: callback result: expected integer", + "context to layout.SpacerObject: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -43906,7 +42210,7 @@ func ctxTo_layout_SpacerObject(ps *env.ProgramState, v env.RyeCtx) (layout.Space return res } default: - return nil, errors.New("context to layout.SpacerObject: context fn ExpandHorizontal: expected function") + return nil, errors.New("context to layout.SpacerObject: context fn ExpandHorizontal: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -43946,14 +42250,14 @@ func ctxTo_mobile_Device(ps *env.ProgramState, v env.RyeCtx) (mobile.Device, err impl := &iface_mobile_Device{ self: v, } - ctxObj0, ok := wordToObj["ShowVirtualKeyboard"] + ctxObj0, ok := wordToObj["show-virtual-keyboard"] if !ok { return nil, errors.New("context to mobile.Device: expected context to have function ShowVirtualKeyboard") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to mobile.Device: context fn ShowVirtualKeyboard: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to mobile.Device: context fn ShowVirtualKeyboard: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_ShowVirtualKeyboard = func(ctx env.RyeCtx) { actualFn := fn @@ -43961,35 +42265,35 @@ func ctxTo_mobile_Device(ps *env.ProgramState, v env.RyeCtx) (mobile.Device, err evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to mobile.Device: context fn ShowVirtualKeyboard: expected function") + return nil, errors.New("context to mobile.Device: context fn ShowVirtualKeyboard: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["ShowVirtualKeyboardType"] + ctxObj1, ok := wordToObj["show-virtual-keyboard-type"] if !ok { return nil, errors.New("context to mobile.Device: expected context to have function ShowVirtualKeyboardType") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to mobile.Device: context fn ShowVirtualKeyboardType: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to mobile.Device: context fn ShowVirtualKeyboardType: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_ShowVirtualKeyboardType = func(ctx env.RyeCtx, arg0 mobile.KeyboardType) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(int32(arg0))) + impl.fn_ShowVirtualKeyboardType = func(ctx env.RyeCtx, farg0 mobile.KeyboardType) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(int32(farg0))) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to mobile.Device: context fn ShowVirtualKeyboardType: expected function") + return nil, errors.New("context to mobile.Device: context fn ShowVirtualKeyboardType: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["HideVirtualKeyboard"] + ctxObj2, ok := wordToObj["hide-virtual-keyboard"] if !ok { return nil, errors.New("context to mobile.Device: expected context to have function HideVirtualKeyboard") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to mobile.Device: context fn HideVirtualKeyboard: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to mobile.Device: context fn HideVirtualKeyboard: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_HideVirtualKeyboard = func(ctx env.RyeCtx) { actualFn := fn @@ -43997,7 +42301,7 @@ func ctxTo_mobile_Device(ps *env.ProgramState, v env.RyeCtx) (mobile.Device, err evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to mobile.Device: context fn HideVirtualKeyboard: expected function") + return nil, errors.New("context to mobile.Device: context fn HideVirtualKeyboard: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -44029,14 +42333,14 @@ func ctxTo_mobile_Driver(ps *env.ProgramState, v env.RyeCtx) (mobile.Driver, err impl := &iface_mobile_Driver{ self: v, } - ctxObj0, ok := wordToObj["GoBack"] + ctxObj0, ok := wordToObj["go-back"] if !ok { return nil, errors.New("context to mobile.Driver: expected context to have function GoBack") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to mobile.Driver: context fn GoBack: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to mobile.Driver: context fn GoBack: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_GoBack = func(ctx env.RyeCtx) { actualFn := fn @@ -44044,7 +42348,7 @@ func ctxTo_mobile_Driver(ps *env.ProgramState, v env.RyeCtx) (mobile.Driver, err evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to mobile.Driver: context fn GoBack: expected function") + return nil, errors.New("context to mobile.Driver: context fn GoBack: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -44092,14 +42396,14 @@ func ctxTo_mobile_Keyboardable(ps *env.ProgramState, v env.RyeCtx) (mobile.Keybo impl := &iface_mobile_Keyboardable{ self: v, } - ctxObj0, ok := wordToObj["Keyboard"] + ctxObj0, ok := wordToObj["keyboard"] if !ok { return nil, errors.New("context to mobile.Keyboardable: expected context to have function Keyboard") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to mobile.Keyboardable: context fn Keyboard: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to mobile.Keyboardable: context fn Keyboard: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Keyboard = func(ctx env.RyeCtx) mobile.KeyboardType { actualFn := fn @@ -44117,11 +42421,12 @@ func ctxTo_mobile_Keyboardable(ps *env.ProgramState, v env.RyeCtx) (mobile.Keybo res = natVal } else { var u int32 - if v, ok := ps.Res.(env.Integer); ok { - u = int32(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + u = int32(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to mobile.Keyboardable: arg 0: callback result: expected integer", + "context to mobile.Keyboardable: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -44133,16 +42438,16 @@ func ctxTo_mobile_Keyboardable(ps *env.ProgramState, v env.RyeCtx) (mobile.Keybo return res } default: - return nil, errors.New("context to mobile.Keyboardable: context fn Keyboard: expected function") + return nil, errors.New("context to mobile.Keyboardable: context fn Keyboard: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["FocusGained"] + ctxObj1, ok := wordToObj["focus-gained"] if !ok { return nil, errors.New("context to mobile.Keyboardable: expected context to have function FocusGained") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to mobile.Keyboardable: context fn FocusGained: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to mobile.Keyboardable: context fn FocusGained: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_FocusGained = func(ctx env.RyeCtx) { actualFn := fn @@ -44150,16 +42455,16 @@ func ctxTo_mobile_Keyboardable(ps *env.ProgramState, v env.RyeCtx) (mobile.Keybo evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to mobile.Keyboardable: context fn FocusGained: expected function") + return nil, errors.New("context to mobile.Keyboardable: context fn FocusGained: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["FocusLost"] + ctxObj2, ok := wordToObj["focus-lost"] if !ok { return nil, errors.New("context to mobile.Keyboardable: expected context to have function FocusLost") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to mobile.Keyboardable: context fn FocusLost: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to mobile.Keyboardable: context fn FocusLost: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_FocusLost = func(ctx env.RyeCtx) { actualFn := fn @@ -44167,45 +42472,45 @@ func ctxTo_mobile_Keyboardable(ps *env.ProgramState, v env.RyeCtx) (mobile.Keybo evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to mobile.Keyboardable: context fn FocusLost: expected function") + return nil, errors.New("context to mobile.Keyboardable: context fn FocusLost: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["TypedRune"] + ctxObj3, ok := wordToObj["typed-rune"] if !ok { return nil, errors.New("context to mobile.Keyboardable: expected context to have function TypedRune") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to mobile.Keyboardable: context fn TypedRune: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to mobile.Keyboardable: context fn TypedRune: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_TypedRune = func(ctx env.RyeCtx, arg0 rune) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(rune)") + impl.fn_TypedRune = func(ctx env.RyeCtx, farg0 rune) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(rune)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to mobile.Keyboardable: context fn TypedRune: expected function") + return nil, errors.New("context to mobile.Keyboardable: context fn TypedRune: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["TypedKey"] + ctxObj4, ok := wordToObj["typed-key"] if !ok { return nil, errors.New("context to mobile.Keyboardable: expected context to have function TypedKey") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to mobile.Keyboardable: context fn TypedKey: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to mobile.Keyboardable: context fn TypedKey: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_TypedKey = func(ctx env.RyeCtx, arg0 *fyne.KeyEvent) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*fyne.KeyEvent)") + impl.fn_TypedKey = func(ctx env.RyeCtx, farg0 *fyne.KeyEvent) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*fyne.KeyEvent)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to mobile.Keyboardable: context fn TypedKey: expected function") + return nil, errors.New("context to mobile.Keyboardable: context fn TypedKey: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -44245,62 +42550,62 @@ func ctxTo_mobile_Touchable(ps *env.ProgramState, v env.RyeCtx) (mobile.Touchabl impl := &iface_mobile_Touchable{ self: v, } - ctxObj0, ok := wordToObj["TouchDown"] + ctxObj0, ok := wordToObj["touch-down"] if !ok { return nil, errors.New("context to mobile.Touchable: expected context to have function TouchDown") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to mobile.Touchable: context fn TouchDown: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to mobile.Touchable: context fn TouchDown: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_TouchDown = func(ctx env.RyeCtx, arg0 *mobile.TouchEvent) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*mobile.TouchEvent)") + impl.fn_TouchDown = func(ctx env.RyeCtx, farg0 *mobile.TouchEvent) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*mobile.TouchEvent)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to mobile.Touchable: context fn TouchDown: expected function") + return nil, errors.New("context to mobile.Touchable: context fn TouchDown: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["TouchUp"] + ctxObj1, ok := wordToObj["touch-up"] if !ok { return nil, errors.New("context to mobile.Touchable: expected context to have function TouchUp") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to mobile.Touchable: context fn TouchUp: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to mobile.Touchable: context fn TouchUp: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_TouchUp = func(ctx env.RyeCtx, arg0 *mobile.TouchEvent) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*mobile.TouchEvent)") + impl.fn_TouchUp = func(ctx env.RyeCtx, farg0 *mobile.TouchEvent) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*mobile.TouchEvent)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to mobile.Touchable: context fn TouchUp: expected function") + return nil, errors.New("context to mobile.Touchable: context fn TouchUp: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["TouchCancel"] + ctxObj2, ok := wordToObj["touch-cancel"] if !ok { return nil, errors.New("context to mobile.Touchable: expected context to have function TouchCancel") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to mobile.Touchable: context fn TouchCancel: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to mobile.Touchable: context fn TouchCancel: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_TouchCancel = func(ctx env.RyeCtx, arg0 *mobile.TouchEvent) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*mobile.TouchEvent)") + impl.fn_TouchCancel = func(ctx env.RyeCtx, farg0 *mobile.TouchEvent) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*mobile.TouchEvent)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to mobile.Touchable: context fn TouchCancel: expected function") + return nil, errors.New("context to mobile.Touchable: context fn TouchCancel: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -44348,56 +42653,22 @@ func ctxTo_repository_CopyableRepository(ps *env.ProgramState, v env.RyeCtx) (re impl := &iface_repository_CopyableRepository{ self: v, } - ctxObj0, ok := wordToObj["Copy"] + ctxObj0, ok := wordToObj["copy"] if !ok { return nil, errors.New("context to repository.CopyableRepository: expected context to have function Copy") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to repository.CopyableRepository: context fn Copy: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to repository.CopyableRepository: context fn Copy: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Copy = func(ctx env.RyeCtx, arg0 fyne.URI, arg1 fyne.URI) error { - var arg0Val, arg1Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } - { - typ := reflect.TypeOf(arg1) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg1Val = *env.NewNative(ps.Idx, arg1, typRyeName) - } else { - arg1Val = *env.NewNative(ps.Idx, arg1, "Go(fyne.URI)") - } - } + impl.fn_Copy = func(ctx env.RyeCtx, farg0 fyne.URI, farg1 fyne.URI) error { + var farg0Val, farg1Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") + farg1Val = ifaceToNative(ps.Idx, farg1, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -44406,8 +42677,9 @@ func ctxTo_repository_CopyableRepository(ps *env.ProgramState, v env.RyeCtx) (re res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CopyableRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.CopyableRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -44415,8 +42687,9 @@ func ctxTo_repository_CopyableRepository(ps *env.ProgramState, v env.RyeCtx) (re } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CopyableRepository: arg 0: callback result: expected error, string or nil", + "context to repository.CopyableRepository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -44425,64 +42698,50 @@ func ctxTo_repository_CopyableRepository(ps *env.ProgramState, v env.RyeCtx) (re return res } default: - return nil, errors.New("context to repository.CopyableRepository: context fn Copy: expected function") + return nil, errors.New("context to repository.CopyableRepository: context fn Copy: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Exists"] + ctxObj1, ok := wordToObj["exists"] if !ok { return nil, errors.New("context to repository.CopyableRepository: expected context to have function Exists") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.CopyableRepository: context fn Exists: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.CopyableRepository: context fn Exists: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Exists = func(ctx env.RyeCtx, arg0 fyne.URI) (bool, error) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_Exists = func(ctx env.RyeCtx, farg0 fyne.URI) (bool, error) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 bool var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CopyableRepository: arg 0: callback result: expected block for multiple return values", + "context to repository.CopyableRepository: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CopyableRepository: arg 0: callback result: expected block with 2 return values", + "context to repository.CopyableRepository: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = v.Value != 0 + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CopyableRepository: arg 0: callback result: expected integer", + "context to repository.CopyableRepository: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -44495,8 +42754,9 @@ func ctxTo_repository_CopyableRepository(ps *env.ProgramState, v env.RyeCtx) (re res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CopyableRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.CopyableRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -44504,8 +42764,9 @@ func ctxTo_repository_CopyableRepository(ps *env.ProgramState, v env.RyeCtx) (re } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CopyableRepository: arg 0: callback result: expected error, string or nil", + "context to repository.CopyableRepository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -44514,54 +42775,39 @@ func ctxTo_repository_CopyableRepository(ps *env.ProgramState, v env.RyeCtx) (re return res0, res1 } default: - return nil, errors.New("context to repository.CopyableRepository: context fn Exists: expected function") + return nil, errors.New("context to repository.CopyableRepository: context fn Exists: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Reader"] + ctxObj2, ok := wordToObj["reader"] if !ok { return nil, errors.New("context to repository.CopyableRepository: expected context to have function Reader") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.CopyableRepository: context fn Reader: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.CopyableRepository: context fn Reader: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Reader = func(ctx env.RyeCtx, arg0 fyne.URI) (fyne.URIReadCloser, error) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_Reader = func(ctx env.RyeCtx, farg0 fyne.URI) (fyne.URIReadCloser, error) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 fyne.URIReadCloser var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CopyableRepository: arg 0: callback result: expected block for multiple return values", + "context to repository.CopyableRepository: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CopyableRepository: arg 0: callback result: expected block with 2 return values", + "context to repository.CopyableRepository: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -44572,19 +42818,21 @@ func ctxTo_repository_CopyableRepository(ps *env.ProgramState, v env.RyeCtx) (re var err error res0, err = ctxTo_fyne_URIReadCloser(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CopyableRepository: arg 0: callback result: "+err.Error()+"", + "context to repository.CopyableRepository: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(fyne.URIReadCloser) - if !ok { + if vc, ok := v.Value.(fyne.URIReadCloser); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CopyableRepository: arg 0: callback result: expected native of type fyne.URIReadCloser", + "context to repository.CopyableRepository: arg 0: callback result: "+"expected native of type fyne.URIReadCloser, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -44592,8 +42840,9 @@ func ctxTo_repository_CopyableRepository(ps *env.ProgramState, v env.RyeCtx) (re } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CopyableRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.CopyableRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -44601,8 +42850,9 @@ func ctxTo_repository_CopyableRepository(ps *env.ProgramState, v env.RyeCtx) (re } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CopyableRepository: arg 0: callback result: expected native", + "context to repository.CopyableRepository: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -44615,8 +42865,9 @@ func ctxTo_repository_CopyableRepository(ps *env.ProgramState, v env.RyeCtx) (re res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CopyableRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.CopyableRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -44624,8 +42875,9 @@ func ctxTo_repository_CopyableRepository(ps *env.ProgramState, v env.RyeCtx) (re } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CopyableRepository: arg 0: callback result: expected error, string or nil", + "context to repository.CopyableRepository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -44634,64 +42886,50 @@ func ctxTo_repository_CopyableRepository(ps *env.ProgramState, v env.RyeCtx) (re return res0, res1 } default: - return nil, errors.New("context to repository.CopyableRepository: context fn Reader: expected function") + return nil, errors.New("context to repository.CopyableRepository: context fn Reader: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["CanRead"] + ctxObj3, ok := wordToObj["can-read"] if !ok { return nil, errors.New("context to repository.CopyableRepository: expected context to have function CanRead") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.CopyableRepository: context fn CanRead: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.CopyableRepository: context fn CanRead: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_CanRead = func(ctx env.RyeCtx, arg0 fyne.URI) (bool, error) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_CanRead = func(ctx env.RyeCtx, farg0 fyne.URI) (bool, error) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 bool var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CopyableRepository: arg 0: callback result: expected block for multiple return values", + "context to repository.CopyableRepository: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CopyableRepository: arg 0: callback result: expected block with 2 return values", + "context to repository.CopyableRepository: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = v.Value != 0 + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CopyableRepository: arg 0: callback result: expected integer", + "context to repository.CopyableRepository: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -44704,8 +42942,9 @@ func ctxTo_repository_CopyableRepository(ps *env.ProgramState, v env.RyeCtx) (re res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CopyableRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.CopyableRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -44713,8 +42952,9 @@ func ctxTo_repository_CopyableRepository(ps *env.ProgramState, v env.RyeCtx) (re } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CopyableRepository: arg 0: callback result: expected error, string or nil", + "context to repository.CopyableRepository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -44723,26 +42963,26 @@ func ctxTo_repository_CopyableRepository(ps *env.ProgramState, v env.RyeCtx) (re return res0, res1 } default: - return nil, errors.New("context to repository.CopyableRepository: context fn CanRead: expected function") + return nil, errors.New("context to repository.CopyableRepository: context fn CanRead: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Destroy"] + ctxObj4, ok := wordToObj["destroy"] if !ok { return nil, errors.New("context to repository.CopyableRepository: expected context to have function Destroy") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.CopyableRepository: context fn Destroy: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.CopyableRepository: context fn Destroy: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Destroy = func(ctx env.RyeCtx, arg0 string) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_Destroy = func(ctx env.RyeCtx, farg0 string) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to repository.CopyableRepository: context fn Destroy: expected function") + return nil, errors.New("context to repository.CopyableRepository: context fn Destroy: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -44790,35 +43030,37 @@ func ctxTo_repository_CustomURIRepository(ps *env.ProgramState, v env.RyeCtx) (r impl := &iface_repository_CustomURIRepository{ self: v, } - ctxObj0, ok := wordToObj["ParseURI"] + ctxObj0, ok := wordToObj["parse-uri"] if !ok { return nil, errors.New("context to repository.CustomURIRepository: expected context to have function ParseURI") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.CustomURIRepository: context fn ParseURI: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.CustomURIRepository: context fn ParseURI: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_ParseURI = func(ctx env.RyeCtx, arg0 string) (fyne.URI, error) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_ParseURI = func(ctx env.RyeCtx, farg0 string) (fyne.URI, error) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 fyne.URI var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CustomURIRepository: arg 0: callback result: expected block for multiple return values", + "context to repository.CustomURIRepository: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CustomURIRepository: arg 0: callback result: expected block with 2 return values", + "context to repository.CustomURIRepository: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -44829,19 +43071,21 @@ func ctxTo_repository_CustomURIRepository(ps *env.ProgramState, v env.RyeCtx) (r var err error res0, err = ctxTo_fyne_URI(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CustomURIRepository: arg 0: callback result: "+err.Error()+"", + "context to repository.CustomURIRepository: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CustomURIRepository: arg 0: callback result: expected native of type fyne.URI", + "context to repository.CustomURIRepository: arg 0: callback result: "+"expected native of type fyne.URI, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -44849,8 +43093,9 @@ func ctxTo_repository_CustomURIRepository(ps *env.ProgramState, v env.RyeCtx) (r } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CustomURIRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.CustomURIRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -44858,8 +43103,9 @@ func ctxTo_repository_CustomURIRepository(ps *env.ProgramState, v env.RyeCtx) (r } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CustomURIRepository: arg 0: callback result: expected native", + "context to repository.CustomURIRepository: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -44872,8 +43118,9 @@ func ctxTo_repository_CustomURIRepository(ps *env.ProgramState, v env.RyeCtx) (r res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CustomURIRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.CustomURIRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -44881,8 +43128,9 @@ func ctxTo_repository_CustomURIRepository(ps *env.ProgramState, v env.RyeCtx) (r } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CustomURIRepository: arg 0: callback result: expected error, string or nil", + "context to repository.CustomURIRepository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -44891,64 +43139,50 @@ func ctxTo_repository_CustomURIRepository(ps *env.ProgramState, v env.RyeCtx) (r return res0, res1 } default: - return nil, errors.New("context to repository.CustomURIRepository: context fn ParseURI: expected function") + return nil, errors.New("context to repository.CustomURIRepository: context fn ParseURI: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Exists"] + ctxObj1, ok := wordToObj["exists"] if !ok { return nil, errors.New("context to repository.CustomURIRepository: expected context to have function Exists") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.CustomURIRepository: context fn Exists: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.CustomURIRepository: context fn Exists: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Exists = func(ctx env.RyeCtx, arg0 fyne.URI) (bool, error) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_Exists = func(ctx env.RyeCtx, farg0 fyne.URI) (bool, error) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 bool var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CustomURIRepository: arg 0: callback result: expected block for multiple return values", + "context to repository.CustomURIRepository: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CustomURIRepository: arg 0: callback result: expected block with 2 return values", + "context to repository.CustomURIRepository: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = v.Value != 0 + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CustomURIRepository: arg 0: callback result: expected integer", + "context to repository.CustomURIRepository: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -44961,8 +43195,9 @@ func ctxTo_repository_CustomURIRepository(ps *env.ProgramState, v env.RyeCtx) (r res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CustomURIRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.CustomURIRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -44970,8 +43205,9 @@ func ctxTo_repository_CustomURIRepository(ps *env.ProgramState, v env.RyeCtx) (r } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CustomURIRepository: arg 0: callback result: expected error, string or nil", + "context to repository.CustomURIRepository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -44980,54 +43216,39 @@ func ctxTo_repository_CustomURIRepository(ps *env.ProgramState, v env.RyeCtx) (r return res0, res1 } default: - return nil, errors.New("context to repository.CustomURIRepository: context fn Exists: expected function") + return nil, errors.New("context to repository.CustomURIRepository: context fn Exists: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Reader"] + ctxObj2, ok := wordToObj["reader"] if !ok { return nil, errors.New("context to repository.CustomURIRepository: expected context to have function Reader") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.CustomURIRepository: context fn Reader: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.CustomURIRepository: context fn Reader: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Reader = func(ctx env.RyeCtx, arg0 fyne.URI) (fyne.URIReadCloser, error) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_Reader = func(ctx env.RyeCtx, farg0 fyne.URI) (fyne.URIReadCloser, error) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 fyne.URIReadCloser var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CustomURIRepository: arg 0: callback result: expected block for multiple return values", + "context to repository.CustomURIRepository: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CustomURIRepository: arg 0: callback result: expected block with 2 return values", + "context to repository.CustomURIRepository: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45038,19 +43259,21 @@ func ctxTo_repository_CustomURIRepository(ps *env.ProgramState, v env.RyeCtx) (r var err error res0, err = ctxTo_fyne_URIReadCloser(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CustomURIRepository: arg 0: callback result: "+err.Error()+"", + "context to repository.CustomURIRepository: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(fyne.URIReadCloser) - if !ok { + if vc, ok := v.Value.(fyne.URIReadCloser); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CustomURIRepository: arg 0: callback result: expected native of type fyne.URIReadCloser", + "context to repository.CustomURIRepository: arg 0: callback result: "+"expected native of type fyne.URIReadCloser, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45058,8 +43281,9 @@ func ctxTo_repository_CustomURIRepository(ps *env.ProgramState, v env.RyeCtx) (r } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CustomURIRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.CustomURIRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45067,8 +43291,9 @@ func ctxTo_repository_CustomURIRepository(ps *env.ProgramState, v env.RyeCtx) (r } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CustomURIRepository: arg 0: callback result: expected native", + "context to repository.CustomURIRepository: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45081,8 +43306,9 @@ func ctxTo_repository_CustomURIRepository(ps *env.ProgramState, v env.RyeCtx) (r res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CustomURIRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.CustomURIRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45090,8 +43316,9 @@ func ctxTo_repository_CustomURIRepository(ps *env.ProgramState, v env.RyeCtx) (r } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CustomURIRepository: arg 0: callback result: expected error, string or nil", + "context to repository.CustomURIRepository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45100,64 +43327,50 @@ func ctxTo_repository_CustomURIRepository(ps *env.ProgramState, v env.RyeCtx) (r return res0, res1 } default: - return nil, errors.New("context to repository.CustomURIRepository: context fn Reader: expected function") + return nil, errors.New("context to repository.CustomURIRepository: context fn Reader: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["CanRead"] + ctxObj3, ok := wordToObj["can-read"] if !ok { return nil, errors.New("context to repository.CustomURIRepository: expected context to have function CanRead") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.CustomURIRepository: context fn CanRead: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.CustomURIRepository: context fn CanRead: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_CanRead = func(ctx env.RyeCtx, arg0 fyne.URI) (bool, error) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_CanRead = func(ctx env.RyeCtx, farg0 fyne.URI) (bool, error) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 bool var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CustomURIRepository: arg 0: callback result: expected block for multiple return values", + "context to repository.CustomURIRepository: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CustomURIRepository: arg 0: callback result: expected block with 2 return values", + "context to repository.CustomURIRepository: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = v.Value != 0 + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CustomURIRepository: arg 0: callback result: expected integer", + "context to repository.CustomURIRepository: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45170,8 +43383,9 @@ func ctxTo_repository_CustomURIRepository(ps *env.ProgramState, v env.RyeCtx) (r res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CustomURIRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.CustomURIRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45179,8 +43393,9 @@ func ctxTo_repository_CustomURIRepository(ps *env.ProgramState, v env.RyeCtx) (r } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.CustomURIRepository: arg 0: callback result: expected error, string or nil", + "context to repository.CustomURIRepository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45189,26 +43404,26 @@ func ctxTo_repository_CustomURIRepository(ps *env.ProgramState, v env.RyeCtx) (r return res0, res1 } default: - return nil, errors.New("context to repository.CustomURIRepository: context fn CanRead: expected function") + return nil, errors.New("context to repository.CustomURIRepository: context fn CanRead: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Destroy"] + ctxObj4, ok := wordToObj["destroy"] if !ok { return nil, errors.New("context to repository.CustomURIRepository: expected context to have function Destroy") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.CustomURIRepository: context fn Destroy: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.CustomURIRepository: context fn Destroy: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Destroy = func(ctx env.RyeCtx, arg0 string) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_Destroy = func(ctx env.RyeCtx, farg0 string) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to repository.CustomURIRepository: context fn Destroy: expected function") + return nil, errors.New("context to repository.CustomURIRepository: context fn Destroy: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -45260,52 +43475,37 @@ func ctxTo_repository_HierarchicalRepository(ps *env.ProgramState, v env.RyeCtx) impl := &iface_repository_HierarchicalRepository{ self: v, } - ctxObj0, ok := wordToObj["Parent"] + ctxObj0, ok := wordToObj["parent"] if !ok { return nil, errors.New("context to repository.HierarchicalRepository: expected context to have function Parent") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.HierarchicalRepository: context fn Parent: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.HierarchicalRepository: context fn Parent: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Parent = func(ctx env.RyeCtx, arg0 fyne.URI) (fyne.URI, error) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_Parent = func(ctx env.RyeCtx, farg0 fyne.URI) (fyne.URI, error) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 fyne.URI var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected block for multiple return values", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected block with 2 return values", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45316,19 +43516,21 @@ func ctxTo_repository_HierarchicalRepository(ps *env.ProgramState, v env.RyeCtx) var err error res0, err = ctxTo_fyne_URI(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: "+err.Error()+"", + "context to repository.HierarchicalRepository: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected native of type fyne.URI", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected native of type fyne.URI, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45336,8 +43538,9 @@ func ctxTo_repository_HierarchicalRepository(ps *env.ProgramState, v env.RyeCtx) } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45345,8 +43548,9 @@ func ctxTo_repository_HierarchicalRepository(ps *env.ProgramState, v env.RyeCtx) } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected native", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45359,8 +43563,9 @@ func ctxTo_repository_HierarchicalRepository(ps *env.ProgramState, v env.RyeCtx) res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45368,8 +43573,9 @@ func ctxTo_repository_HierarchicalRepository(ps *env.ProgramState, v env.RyeCtx) } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected error, string or nil", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45378,55 +43584,40 @@ func ctxTo_repository_HierarchicalRepository(ps *env.ProgramState, v env.RyeCtx) return res0, res1 } default: - return nil, errors.New("context to repository.HierarchicalRepository: context fn Parent: expected function") + return nil, errors.New("context to repository.HierarchicalRepository: context fn Parent: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Child"] + ctxObj1, ok := wordToObj["child"] if !ok { return nil, errors.New("context to repository.HierarchicalRepository: expected context to have function Child") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to repository.HierarchicalRepository: context fn Child: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to repository.HierarchicalRepository: context fn Child: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Child = func(ctx env.RyeCtx, arg0 fyne.URI, arg1 string) (fyne.URI, error) { - var arg0Val, arg1Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } - arg1Val = *env.NewString(arg1) + impl.fn_Child = func(ctx env.RyeCtx, farg0 fyne.URI, farg1 string) (fyne.URI, error) { + var farg0Val, farg1Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") + farg1Val = *env.NewString(farg1) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res0 fyne.URI var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected block for multiple return values", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected block with 2 return values", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45437,19 +43628,21 @@ func ctxTo_repository_HierarchicalRepository(ps *env.ProgramState, v env.RyeCtx) var err error res0, err = ctxTo_fyne_URI(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: "+err.Error()+"", + "context to repository.HierarchicalRepository: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected native of type fyne.URI", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected native of type fyne.URI, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45457,8 +43650,9 @@ func ctxTo_repository_HierarchicalRepository(ps *env.ProgramState, v env.RyeCtx) } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45466,8 +43660,9 @@ func ctxTo_repository_HierarchicalRepository(ps *env.ProgramState, v env.RyeCtx) } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected native", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45480,8 +43675,9 @@ func ctxTo_repository_HierarchicalRepository(ps *env.ProgramState, v env.RyeCtx) res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45489,8 +43685,9 @@ func ctxTo_repository_HierarchicalRepository(ps *env.ProgramState, v env.RyeCtx) } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected error, string or nil", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45499,64 +43696,50 @@ func ctxTo_repository_HierarchicalRepository(ps *env.ProgramState, v env.RyeCtx) return res0, res1 } default: - return nil, errors.New("context to repository.HierarchicalRepository: context fn Child: expected function") + return nil, errors.New("context to repository.HierarchicalRepository: context fn Child: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Exists"] + ctxObj2, ok := wordToObj["exists"] if !ok { return nil, errors.New("context to repository.HierarchicalRepository: expected context to have function Exists") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.HierarchicalRepository: context fn Exists: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.HierarchicalRepository: context fn Exists: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Exists = func(ctx env.RyeCtx, arg0 fyne.URI) (bool, error) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_Exists = func(ctx env.RyeCtx, farg0 fyne.URI) (bool, error) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 bool var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected block for multiple return values", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected block with 2 return values", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = v.Value != 0 + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected integer", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45569,8 +43752,9 @@ func ctxTo_repository_HierarchicalRepository(ps *env.ProgramState, v env.RyeCtx) res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45578,8 +43762,9 @@ func ctxTo_repository_HierarchicalRepository(ps *env.ProgramState, v env.RyeCtx) } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected error, string or nil", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45588,54 +43773,39 @@ func ctxTo_repository_HierarchicalRepository(ps *env.ProgramState, v env.RyeCtx) return res0, res1 } default: - return nil, errors.New("context to repository.HierarchicalRepository: context fn Exists: expected function") + return nil, errors.New("context to repository.HierarchicalRepository: context fn Exists: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Reader"] + ctxObj3, ok := wordToObj["reader"] if !ok { return nil, errors.New("context to repository.HierarchicalRepository: expected context to have function Reader") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.HierarchicalRepository: context fn Reader: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.HierarchicalRepository: context fn Reader: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Reader = func(ctx env.RyeCtx, arg0 fyne.URI) (fyne.URIReadCloser, error) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_Reader = func(ctx env.RyeCtx, farg0 fyne.URI) (fyne.URIReadCloser, error) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 fyne.URIReadCloser var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected block for multiple return values", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected block with 2 return values", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45646,19 +43816,21 @@ func ctxTo_repository_HierarchicalRepository(ps *env.ProgramState, v env.RyeCtx) var err error res0, err = ctxTo_fyne_URIReadCloser(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: "+err.Error()+"", + "context to repository.HierarchicalRepository: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(fyne.URIReadCloser) - if !ok { + if vc, ok := v.Value.(fyne.URIReadCloser); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected native of type fyne.URIReadCloser", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected native of type fyne.URIReadCloser, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45666,8 +43838,9 @@ func ctxTo_repository_HierarchicalRepository(ps *env.ProgramState, v env.RyeCtx) } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45675,8 +43848,9 @@ func ctxTo_repository_HierarchicalRepository(ps *env.ProgramState, v env.RyeCtx) } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected native", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45689,8 +43863,9 @@ func ctxTo_repository_HierarchicalRepository(ps *env.ProgramState, v env.RyeCtx) res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45698,8 +43873,9 @@ func ctxTo_repository_HierarchicalRepository(ps *env.ProgramState, v env.RyeCtx) } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected error, string or nil", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45708,64 +43884,50 @@ func ctxTo_repository_HierarchicalRepository(ps *env.ProgramState, v env.RyeCtx) return res0, res1 } default: - return nil, errors.New("context to repository.HierarchicalRepository: context fn Reader: expected function") + return nil, errors.New("context to repository.HierarchicalRepository: context fn Reader: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["CanRead"] + ctxObj4, ok := wordToObj["can-read"] if !ok { return nil, errors.New("context to repository.HierarchicalRepository: expected context to have function CanRead") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.HierarchicalRepository: context fn CanRead: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.HierarchicalRepository: context fn CanRead: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_CanRead = func(ctx env.RyeCtx, arg0 fyne.URI) (bool, error) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_CanRead = func(ctx env.RyeCtx, farg0 fyne.URI) (bool, error) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 bool var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected block for multiple return values", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected block with 2 return values", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = v.Value != 0 + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected integer", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45778,8 +43940,9 @@ func ctxTo_repository_HierarchicalRepository(ps *env.ProgramState, v env.RyeCtx) res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45787,8 +43950,9 @@ func ctxTo_repository_HierarchicalRepository(ps *env.ProgramState, v env.RyeCtx) } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.HierarchicalRepository: arg 0: callback result: expected error, string or nil", + "context to repository.HierarchicalRepository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45797,26 +43961,26 @@ func ctxTo_repository_HierarchicalRepository(ps *env.ProgramState, v env.RyeCtx) return res0, res1 } default: - return nil, errors.New("context to repository.HierarchicalRepository: context fn CanRead: expected function") + return nil, errors.New("context to repository.HierarchicalRepository: context fn CanRead: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["Destroy"] + ctxObj5, ok := wordToObj["destroy"] if !ok { return nil, errors.New("context to repository.HierarchicalRepository: expected context to have function Destroy") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.HierarchicalRepository: context fn Destroy: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.HierarchicalRepository: context fn Destroy: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Destroy = func(ctx env.RyeCtx, arg0 string) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_Destroy = func(ctx env.RyeCtx, farg0 string) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to repository.HierarchicalRepository: context fn Destroy: expected function") + return nil, errors.New("context to repository.HierarchicalRepository: context fn Destroy: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -45872,62 +44036,48 @@ func ctxTo_repository_ListableRepository(ps *env.ProgramState, v env.RyeCtx) (re impl := &iface_repository_ListableRepository{ self: v, } - ctxObj0, ok := wordToObj["CanList"] + ctxObj0, ok := wordToObj["can-list"] if !ok { return nil, errors.New("context to repository.ListableRepository: expected context to have function CanList") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.ListableRepository: context fn CanList: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.ListableRepository: context fn CanList: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_CanList = func(ctx env.RyeCtx, arg0 fyne.URI) (bool, error) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_CanList = func(ctx env.RyeCtx, farg0 fyne.URI) (bool, error) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 bool var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected block for multiple return values", + "context to repository.ListableRepository: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected block with 2 return values", + "context to repository.ListableRepository: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = v.Value != 0 + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected integer", + "context to repository.ListableRepository: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45940,8 +44090,9 @@ func ctxTo_repository_ListableRepository(ps *env.ProgramState, v env.RyeCtx) (re res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.ListableRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45949,8 +44100,9 @@ func ctxTo_repository_ListableRepository(ps *env.ProgramState, v env.RyeCtx) (re } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected error, string or nil", + "context to repository.ListableRepository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -45959,54 +44111,39 @@ func ctxTo_repository_ListableRepository(ps *env.ProgramState, v env.RyeCtx) (re return res0, res1 } default: - return nil, errors.New("context to repository.ListableRepository: context fn CanList: expected function") + return nil, errors.New("context to repository.ListableRepository: context fn CanList: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["List"] + ctxObj1, ok := wordToObj["list"] if !ok { return nil, errors.New("context to repository.ListableRepository: expected context to have function List") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.ListableRepository: context fn List: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.ListableRepository: context fn List: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_List = func(ctx env.RyeCtx, arg0 fyne.URI) ([]fyne.URI, error) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_List = func(ctx env.RyeCtx, farg0 fyne.URI) ([]fyne.URI, error) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 []fyne.URI var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected block for multiple return values", + "context to repository.ListableRepository: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected block with 2 return values", + "context to repository.ListableRepository: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46021,19 +44158,21 @@ func ctxTo_repository_ListableRepository(ps *env.ProgramState, v env.RyeCtx) (re var err error res0[i], err = ctxTo_fyne_URI(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: block item: "+err.Error()+"", + "context to repository.ListableRepository: arg 0: callback result: "+"block item: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0[i], ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + res0[i] = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: block item: expected native of type fyne.URI", + "context to repository.ListableRepository: arg 0: callback result: "+"block item: "+"expected native of type fyne.URI, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46041,8 +44180,9 @@ func ctxTo_repository_ListableRepository(ps *env.ProgramState, v env.RyeCtx) (re } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: block item: expected integer to be 0 or nil", + "context to repository.ListableRepository: arg 0: callback result: "+"block item: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46050,29 +44190,20 @@ func ctxTo_repository_ListableRepository(ps *env.ProgramState, v env.RyeCtx) (re } res0[i] = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: block item: expected native", + "context to repository.ListableRepository: arg 0: callback result: "+"block item: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } } - case env.Native: - var ok bool - res0, ok = v.Value.([]fyne.URI) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected native of type []fyne.URI", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.ListableRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46080,8 +44211,9 @@ func ctxTo_repository_ListableRepository(ps *env.ProgramState, v env.RyeCtx) (re } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected block, native or nil", + "context to repository.ListableRepository: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46094,8 +44226,9 @@ func ctxTo_repository_ListableRepository(ps *env.ProgramState, v env.RyeCtx) (re res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.ListableRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46103,8 +44236,9 @@ func ctxTo_repository_ListableRepository(ps *env.ProgramState, v env.RyeCtx) (re } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected error, string or nil", + "context to repository.ListableRepository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46113,40 +44247,23 @@ func ctxTo_repository_ListableRepository(ps *env.ProgramState, v env.RyeCtx) (re return res0, res1 } default: - return nil, errors.New("context to repository.ListableRepository: context fn List: expected function") + return nil, errors.New("context to repository.ListableRepository: context fn List: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["CreateListable"] + ctxObj2, ok := wordToObj["create-listable"] if !ok { return nil, errors.New("context to repository.ListableRepository: expected context to have function CreateListable") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.ListableRepository: context fn CreateListable: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.ListableRepository: context fn CreateListable: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_CreateListable = func(ctx env.RyeCtx, arg0 fyne.URI) error { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_CreateListable = func(ctx env.RyeCtx, farg0 fyne.URI) error { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -46155,8 +44272,9 @@ func ctxTo_repository_ListableRepository(ps *env.ProgramState, v env.RyeCtx) (re res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.ListableRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46164,8 +44282,9 @@ func ctxTo_repository_ListableRepository(ps *env.ProgramState, v env.RyeCtx) (re } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected error, string or nil", + "context to repository.ListableRepository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46174,64 +44293,50 @@ func ctxTo_repository_ListableRepository(ps *env.ProgramState, v env.RyeCtx) (re return res } default: - return nil, errors.New("context to repository.ListableRepository: context fn CreateListable: expected function") + return nil, errors.New("context to repository.ListableRepository: context fn CreateListable: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Exists"] + ctxObj3, ok := wordToObj["exists"] if !ok { return nil, errors.New("context to repository.ListableRepository: expected context to have function Exists") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.ListableRepository: context fn Exists: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.ListableRepository: context fn Exists: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Exists = func(ctx env.RyeCtx, arg0 fyne.URI) (bool, error) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_Exists = func(ctx env.RyeCtx, farg0 fyne.URI) (bool, error) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 bool var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected block for multiple return values", + "context to repository.ListableRepository: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected block with 2 return values", + "context to repository.ListableRepository: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = v.Value != 0 + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected integer", + "context to repository.ListableRepository: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46244,8 +44349,9 @@ func ctxTo_repository_ListableRepository(ps *env.ProgramState, v env.RyeCtx) (re res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.ListableRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46253,8 +44359,9 @@ func ctxTo_repository_ListableRepository(ps *env.ProgramState, v env.RyeCtx) (re } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected error, string or nil", + "context to repository.ListableRepository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46263,54 +44370,39 @@ func ctxTo_repository_ListableRepository(ps *env.ProgramState, v env.RyeCtx) (re return res0, res1 } default: - return nil, errors.New("context to repository.ListableRepository: context fn Exists: expected function") + return nil, errors.New("context to repository.ListableRepository: context fn Exists: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Reader"] + ctxObj4, ok := wordToObj["reader"] if !ok { return nil, errors.New("context to repository.ListableRepository: expected context to have function Reader") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.ListableRepository: context fn Reader: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.ListableRepository: context fn Reader: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Reader = func(ctx env.RyeCtx, arg0 fyne.URI) (fyne.URIReadCloser, error) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_Reader = func(ctx env.RyeCtx, farg0 fyne.URI) (fyne.URIReadCloser, error) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 fyne.URIReadCloser var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected block for multiple return values", + "context to repository.ListableRepository: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected block with 2 return values", + "context to repository.ListableRepository: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46321,19 +44413,21 @@ func ctxTo_repository_ListableRepository(ps *env.ProgramState, v env.RyeCtx) (re var err error res0, err = ctxTo_fyne_URIReadCloser(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: "+err.Error()+"", + "context to repository.ListableRepository: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(fyne.URIReadCloser) - if !ok { + if vc, ok := v.Value.(fyne.URIReadCloser); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected native of type fyne.URIReadCloser", + "context to repository.ListableRepository: arg 0: callback result: "+"expected native of type fyne.URIReadCloser, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46341,8 +44435,9 @@ func ctxTo_repository_ListableRepository(ps *env.ProgramState, v env.RyeCtx) (re } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.ListableRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46350,8 +44445,9 @@ func ctxTo_repository_ListableRepository(ps *env.ProgramState, v env.RyeCtx) (re } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected native", + "context to repository.ListableRepository: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46364,8 +44460,9 @@ func ctxTo_repository_ListableRepository(ps *env.ProgramState, v env.RyeCtx) (re res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.ListableRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46373,8 +44470,9 @@ func ctxTo_repository_ListableRepository(ps *env.ProgramState, v env.RyeCtx) (re } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected error, string or nil", + "context to repository.ListableRepository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46383,64 +44481,50 @@ func ctxTo_repository_ListableRepository(ps *env.ProgramState, v env.RyeCtx) (re return res0, res1 } default: - return nil, errors.New("context to repository.ListableRepository: context fn Reader: expected function") + return nil, errors.New("context to repository.ListableRepository: context fn Reader: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["CanRead"] + ctxObj5, ok := wordToObj["can-read"] if !ok { return nil, errors.New("context to repository.ListableRepository: expected context to have function CanRead") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.ListableRepository: context fn CanRead: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.ListableRepository: context fn CanRead: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_CanRead = func(ctx env.RyeCtx, arg0 fyne.URI) (bool, error) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_CanRead = func(ctx env.RyeCtx, farg0 fyne.URI) (bool, error) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 bool var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected block for multiple return values", + "context to repository.ListableRepository: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected block with 2 return values", + "context to repository.ListableRepository: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = v.Value != 0 + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected integer", + "context to repository.ListableRepository: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46453,8 +44537,9 @@ func ctxTo_repository_ListableRepository(ps *env.ProgramState, v env.RyeCtx) (re res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.ListableRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46462,8 +44547,9 @@ func ctxTo_repository_ListableRepository(ps *env.ProgramState, v env.RyeCtx) (re } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.ListableRepository: arg 0: callback result: expected error, string or nil", + "context to repository.ListableRepository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46472,26 +44558,26 @@ func ctxTo_repository_ListableRepository(ps *env.ProgramState, v env.RyeCtx) (re return res0, res1 } default: - return nil, errors.New("context to repository.ListableRepository: context fn CanRead: expected function") + return nil, errors.New("context to repository.ListableRepository: context fn CanRead: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["Destroy"] + ctxObj6, ok := wordToObj["destroy"] if !ok { return nil, errors.New("context to repository.ListableRepository: expected context to have function Destroy") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.ListableRepository: context fn Destroy: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.ListableRepository: context fn Destroy: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Destroy = func(ctx env.RyeCtx, arg0 string) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_Destroy = func(ctx env.RyeCtx, farg0 string) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to repository.ListableRepository: context fn Destroy: expected function") + return nil, errors.New("context to repository.ListableRepository: context fn Destroy: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -46539,56 +44625,22 @@ func ctxTo_repository_MovableRepository(ps *env.ProgramState, v env.RyeCtx) (rep impl := &iface_repository_MovableRepository{ self: v, } - ctxObj0, ok := wordToObj["Move"] + ctxObj0, ok := wordToObj["move"] if !ok { return nil, errors.New("context to repository.MovableRepository: expected context to have function Move") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to repository.MovableRepository: context fn Move: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to repository.MovableRepository: context fn Move: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Move = func(ctx env.RyeCtx, arg0 fyne.URI, arg1 fyne.URI) error { - var arg0Val, arg1Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } - { - typ := reflect.TypeOf(arg1) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg1Val = *env.NewNative(ps.Idx, arg1, typRyeName) - } else { - arg1Val = *env.NewNative(ps.Idx, arg1, "Go(fyne.URI)") - } - } + impl.fn_Move = func(ctx env.RyeCtx, farg0 fyne.URI, farg1 fyne.URI) error { + var farg0Val, farg1Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") + farg1Val = ifaceToNative(ps.Idx, farg1, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) var res error switch v := ps.Res.(type) { case env.String: @@ -46597,8 +44649,9 @@ func ctxTo_repository_MovableRepository(ps *env.ProgramState, v env.RyeCtx) (rep res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.MovableRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.MovableRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46606,8 +44659,9 @@ func ctxTo_repository_MovableRepository(ps *env.ProgramState, v env.RyeCtx) (rep } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.MovableRepository: arg 0: callback result: expected error, string or nil", + "context to repository.MovableRepository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46616,64 +44670,50 @@ func ctxTo_repository_MovableRepository(ps *env.ProgramState, v env.RyeCtx) (rep return res } default: - return nil, errors.New("context to repository.MovableRepository: context fn Move: expected function") + return nil, errors.New("context to repository.MovableRepository: context fn Move: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Exists"] + ctxObj1, ok := wordToObj["exists"] if !ok { return nil, errors.New("context to repository.MovableRepository: expected context to have function Exists") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.MovableRepository: context fn Exists: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.MovableRepository: context fn Exists: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Exists = func(ctx env.RyeCtx, arg0 fyne.URI) (bool, error) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_Exists = func(ctx env.RyeCtx, farg0 fyne.URI) (bool, error) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 bool var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.MovableRepository: arg 0: callback result: expected block for multiple return values", + "context to repository.MovableRepository: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.MovableRepository: arg 0: callback result: expected block with 2 return values", + "context to repository.MovableRepository: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = v.Value != 0 + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.MovableRepository: arg 0: callback result: expected integer", + "context to repository.MovableRepository: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46686,8 +44726,9 @@ func ctxTo_repository_MovableRepository(ps *env.ProgramState, v env.RyeCtx) (rep res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.MovableRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.MovableRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46695,8 +44736,9 @@ func ctxTo_repository_MovableRepository(ps *env.ProgramState, v env.RyeCtx) (rep } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.MovableRepository: arg 0: callback result: expected error, string or nil", + "context to repository.MovableRepository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46705,54 +44747,39 @@ func ctxTo_repository_MovableRepository(ps *env.ProgramState, v env.RyeCtx) (rep return res0, res1 } default: - return nil, errors.New("context to repository.MovableRepository: context fn Exists: expected function") + return nil, errors.New("context to repository.MovableRepository: context fn Exists: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Reader"] + ctxObj2, ok := wordToObj["reader"] if !ok { return nil, errors.New("context to repository.MovableRepository: expected context to have function Reader") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.MovableRepository: context fn Reader: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.MovableRepository: context fn Reader: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Reader = func(ctx env.RyeCtx, arg0 fyne.URI) (fyne.URIReadCloser, error) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_Reader = func(ctx env.RyeCtx, farg0 fyne.URI) (fyne.URIReadCloser, error) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 fyne.URIReadCloser var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.MovableRepository: arg 0: callback result: expected block for multiple return values", + "context to repository.MovableRepository: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.MovableRepository: arg 0: callback result: expected block with 2 return values", + "context to repository.MovableRepository: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46763,19 +44790,21 @@ func ctxTo_repository_MovableRepository(ps *env.ProgramState, v env.RyeCtx) (rep var err error res0, err = ctxTo_fyne_URIReadCloser(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.MovableRepository: arg 0: callback result: "+err.Error()+"", + "context to repository.MovableRepository: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(fyne.URIReadCloser) - if !ok { + if vc, ok := v.Value.(fyne.URIReadCloser); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.MovableRepository: arg 0: callback result: expected native of type fyne.URIReadCloser", + "context to repository.MovableRepository: arg 0: callback result: "+"expected native of type fyne.URIReadCloser, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46783,8 +44812,9 @@ func ctxTo_repository_MovableRepository(ps *env.ProgramState, v env.RyeCtx) (rep } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.MovableRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.MovableRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46792,8 +44822,9 @@ func ctxTo_repository_MovableRepository(ps *env.ProgramState, v env.RyeCtx) (rep } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.MovableRepository: arg 0: callback result: expected native", + "context to repository.MovableRepository: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46806,8 +44837,9 @@ func ctxTo_repository_MovableRepository(ps *env.ProgramState, v env.RyeCtx) (rep res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.MovableRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.MovableRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46815,8 +44847,9 @@ func ctxTo_repository_MovableRepository(ps *env.ProgramState, v env.RyeCtx) (rep } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.MovableRepository: arg 0: callback result: expected error, string or nil", + "context to repository.MovableRepository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46825,64 +44858,50 @@ func ctxTo_repository_MovableRepository(ps *env.ProgramState, v env.RyeCtx) (rep return res0, res1 } default: - return nil, errors.New("context to repository.MovableRepository: context fn Reader: expected function") + return nil, errors.New("context to repository.MovableRepository: context fn Reader: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["CanRead"] + ctxObj3, ok := wordToObj["can-read"] if !ok { return nil, errors.New("context to repository.MovableRepository: expected context to have function CanRead") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.MovableRepository: context fn CanRead: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.MovableRepository: context fn CanRead: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_CanRead = func(ctx env.RyeCtx, arg0 fyne.URI) (bool, error) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_CanRead = func(ctx env.RyeCtx, farg0 fyne.URI) (bool, error) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 bool var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.MovableRepository: arg 0: callback result: expected block for multiple return values", + "context to repository.MovableRepository: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.MovableRepository: arg 0: callback result: expected block with 2 return values", + "context to repository.MovableRepository: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = v.Value != 0 + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.MovableRepository: arg 0: callback result: expected integer", + "context to repository.MovableRepository: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46895,8 +44914,9 @@ func ctxTo_repository_MovableRepository(ps *env.ProgramState, v env.RyeCtx) (rep res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.MovableRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.MovableRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46904,8 +44924,9 @@ func ctxTo_repository_MovableRepository(ps *env.ProgramState, v env.RyeCtx) (rep } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.MovableRepository: arg 0: callback result: expected error, string or nil", + "context to repository.MovableRepository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -46914,26 +44935,26 @@ func ctxTo_repository_MovableRepository(ps *env.ProgramState, v env.RyeCtx) (rep return res0, res1 } default: - return nil, errors.New("context to repository.MovableRepository: context fn CanRead: expected function") + return nil, errors.New("context to repository.MovableRepository: context fn CanRead: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Destroy"] + ctxObj4, ok := wordToObj["destroy"] if !ok { return nil, errors.New("context to repository.MovableRepository: expected context to have function Destroy") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.MovableRepository: context fn Destroy: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.MovableRepository: context fn Destroy: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Destroy = func(ctx env.RyeCtx, arg0 string) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_Destroy = func(ctx env.RyeCtx, farg0 string) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to repository.MovableRepository: context fn Destroy: expected function") + return nil, errors.New("context to repository.MovableRepository: context fn Destroy: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -46977,62 +44998,48 @@ func ctxTo_repository_Repository(ps *env.ProgramState, v env.RyeCtx) (repository impl := &iface_repository_Repository{ self: v, } - ctxObj0, ok := wordToObj["Exists"] + ctxObj0, ok := wordToObj["exists"] if !ok { return nil, errors.New("context to repository.Repository: expected context to have function Exists") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.Repository: context fn Exists: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.Repository: context fn Exists: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Exists = func(ctx env.RyeCtx, arg0 fyne.URI) (bool, error) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_Exists = func(ctx env.RyeCtx, farg0 fyne.URI) (bool, error) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 bool var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.Repository: arg 0: callback result: expected block for multiple return values", + "context to repository.Repository: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.Repository: arg 0: callback result: expected block with 2 return values", + "context to repository.Repository: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = v.Value != 0 + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.Repository: arg 0: callback result: expected integer", + "context to repository.Repository: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47045,8 +45052,9 @@ func ctxTo_repository_Repository(ps *env.ProgramState, v env.RyeCtx) (repository res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.Repository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.Repository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47054,8 +45062,9 @@ func ctxTo_repository_Repository(ps *env.ProgramState, v env.RyeCtx) (repository } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.Repository: arg 0: callback result: expected error, string or nil", + "context to repository.Repository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47064,54 +45073,39 @@ func ctxTo_repository_Repository(ps *env.ProgramState, v env.RyeCtx) (repository return res0, res1 } default: - return nil, errors.New("context to repository.Repository: context fn Exists: expected function") + return nil, errors.New("context to repository.Repository: context fn Exists: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Reader"] + ctxObj1, ok := wordToObj["reader"] if !ok { return nil, errors.New("context to repository.Repository: expected context to have function Reader") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.Repository: context fn Reader: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.Repository: context fn Reader: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Reader = func(ctx env.RyeCtx, arg0 fyne.URI) (fyne.URIReadCloser, error) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_Reader = func(ctx env.RyeCtx, farg0 fyne.URI) (fyne.URIReadCloser, error) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 fyne.URIReadCloser var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.Repository: arg 0: callback result: expected block for multiple return values", + "context to repository.Repository: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.Repository: arg 0: callback result: expected block with 2 return values", + "context to repository.Repository: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47122,19 +45116,21 @@ func ctxTo_repository_Repository(ps *env.ProgramState, v env.RyeCtx) (repository var err error res0, err = ctxTo_fyne_URIReadCloser(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.Repository: arg 0: callback result: "+err.Error()+"", + "context to repository.Repository: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(fyne.URIReadCloser) - if !ok { + if vc, ok := v.Value.(fyne.URIReadCloser); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.Repository: arg 0: callback result: expected native of type fyne.URIReadCloser", + "context to repository.Repository: arg 0: callback result: "+"expected native of type fyne.URIReadCloser, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47142,8 +45138,9 @@ func ctxTo_repository_Repository(ps *env.ProgramState, v env.RyeCtx) (repository } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.Repository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.Repository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47151,8 +45148,9 @@ func ctxTo_repository_Repository(ps *env.ProgramState, v env.RyeCtx) (repository } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.Repository: arg 0: callback result: expected native", + "context to repository.Repository: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47165,8 +45163,9 @@ func ctxTo_repository_Repository(ps *env.ProgramState, v env.RyeCtx) (repository res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.Repository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.Repository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47174,8 +45173,9 @@ func ctxTo_repository_Repository(ps *env.ProgramState, v env.RyeCtx) (repository } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.Repository: arg 0: callback result: expected error, string or nil", + "context to repository.Repository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47184,64 +45184,50 @@ func ctxTo_repository_Repository(ps *env.ProgramState, v env.RyeCtx) (repository return res0, res1 } default: - return nil, errors.New("context to repository.Repository: context fn Reader: expected function") + return nil, errors.New("context to repository.Repository: context fn Reader: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["CanRead"] + ctxObj2, ok := wordToObj["can-read"] if !ok { return nil, errors.New("context to repository.Repository: expected context to have function CanRead") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.Repository: context fn CanRead: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.Repository: context fn CanRead: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_CanRead = func(ctx env.RyeCtx, arg0 fyne.URI) (bool, error) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_CanRead = func(ctx env.RyeCtx, farg0 fyne.URI) (bool, error) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 bool var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.Repository: arg 0: callback result: expected block for multiple return values", + "context to repository.Repository: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.Repository: arg 0: callback result: expected block with 2 return values", + "context to repository.Repository: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = v.Value != 0 + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.Repository: arg 0: callback result: expected integer", + "context to repository.Repository: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47254,8 +45240,9 @@ func ctxTo_repository_Repository(ps *env.ProgramState, v env.RyeCtx) (repository res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.Repository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.Repository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47263,8 +45250,9 @@ func ctxTo_repository_Repository(ps *env.ProgramState, v env.RyeCtx) (repository } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.Repository: arg 0: callback result: expected error, string or nil", + "context to repository.Repository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47273,26 +45261,26 @@ func ctxTo_repository_Repository(ps *env.ProgramState, v env.RyeCtx) (repository return res0, res1 } default: - return nil, errors.New("context to repository.Repository: context fn CanRead: expected function") + return nil, errors.New("context to repository.Repository: context fn CanRead: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Destroy"] + ctxObj3, ok := wordToObj["destroy"] if !ok { return nil, errors.New("context to repository.Repository: expected context to have function Destroy") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.Repository: context fn Destroy: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.Repository: context fn Destroy: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Destroy = func(ctx env.RyeCtx, arg0 string) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_Destroy = func(ctx env.RyeCtx, farg0 string) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to repository.Repository: context fn Destroy: expected function") + return nil, errors.New("context to repository.Repository: context fn Destroy: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -47348,52 +45336,37 @@ func ctxTo_repository_WritableRepository(ps *env.ProgramState, v env.RyeCtx) (re impl := &iface_repository_WritableRepository{ self: v, } - ctxObj0, ok := wordToObj["Writer"] + ctxObj0, ok := wordToObj["writer"] if !ok { return nil, errors.New("context to repository.WritableRepository: expected context to have function Writer") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.WritableRepository: context fn Writer: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.WritableRepository: context fn Writer: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Writer = func(ctx env.RyeCtx, arg0 fyne.URI) (fyne.URIWriteCloser, error) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_Writer = func(ctx env.RyeCtx, farg0 fyne.URI) (fyne.URIWriteCloser, error) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 fyne.URIWriteCloser var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected block for multiple return values", + "context to repository.WritableRepository: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected block with 2 return values", + "context to repository.WritableRepository: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47404,19 +45377,21 @@ func ctxTo_repository_WritableRepository(ps *env.ProgramState, v env.RyeCtx) (re var err error res0, err = ctxTo_fyne_URIWriteCloser(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: "+err.Error()+"", + "context to repository.WritableRepository: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(fyne.URIWriteCloser) - if !ok { + if vc, ok := v.Value.(fyne.URIWriteCloser); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected native of type fyne.URIWriteCloser", + "context to repository.WritableRepository: arg 0: callback result: "+"expected native of type fyne.URIWriteCloser, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47424,8 +45399,9 @@ func ctxTo_repository_WritableRepository(ps *env.ProgramState, v env.RyeCtx) (re } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.WritableRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47433,8 +45409,9 @@ func ctxTo_repository_WritableRepository(ps *env.ProgramState, v env.RyeCtx) (re } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected native", + "context to repository.WritableRepository: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47447,8 +45424,9 @@ func ctxTo_repository_WritableRepository(ps *env.ProgramState, v env.RyeCtx) (re res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.WritableRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47456,8 +45434,9 @@ func ctxTo_repository_WritableRepository(ps *env.ProgramState, v env.RyeCtx) (re } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected error, string or nil", + "context to repository.WritableRepository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47466,64 +45445,50 @@ func ctxTo_repository_WritableRepository(ps *env.ProgramState, v env.RyeCtx) (re return res0, res1 } default: - return nil, errors.New("context to repository.WritableRepository: context fn Writer: expected function") + return nil, errors.New("context to repository.WritableRepository: context fn Writer: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["CanWrite"] + ctxObj1, ok := wordToObj["can-write"] if !ok { return nil, errors.New("context to repository.WritableRepository: expected context to have function CanWrite") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.WritableRepository: context fn CanWrite: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.WritableRepository: context fn CanWrite: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_CanWrite = func(ctx env.RyeCtx, arg0 fyne.URI) (bool, error) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_CanWrite = func(ctx env.RyeCtx, farg0 fyne.URI) (bool, error) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 bool var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected block for multiple return values", + "context to repository.WritableRepository: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected block with 2 return values", + "context to repository.WritableRepository: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = v.Value != 0 + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected integer", + "context to repository.WritableRepository: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47536,8 +45501,9 @@ func ctxTo_repository_WritableRepository(ps *env.ProgramState, v env.RyeCtx) (re res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.WritableRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47545,8 +45511,9 @@ func ctxTo_repository_WritableRepository(ps *env.ProgramState, v env.RyeCtx) (re } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected error, string or nil", + "context to repository.WritableRepository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47555,40 +45522,23 @@ func ctxTo_repository_WritableRepository(ps *env.ProgramState, v env.RyeCtx) (re return res0, res1 } default: - return nil, errors.New("context to repository.WritableRepository: context fn CanWrite: expected function") + return nil, errors.New("context to repository.WritableRepository: context fn CanWrite: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Delete"] + ctxObj2, ok := wordToObj["delete"] if !ok { return nil, errors.New("context to repository.WritableRepository: expected context to have function Delete") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.WritableRepository: context fn Delete: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.WritableRepository: context fn Delete: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Delete = func(ctx env.RyeCtx, arg0 fyne.URI) error { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_Delete = func(ctx env.RyeCtx, farg0 fyne.URI) error { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -47597,8 +45547,9 @@ func ctxTo_repository_WritableRepository(ps *env.ProgramState, v env.RyeCtx) (re res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.WritableRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47606,8 +45557,9 @@ func ctxTo_repository_WritableRepository(ps *env.ProgramState, v env.RyeCtx) (re } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected error, string or nil", + "context to repository.WritableRepository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47616,64 +45568,50 @@ func ctxTo_repository_WritableRepository(ps *env.ProgramState, v env.RyeCtx) (re return res } default: - return nil, errors.New("context to repository.WritableRepository: context fn Delete: expected function") + return nil, errors.New("context to repository.WritableRepository: context fn Delete: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Exists"] + ctxObj3, ok := wordToObj["exists"] if !ok { return nil, errors.New("context to repository.WritableRepository: expected context to have function Exists") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.WritableRepository: context fn Exists: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.WritableRepository: context fn Exists: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Exists = func(ctx env.RyeCtx, arg0 fyne.URI) (bool, error) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_Exists = func(ctx env.RyeCtx, farg0 fyne.URI) (bool, error) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 bool var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected block for multiple return values", + "context to repository.WritableRepository: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected block with 2 return values", + "context to repository.WritableRepository: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = v.Value != 0 + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected integer", + "context to repository.WritableRepository: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47686,8 +45624,9 @@ func ctxTo_repository_WritableRepository(ps *env.ProgramState, v env.RyeCtx) (re res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.WritableRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47695,8 +45634,9 @@ func ctxTo_repository_WritableRepository(ps *env.ProgramState, v env.RyeCtx) (re } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected error, string or nil", + "context to repository.WritableRepository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47705,54 +45645,39 @@ func ctxTo_repository_WritableRepository(ps *env.ProgramState, v env.RyeCtx) (re return res0, res1 } default: - return nil, errors.New("context to repository.WritableRepository: context fn Exists: expected function") + return nil, errors.New("context to repository.WritableRepository: context fn Exists: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Reader"] + ctxObj4, ok := wordToObj["reader"] if !ok { return nil, errors.New("context to repository.WritableRepository: expected context to have function Reader") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.WritableRepository: context fn Reader: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.WritableRepository: context fn Reader: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Reader = func(ctx env.RyeCtx, arg0 fyne.URI) (fyne.URIReadCloser, error) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_Reader = func(ctx env.RyeCtx, farg0 fyne.URI) (fyne.URIReadCloser, error) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 fyne.URIReadCloser var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected block for multiple return values", + "context to repository.WritableRepository: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected block with 2 return values", + "context to repository.WritableRepository: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47763,19 +45688,21 @@ func ctxTo_repository_WritableRepository(ps *env.ProgramState, v env.RyeCtx) (re var err error res0, err = ctxTo_fyne_URIReadCloser(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: "+err.Error()+"", + "context to repository.WritableRepository: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } case env.Native: - var ok bool - res0, ok = v.Value.(fyne.URIReadCloser) - if !ok { + if vc, ok := v.Value.(fyne.URIReadCloser); ok { + res0 = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected native of type fyne.URIReadCloser", + "context to repository.WritableRepository: arg 0: callback result: "+"expected native of type fyne.URIReadCloser, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47783,8 +45710,9 @@ func ctxTo_repository_WritableRepository(ps *env.ProgramState, v env.RyeCtx) (re } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.WritableRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47792,8 +45720,9 @@ func ctxTo_repository_WritableRepository(ps *env.ProgramState, v env.RyeCtx) (re } res0 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected native", + "context to repository.WritableRepository: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47806,8 +45735,9 @@ func ctxTo_repository_WritableRepository(ps *env.ProgramState, v env.RyeCtx) (re res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.WritableRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47815,8 +45745,9 @@ func ctxTo_repository_WritableRepository(ps *env.ProgramState, v env.RyeCtx) (re } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected error, string or nil", + "context to repository.WritableRepository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47825,64 +45756,50 @@ func ctxTo_repository_WritableRepository(ps *env.ProgramState, v env.RyeCtx) (re return res0, res1 } default: - return nil, errors.New("context to repository.WritableRepository: context fn Reader: expected function") + return nil, errors.New("context to repository.WritableRepository: context fn Reader: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["CanRead"] + ctxObj5, ok := wordToObj["can-read"] if !ok { return nil, errors.New("context to repository.WritableRepository: expected context to have function CanRead") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.WritableRepository: context fn CanRead: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.WritableRepository: context fn CanRead: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_CanRead = func(ctx env.RyeCtx, arg0 fyne.URI) (bool, error) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_CanRead = func(ctx env.RyeCtx, farg0 fyne.URI) (bool, error) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 bool var res1 error res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected block for multiple return values", + "context to repository.WritableRepository: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected block with 2 return values", + "context to repository.WritableRepository: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = v.Value != 0 + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected integer", + "context to repository.WritableRepository: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47895,8 +45812,9 @@ func ctxTo_repository_WritableRepository(ps *env.ProgramState, v env.RyeCtx) (re res1 = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected integer to be 0 or nil", + "context to repository.WritableRepository: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47904,8 +45822,9 @@ func ctxTo_repository_WritableRepository(ps *env.ProgramState, v env.RyeCtx) (re } res1 = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to repository.WritableRepository: arg 0: callback result: expected error, string or nil", + "context to repository.WritableRepository: arg 0: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -47914,26 +45833,26 @@ func ctxTo_repository_WritableRepository(ps *env.ProgramState, v env.RyeCtx) (re return res0, res1 } default: - return nil, errors.New("context to repository.WritableRepository: context fn CanRead: expected function") + return nil, errors.New("context to repository.WritableRepository: context fn CanRead: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["Destroy"] + ctxObj6, ok := wordToObj["destroy"] if !ok { return nil, errors.New("context to repository.WritableRepository: expected context to have function Destroy") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to repository.WritableRepository: context fn Destroy: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to repository.WritableRepository: context fn Destroy: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Destroy = func(ctx env.RyeCtx, arg0 string) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + impl.fn_Destroy = func(ctx env.RyeCtx, farg0 string) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to repository.WritableRepository: context fn Destroy: expected function") + return nil, errors.New("context to repository.WritableRepository: context fn Destroy: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -47965,44 +45884,28 @@ func ctxTo_storage_FileFilter(ps *env.ProgramState, v env.RyeCtx) (storage.FileF impl := &iface_storage_FileFilter{ self: v, } - ctxObj0, ok := wordToObj["Matches"] + ctxObj0, ok := wordToObj["matches"] if !ok { return nil, errors.New("context to storage.FileFilter: expected context to have function Matches") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to storage.FileFilter: context fn Matches: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to storage.FileFilter: context fn Matches: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Matches = func(ctx env.RyeCtx, arg0 fyne.URI) bool { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URI)") - } - } + impl.fn_Matches = func(ctx env.RyeCtx, farg0 fyne.URI) bool { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URI)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res bool - if v, ok := ps.Res.(env.Integer); ok { - res = v.Value != 0 + if vc, ok := ps.Res.(env.Integer); ok { + res = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to storage.FileFilter: arg 0: callback result: expected integer", + "context to storage.FileFilter: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -48011,7 +45914,7 @@ func ctxTo_storage_FileFilter(ps *env.ProgramState, v env.RyeCtx) (storage.FileF return res } default: - return nil, errors.New("context to storage.FileFilter: context fn Matches: expected function") + return nil, errors.New("context to storage.FileFilter: context fn Matches: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -48043,54 +45946,39 @@ func ctxTo_test_SoftwarePainter(ps *env.ProgramState, v env.RyeCtx) (test.Softwa impl := &iface_test_SoftwarePainter{ self: v, } - ctxObj0, ok := wordToObj["Paint"] + ctxObj0, ok := wordToObj["paint"] if !ok { return nil, errors.New("context to test.SoftwarePainter: expected context to have function Paint") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to test.SoftwarePainter: context fn Paint: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to test.SoftwarePainter: context fn Paint: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Paint = func(ctx env.RyeCtx, arg0 fyne.Canvas) image.Image { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.Canvas)") - } - } + impl.fn_Paint = func(ctx env.RyeCtx, farg0 fyne.Canvas) image.Image { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.Canvas)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res image.Image switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(image.Image) - if !ok { + if vc, ok := v.Value.(image.Image); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.SoftwarePainter: arg 0: callback result: expected native of type image.Image", + "context to test.SoftwarePainter: arg 0: callback result: "+"expected native of type image.Image, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.SoftwarePainter: arg 0: callback result: expected native", + "context to test.SoftwarePainter: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -48099,7 +45987,7 @@ func ctxTo_test_SoftwarePainter(ps *env.ProgramState, v env.RyeCtx) (test.Softwa return res } default: - return nil, errors.New("context to test.SoftwarePainter: context fn Paint: expected function") + return nil, errors.New("context to test.SoftwarePainter: context fn Paint: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -48223,25 +46111,26 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo impl := &iface_test_WindowlessCanvas{ self: v, } - ctxObj0, ok := wordToObj["Padded"] + ctxObj0, ok := wordToObj["padded"] if !ok { return nil, errors.New("context to test.WindowlessCanvas: expected context to have function Padded") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to test.WindowlessCanvas: context fn Padded: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to test.WindowlessCanvas: context fn Padded: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Padded = func(ctx env.RyeCtx) bool { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res bool - if v, ok := ps.Res.(env.Integer); ok { - res = v.Value != 0 + if vc, ok := ps.Res.(env.Integer); ok { + res = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: expected integer", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -48250,73 +46139,73 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo return res } default: - return nil, errors.New("context to test.WindowlessCanvas: context fn Padded: expected function") + return nil, errors.New("context to test.WindowlessCanvas: context fn Padded: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Resize"] + ctxObj1, ok := wordToObj["resize"] if !ok { return nil, errors.New("context to test.WindowlessCanvas: expected context to have function Resize") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to test.WindowlessCanvas: context fn Resize: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to test.WindowlessCanvas: context fn Resize: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Resize = func(ctx env.RyeCtx, arg0 fyne.Size) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, &arg0, "Go(*fyne.Size)") + impl.fn_Resize = func(ctx env.RyeCtx, farg0 fyne.Size) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, &farg0, "Go(*fyne.Size)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to test.WindowlessCanvas: context fn Resize: expected function") + return nil, errors.New("context to test.WindowlessCanvas: context fn Resize: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["SetPadded"] + ctxObj2, ok := wordToObj["set-padded"] if !ok { return nil, errors.New("context to test.WindowlessCanvas: expected context to have function SetPadded") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to test.WindowlessCanvas: context fn SetPadded: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to test.WindowlessCanvas: context fn SetPadded: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetPadded = func(ctx env.RyeCtx, arg0 bool) { - var arg0Val env.Object - arg0Val = *env.NewInteger(boolToInt64(arg0)) + impl.fn_SetPadded = func(ctx env.RyeCtx, farg0 bool) { + var farg0Val env.Object + farg0Val = *env.NewInteger(boolToInt64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to test.WindowlessCanvas: context fn SetPadded: expected function") + return nil, errors.New("context to test.WindowlessCanvas: context fn SetPadded: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["SetScale"] + ctxObj3, ok := wordToObj["set-scale"] if !ok { return nil, errors.New("context to test.WindowlessCanvas: expected context to have function SetScale") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to test.WindowlessCanvas: context fn SetScale: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to test.WindowlessCanvas: context fn SetScale: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetScale = func(ctx env.RyeCtx, arg0 float32) { - var arg0Val env.Object - arg0Val = *env.NewDecimal(float64(arg0)) + impl.fn_SetScale = func(ctx env.RyeCtx, farg0 float32) { + var farg0Val env.Object + farg0Val = *env.NewDecimal(float64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to test.WindowlessCanvas: context fn SetScale: expected function") + return nil, errors.New("context to test.WindowlessCanvas: context fn SetScale: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Content"] + ctxObj4, ok := wordToObj["content"] if !ok { return nil, errors.New("context to test.WindowlessCanvas: expected context to have function Content") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to test.WindowlessCanvas: context fn Content: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to test.WindowlessCanvas: context fn Content: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Content = func(ctx env.RyeCtx) fyne.CanvasObject { actualFn := fn @@ -48328,19 +46217,21 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo var err error res, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: "+err.Error()+"", + "context to test.WindowlessCanvas: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: expected native of type fyne.CanvasObject", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected native of type fyne.CanvasObject, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -48348,8 +46239,9 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: expected integer to be 0 or nil", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -48357,8 +46249,9 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: expected native", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -48367,124 +46260,73 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo return res } default: - return nil, errors.New("context to test.WindowlessCanvas: context fn Content: expected function") + return nil, errors.New("context to test.WindowlessCanvas: context fn Content: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["SetContent"] + ctxObj5, ok := wordToObj["set-content"] if !ok { return nil, errors.New("context to test.WindowlessCanvas: expected context to have function SetContent") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to test.WindowlessCanvas: context fn SetContent: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to test.WindowlessCanvas: context fn SetContent: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_SetContent = func(ctx env.RyeCtx, arg0 fyne.CanvasObject) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.CanvasObject)") - } - } + impl.fn_SetContent = func(ctx env.RyeCtx, farg0 fyne.CanvasObject) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.CanvasObject)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to test.WindowlessCanvas: context fn SetContent: expected function") + return nil, errors.New("context to test.WindowlessCanvas: context fn SetContent: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["Refresh"] + ctxObj6, ok := wordToObj["refresh"] if !ok { return nil, errors.New("context to test.WindowlessCanvas: expected context to have function Refresh") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to test.WindowlessCanvas: context fn Refresh: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to test.WindowlessCanvas: context fn Refresh: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Refresh = func(ctx env.RyeCtx, arg0 fyne.CanvasObject) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.CanvasObject)") - } - } + impl.fn_Refresh = func(ctx env.RyeCtx, farg0 fyne.CanvasObject) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.CanvasObject)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to test.WindowlessCanvas: context fn Refresh: expected function") + return nil, errors.New("context to test.WindowlessCanvas: context fn Refresh: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj7, ok := wordToObj["Focus"] + ctxObj7, ok := wordToObj["focus"] if !ok { return nil, errors.New("context to test.WindowlessCanvas: expected context to have function Focus") } switch fn := ctxObj7.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to test.WindowlessCanvas: context fn Focus: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to test.WindowlessCanvas: context fn Focus: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Focus = func(ctx env.RyeCtx, arg0 fyne.Focusable) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.Focusable)") - } - } + impl.fn_Focus = func(ctx env.RyeCtx, farg0 fyne.Focusable) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.Focusable)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to test.WindowlessCanvas: context fn Focus: expected function") + return nil, errors.New("context to test.WindowlessCanvas: context fn Focus: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj8, ok := wordToObj["FocusNext"] + ctxObj8, ok := wordToObj["focus-next"] if !ok { return nil, errors.New("context to test.WindowlessCanvas: expected context to have function FocusNext") } switch fn := ctxObj8.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to test.WindowlessCanvas: context fn FocusNext: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to test.WindowlessCanvas: context fn FocusNext: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_FocusNext = func(ctx env.RyeCtx) { actualFn := fn @@ -48492,16 +46334,16 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to test.WindowlessCanvas: context fn FocusNext: expected function") + return nil, errors.New("context to test.WindowlessCanvas: context fn FocusNext: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj9, ok := wordToObj["FocusPrevious"] + ctxObj9, ok := wordToObj["focus-previous"] if !ok { return nil, errors.New("context to test.WindowlessCanvas: expected context to have function FocusPrevious") } switch fn := ctxObj9.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to test.WindowlessCanvas: context fn FocusPrevious: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to test.WindowlessCanvas: context fn FocusPrevious: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_FocusPrevious = func(ctx env.RyeCtx) { actualFn := fn @@ -48509,16 +46351,16 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to test.WindowlessCanvas: context fn FocusPrevious: expected function") + return nil, errors.New("context to test.WindowlessCanvas: context fn FocusPrevious: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj10, ok := wordToObj["Unfocus"] + ctxObj10, ok := wordToObj["unfocus"] if !ok { return nil, errors.New("context to test.WindowlessCanvas: expected context to have function Unfocus") } switch fn := ctxObj10.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to test.WindowlessCanvas: context fn Unfocus: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to test.WindowlessCanvas: context fn Unfocus: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Unfocus = func(ctx env.RyeCtx) { actualFn := fn @@ -48526,16 +46368,16 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to test.WindowlessCanvas: context fn Unfocus: expected function") + return nil, errors.New("context to test.WindowlessCanvas: context fn Unfocus: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj11, ok := wordToObj["Focused"] + ctxObj11, ok := wordToObj["focused"] if !ok { return nil, errors.New("context to test.WindowlessCanvas: expected context to have function Focused") } switch fn := ctxObj11.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to test.WindowlessCanvas: context fn Focused: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to test.WindowlessCanvas: context fn Focused: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Focused = func(ctx env.RyeCtx) fyne.Focusable { actualFn := fn @@ -48547,19 +46389,21 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo var err error res, err = ctxTo_fyne_Focusable(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: "+err.Error()+"", + "context to test.WindowlessCanvas: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.Focusable) - if !ok { + if vc, ok := v.Value.(fyne.Focusable); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: expected native of type fyne.Focusable", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected native of type fyne.Focusable, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -48567,8 +46411,9 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: expected integer to be 0 or nil", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -48576,8 +46421,9 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: expected native", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -48586,16 +46432,16 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo return res } default: - return nil, errors.New("context to test.WindowlessCanvas: context fn Focused: expected function") + return nil, errors.New("context to test.WindowlessCanvas: context fn Focused: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj12, ok := wordToObj["Size"] + ctxObj12, ok := wordToObj["size"] if !ok { return nil, errors.New("context to test.WindowlessCanvas: expected context to have function Size") } switch fn := ctxObj12.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to test.WindowlessCanvas: context fn Size: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to test.WindowlessCanvas: context fn Size: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Size = func(ctx env.RyeCtx) fyne.Size { actualFn := fn @@ -48604,19 +46450,21 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo var res fyne.Size switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(fyne.Size) - if !ok { + if vc, ok := v.Value.(*fyne.Size); ok { + res = *vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: expected native of type fyne.Size", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected native of type *fyne.Size, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: expected native", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -48625,27 +46473,28 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo return res } default: - return nil, errors.New("context to test.WindowlessCanvas: context fn Size: expected function") + return nil, errors.New("context to test.WindowlessCanvas: context fn Size: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj13, ok := wordToObj["Scale"] + ctxObj13, ok := wordToObj["scale"] if !ok { return nil, errors.New("context to test.WindowlessCanvas: expected context to have function Scale") } switch fn := ctxObj13.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to test.WindowlessCanvas: context fn Scale: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to test.WindowlessCanvas: context fn Scale: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Scale = func(ctx env.RyeCtx) float32 { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res float32 - if v, ok := ps.Res.(env.Decimal); ok { - res = float32(v.Value) + if vc, ok := ps.Res.(env.Decimal); ok { + res = float32(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: expected decimal", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected decimal, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -48654,16 +46503,16 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo return res } default: - return nil, errors.New("context to test.WindowlessCanvas: context fn Scale: expected function") + return nil, errors.New("context to test.WindowlessCanvas: context fn Scale: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj14, ok := wordToObj["Overlays"] + ctxObj14, ok := wordToObj["overlays"] if !ok { return nil, errors.New("context to test.WindowlessCanvas: expected context to have function Overlays") } switch fn := ctxObj14.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to test.WindowlessCanvas: context fn Overlays: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to test.WindowlessCanvas: context fn Overlays: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Overlays = func(ctx env.RyeCtx) fyne.OverlayStack { actualFn := fn @@ -48675,19 +46524,21 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo var err error res, err = ctxTo_fyne_OverlayStack(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: "+err.Error()+"", + "context to test.WindowlessCanvas: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.OverlayStack) - if !ok { + if vc, ok := v.Value.(fyne.OverlayStack); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: expected native of type fyne.OverlayStack", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected native of type fyne.OverlayStack, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -48695,8 +46546,9 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: expected integer to be 0 or nil", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -48704,8 +46556,9 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: expected native", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -48714,16 +46567,16 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo return res } default: - return nil, errors.New("context to test.WindowlessCanvas: context fn Overlays: expected function") + return nil, errors.New("context to test.WindowlessCanvas: context fn Overlays: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj15, ok := wordToObj["OnTypedRune"] + ctxObj15, ok := wordToObj["on-typed-rune"] if !ok { return nil, errors.New("context to test.WindowlessCanvas: expected context to have function OnTypedRune") } switch fn := ctxObj15.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to test.WindowlessCanvas: context fn OnTypedRune: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to test.WindowlessCanvas: context fn OnTypedRune: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_OnTypedRune = func(ctx env.RyeCtx) func(rune) { actualFn := fn @@ -48733,24 +46586,26 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo switch fn := ps.Res.(type) { case env.Function: if fn.Argsn != 1 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: function has invalid number of arguments (expected 1)", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected 1 function arguments, but got "+strconv.Itoa(fn.Argsn), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } - res = func(arg0 rune) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(rune)") + res = func(farg0 rune) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(rune)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: expected integer to be 0 or nil", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(fn.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -48758,8 +46613,9 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: expected function or nil", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected function or nil, but got "+objectDebugString(ps.Idx, fn), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -48768,35 +46624,51 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo return res } default: - return nil, errors.New("context to test.WindowlessCanvas: context fn OnTypedRune: expected function") + return nil, errors.New("context to test.WindowlessCanvas: context fn OnTypedRune: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj16, ok := wordToObj["SetOnTypedRune"] + ctxObj16, ok := wordToObj["set-on-typed-rune"] if !ok { return nil, errors.New("context to test.WindowlessCanvas: expected context to have function SetOnTypedRune") } switch fn := ctxObj16.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to test.WindowlessCanvas: context fn SetOnTypedRune: function has invalid number of arguments (expected 1)") - } - impl.fn_SetOnTypedRune = func(ctx env.RyeCtx, arg0 func(rune)) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(func(rune))") + return nil, errors.New("context to test.WindowlessCanvas: context fn SetOnTypedRune: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) + } + impl.fn_SetOnTypedRune = func(ctx env.RyeCtx, farg0 func(rune)) { + var farg0Val env.Object + farg0Val = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val rune + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(rune); ok { + arg0Val = vc + } else { + ps.FailureFlag = true + return env.NewError("context to test.WindowlessCanvas: arg 1: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) + } + default: + ps.FailureFlag = true + return env.NewError("context to test.WindowlessCanvas: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + farg0(arg0Val) + return nil + }, 1, false, false, "Returned func") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to test.WindowlessCanvas: context fn SetOnTypedRune: expected function") + return nil, errors.New("context to test.WindowlessCanvas: context fn SetOnTypedRune: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj17, ok := wordToObj["OnTypedKey"] + ctxObj17, ok := wordToObj["on-typed-key"] if !ok { return nil, errors.New("context to test.WindowlessCanvas: expected context to have function OnTypedKey") } switch fn := ctxObj17.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to test.WindowlessCanvas: context fn OnTypedKey: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to test.WindowlessCanvas: context fn OnTypedKey: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_OnTypedKey = func(ctx env.RyeCtx) func(*fyne.KeyEvent) { actualFn := fn @@ -48806,24 +46678,26 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo switch fn := ps.Res.(type) { case env.Function: if fn.Argsn != 1 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: function has invalid number of arguments (expected 1)", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected 1 function arguments, but got "+strconv.Itoa(fn.Argsn), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } - res = func(arg0 *fyne.KeyEvent) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*fyne.KeyEvent)") + res = func(farg0 *fyne.KeyEvent) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*fyne.KeyEvent)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: expected integer to be 0 or nil", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(fn.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -48831,8 +46705,9 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: expected function or nil", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected function or nil, but got "+objectDebugString(ps.Idx, fn), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -48841,108 +46716,125 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo return res } default: - return nil, errors.New("context to test.WindowlessCanvas: context fn OnTypedKey: expected function") + return nil, errors.New("context to test.WindowlessCanvas: context fn OnTypedKey: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj18, ok := wordToObj["SetOnTypedKey"] + ctxObj18, ok := wordToObj["set-on-typed-key"] if !ok { return nil, errors.New("context to test.WindowlessCanvas: expected context to have function SetOnTypedKey") } switch fn := ctxObj18.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to test.WindowlessCanvas: context fn SetOnTypedKey: function has invalid number of arguments (expected 1)") - } - impl.fn_SetOnTypedKey = func(ctx env.RyeCtx, arg0 func(*fyne.KeyEvent)) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(func(*fyne.KeyEvent))") + return nil, errors.New("context to test.WindowlessCanvas: context fn SetOnTypedKey: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) + } + impl.fn_SetOnTypedKey = func(ctx env.RyeCtx, farg0 func(*fyne.KeyEvent)) { + var farg0Val env.Object + farg0Val = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val *fyne.KeyEvent + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + arg0Val = vc + } else { + ps.FailureFlag = true + return env.NewError("context to test.WindowlessCanvas: arg 1: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("context to test.WindowlessCanvas: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg0Val = nil + default: + ps.FailureFlag = true + return env.NewError("context to test.WindowlessCanvas: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + farg0(arg0Val) + return nil + }, 1, false, false, "Returned func") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to test.WindowlessCanvas: context fn SetOnTypedKey: expected function") + return nil, errors.New("context to test.WindowlessCanvas: context fn SetOnTypedKey: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj19, ok := wordToObj["AddShortcut"] + ctxObj19, ok := wordToObj["add-shortcut"] if !ok { return nil, errors.New("context to test.WindowlessCanvas: expected context to have function AddShortcut") } switch fn := ctxObj19.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to test.WindowlessCanvas: context fn AddShortcut: function has invalid number of arguments (expected 2)") - } - impl.fn_AddShortcut = func(ctx env.RyeCtx, arg0 fyne.Shortcut, arg1 func(fyne.Shortcut)) { - var arg0Val, arg1Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() + return nil, errors.New("context to test.WindowlessCanvas: context fn AddShortcut: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) + } + impl.fn_AddShortcut = func(ctx env.RyeCtx, farg0 fyne.Shortcut, farg1 func(fyne.Shortcut)) { + var farg0Val, farg1Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.Shortcut)") + farg1Val = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val fyne.Shortcut + switch v := arg0.(type) { + case env.RyeCtx: + var err error + arg0Val, err = ctxTo_fyne_Shortcut(ps, v) + if err != nil { + ps.FailureFlag = true + return env.NewError("context to test.WindowlessCanvas: arg 1: " + err.Error()) } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.Shortcut)") + case env.Native: + if vc, ok := v.Value.(fyne.Shortcut); ok { + arg0Val = vc + } else { + ps.FailureFlag = true + return env.NewError("context to test.WindowlessCanvas: arg 1: " + "expected native of type fyne.Shortcut, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("context to test.WindowlessCanvas: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg0Val = nil + default: + ps.FailureFlag = true + return env.NewError("context to test.WindowlessCanvas: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - } - arg1Val = *env.NewNative(ps.Idx, arg1, "Go(func(fyne.Shortcut))") + farg1(arg0Val) + return nil + }, 1, false, false, "Returned func") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) } default: - return nil, errors.New("context to test.WindowlessCanvas: context fn AddShortcut: expected function") + return nil, errors.New("context to test.WindowlessCanvas: context fn AddShortcut: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj20, ok := wordToObj["RemoveShortcut"] + ctxObj20, ok := wordToObj["remove-shortcut"] if !ok { return nil, errors.New("context to test.WindowlessCanvas: expected context to have function RemoveShortcut") } switch fn := ctxObj20.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to test.WindowlessCanvas: context fn RemoveShortcut: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to test.WindowlessCanvas: context fn RemoveShortcut: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_RemoveShortcut = func(ctx env.RyeCtx, arg0 fyne.Shortcut) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.Shortcut)") - } - } + impl.fn_RemoveShortcut = func(ctx env.RyeCtx, farg0 fyne.Shortcut) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.Shortcut)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to test.WindowlessCanvas: context fn RemoveShortcut: expected function") + return nil, errors.New("context to test.WindowlessCanvas: context fn RemoveShortcut: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj21, ok := wordToObj["Capture"] + ctxObj21, ok := wordToObj["capture"] if !ok { return nil, errors.New("context to test.WindowlessCanvas: expected context to have function Capture") } switch fn := ctxObj21.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to test.WindowlessCanvas: context fn Capture: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to test.WindowlessCanvas: context fn Capture: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Capture = func(ctx env.RyeCtx) image.Image { actualFn := fn @@ -48951,19 +46843,21 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo var res image.Image switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(image.Image) - if !ok { + if vc, ok := v.Value.(image.Image); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: expected native of type image.Image", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected native of type image.Image, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: expected native", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -48972,57 +46866,61 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo return res } default: - return nil, errors.New("context to test.WindowlessCanvas: context fn Capture: expected function") + return nil, errors.New("context to test.WindowlessCanvas: context fn Capture: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj22, ok := wordToObj["PixelCoordinateForPosition"] + ctxObj22, ok := wordToObj["pixel-coordinate-for-position"] if !ok { return nil, errors.New("context to test.WindowlessCanvas: expected context to have function PixelCoordinateForPosition") } switch fn := ctxObj22.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to test.WindowlessCanvas: context fn PixelCoordinateForPosition: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to test.WindowlessCanvas: context fn PixelCoordinateForPosition: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_PixelCoordinateForPosition = func(ctx env.RyeCtx, arg0 fyne.Position) (int, int) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, &arg0, "Go(*fyne.Position)") + impl.fn_PixelCoordinateForPosition = func(ctx env.RyeCtx, farg0 fyne.Position) (int, int) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, &farg0, "Go(*fyne.Position)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) var res0 int var res1 int res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: expected block for multiple return values", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: expected block with 2 return values", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = int(v.Value) + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: expected integer", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[1].(env.Integer); ok { - res1 = int(v.Value) + if vc, ok := res.Series.S[1].(env.Integer); ok { + res1 = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: expected integer", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[1]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -49031,16 +46929,16 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo return res0, res1 } default: - return nil, errors.New("context to test.WindowlessCanvas: context fn PixelCoordinateForPosition: expected function") + return nil, errors.New("context to test.WindowlessCanvas: context fn PixelCoordinateForPosition: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj23, ok := wordToObj["InteractiveArea"] + ctxObj23, ok := wordToObj["interactive-area"] if !ok { return nil, errors.New("context to test.WindowlessCanvas: expected context to have function InteractiveArea") } switch fn := ctxObj23.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to test.WindowlessCanvas: context fn InteractiveArea: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to test.WindowlessCanvas: context fn InteractiveArea: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_InteractiveArea = func(ctx env.RyeCtx) (fyne.Position, fyne.Size) { actualFn := fn @@ -49050,16 +46948,18 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo var res1 fyne.Size res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: expected block for multiple return values", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: expected block with 2 return values", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -49067,19 +46967,21 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo } switch v := res.Series.S[0].(type) { case env.Native: - var ok bool - res0, ok = v.Value.(fyne.Position) - if !ok { + if vc, ok := v.Value.(*fyne.Position); ok { + res0 = *vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: expected native of type fyne.Position", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected native of type *fyne.Position, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: expected native", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -49087,19 +46989,21 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo } switch v := res.Series.S[1].(type) { case env.Native: - var ok bool - res1, ok = v.Value.(fyne.Size) - if !ok { + if vc, ok := v.Value.(*fyne.Size); ok { + res1 = *vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: expected native of type fyne.Size", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected native of type *fyne.Size, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to test.WindowlessCanvas: arg 0: callback result: expected native", + "context to test.WindowlessCanvas: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -49108,7 +47012,7 @@ func ctxTo_test_WindowlessCanvas(ps *env.ProgramState, v env.RyeCtx) (test.Windo return res0, res1 } default: - return nil, errors.New("context to test.WindowlessCanvas: context fn InteractiveArea: expected function") + return nil, errors.New("context to test.WindowlessCanvas: context fn InteractiveArea: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -49140,14 +47044,14 @@ func ctxTo_widget_RichTextBlock(ps *env.ProgramState, v env.RyeCtx) (widget.Rich impl := &iface_widget_RichTextBlock{ self: v, } - ctxObj0, ok := wordToObj["Segments"] + ctxObj0, ok := wordToObj["segments"] if !ok { return nil, errors.New("context to widget.RichTextBlock: expected context to have function Segments") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to widget.RichTextBlock: context fn Segments: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to widget.RichTextBlock: context fn Segments: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Segments = func(ctx env.RyeCtx) []widget.RichTextSegment { actualFn := fn @@ -49163,19 +47067,21 @@ func ctxTo_widget_RichTextBlock(ps *env.ProgramState, v env.RyeCtx) (widget.Rich var err error res[i], err = ctxTo_widget_RichTextSegment(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to widget.RichTextBlock: arg 0: callback result: block item: "+err.Error()+"", + "context to widget.RichTextBlock: arg 0: callback result: "+"block item: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res[i], ok = v.Value.(widget.RichTextSegment) - if !ok { + if vc, ok := v.Value.(widget.RichTextSegment); ok { + res[i] = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to widget.RichTextBlock: arg 0: callback result: block item: expected native of type widget.RichTextSegment", + "context to widget.RichTextBlock: arg 0: callback result: "+"block item: "+"expected native of type widget.RichTextSegment, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -49183,8 +47089,9 @@ func ctxTo_widget_RichTextBlock(ps *env.ProgramState, v env.RyeCtx) (widget.Rich } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to widget.RichTextBlock: arg 0: callback result: block item: expected integer to be 0 or nil", + "context to widget.RichTextBlock: arg 0: callback result: "+"block item: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -49192,29 +47099,20 @@ func ctxTo_widget_RichTextBlock(ps *env.ProgramState, v env.RyeCtx) (widget.Rich } res[i] = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to widget.RichTextBlock: arg 0: callback result: block item: expected native", + "context to widget.RichTextBlock: arg 0: callback result: "+"block item: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } } - case env.Native: - var ok bool - res, ok = v.Value.([]widget.RichTextSegment) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to widget.RichTextBlock: arg 0: callback result: expected native of type []widget.RichTextSegment", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to widget.RichTextBlock: arg 0: callback result: expected integer to be 0 or nil", + "context to widget.RichTextBlock: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -49222,8 +47120,9 @@ func ctxTo_widget_RichTextBlock(ps *env.ProgramState, v env.RyeCtx) (widget.Rich } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to widget.RichTextBlock: arg 0: callback result: expected block, native or nil", + "context to widget.RichTextBlock: arg 0: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -49232,7 +47131,7 @@ func ctxTo_widget_RichTextBlock(ps *env.ProgramState, v env.RyeCtx) (widget.Rich return res } default: - return nil, errors.New("context to widget.RichTextBlock: context fn Segments: expected function") + return nil, errors.New("context to widget.RichTextBlock: context fn Segments: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -49288,25 +47187,26 @@ func ctxTo_widget_RichTextSegment(ps *env.ProgramState, v env.RyeCtx) (widget.Ri impl := &iface_widget_RichTextSegment{ self: v, } - ctxObj0, ok := wordToObj["Inline"] + ctxObj0, ok := wordToObj["inline"] if !ok { return nil, errors.New("context to widget.RichTextSegment: expected context to have function Inline") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to widget.RichTextSegment: context fn Inline: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to widget.RichTextSegment: context fn Inline: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Inline = func(ctx env.RyeCtx) bool { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res bool - if v, ok := ps.Res.(env.Integer); ok { - res = v.Value != 0 + if vc, ok := ps.Res.(env.Integer); ok { + res = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to widget.RichTextSegment: arg 0: callback result: expected integer", + "context to widget.RichTextSegment: arg 0: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -49315,27 +47215,28 @@ func ctxTo_widget_RichTextSegment(ps *env.ProgramState, v env.RyeCtx) (widget.Ri return res } default: - return nil, errors.New("context to widget.RichTextSegment: context fn Inline: expected function") + return nil, errors.New("context to widget.RichTextSegment: context fn Inline: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["Textual"] + ctxObj1, ok := wordToObj["textual"] if !ok { return nil, errors.New("context to widget.RichTextSegment: expected context to have function Textual") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to widget.RichTextSegment: context fn Textual: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to widget.RichTextSegment: context fn Textual: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Textual = func(ctx env.RyeCtx) string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to widget.RichTextSegment: arg 0: callback result: expected string", + "context to widget.RichTextSegment: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -49344,52 +47245,35 @@ func ctxTo_widget_RichTextSegment(ps *env.ProgramState, v env.RyeCtx) (widget.Ri return res } default: - return nil, errors.New("context to widget.RichTextSegment: context fn Textual: expected function") + return nil, errors.New("context to widget.RichTextSegment: context fn Textual: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj2, ok := wordToObj["Update"] + ctxObj2, ok := wordToObj["update"] if !ok { return nil, errors.New("context to widget.RichTextSegment: expected context to have function Update") } switch fn := ctxObj2.(type) { case env.Function: if fn.Argsn != 1 { - return nil, errors.New("context to widget.RichTextSegment: context fn Update: function has invalid number of arguments (expected 1)") + return nil, errors.New("context to widget.RichTextSegment: context fn Update: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Update = func(ctx env.RyeCtx, arg0 fyne.CanvasObject) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.CanvasObject)") - } - } + impl.fn_Update = func(ctx env.RyeCtx, farg0 fyne.CanvasObject) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.CanvasObject)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val) } default: - return nil, errors.New("context to widget.RichTextSegment: context fn Update: expected function") + return nil, errors.New("context to widget.RichTextSegment: context fn Update: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj3, ok := wordToObj["Visual"] + ctxObj3, ok := wordToObj["visual"] if !ok { return nil, errors.New("context to widget.RichTextSegment: expected context to have function Visual") } switch fn := ctxObj3.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to widget.RichTextSegment: context fn Visual: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to widget.RichTextSegment: context fn Visual: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Visual = func(ctx env.RyeCtx) fyne.CanvasObject { actualFn := fn @@ -49401,19 +47285,21 @@ func ctxTo_widget_RichTextSegment(ps *env.ProgramState, v env.RyeCtx) (widget.Ri var err error res, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to widget.RichTextSegment: arg 0: callback result: "+err.Error()+"", + "context to widget.RichTextSegment: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to widget.RichTextSegment: arg 0: callback result: expected native of type fyne.CanvasObject", + "context to widget.RichTextSegment: arg 0: callback result: "+"expected native of type fyne.CanvasObject, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -49421,8 +47307,9 @@ func ctxTo_widget_RichTextSegment(ps *env.ProgramState, v env.RyeCtx) (widget.Ri } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to widget.RichTextSegment: arg 0: callback result: expected integer to be 0 or nil", + "context to widget.RichTextSegment: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -49430,8 +47317,9 @@ func ctxTo_widget_RichTextSegment(ps *env.ProgramState, v env.RyeCtx) (widget.Ri } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to widget.RichTextSegment: arg 0: callback result: expected native", + "context to widget.RichTextSegment: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -49440,47 +47328,48 @@ func ctxTo_widget_RichTextSegment(ps *env.ProgramState, v env.RyeCtx) (widget.Ri return res } default: - return nil, errors.New("context to widget.RichTextSegment: context fn Visual: expected function") + return nil, errors.New("context to widget.RichTextSegment: context fn Visual: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj4, ok := wordToObj["Select"] + ctxObj4, ok := wordToObj["select"] if !ok { return nil, errors.New("context to widget.RichTextSegment: expected context to have function Select") } switch fn := ctxObj4.(type) { case env.Function: if fn.Argsn != 2 { - return nil, errors.New("context to widget.RichTextSegment: context fn Select: function has invalid number of arguments (expected 2)") + return nil, errors.New("context to widget.RichTextSegment: context fn Select: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - impl.fn_Select = func(ctx env.RyeCtx, arg0 fyne.Position, arg1 fyne.Position) { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewNative(ps.Idx, &arg0, "Go(*fyne.Position)") - arg1Val = *env.NewNative(ps.Idx, &arg1, "Go(*fyne.Position)") + impl.fn_Select = func(ctx env.RyeCtx, farg0 fyne.Position, farg1 fyne.Position) { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewNative(ps.Idx, &farg0, "Go(*fyne.Position)") + farg1Val = *env.NewNative(ps.Idx, &farg1, "Go(*fyne.Position)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, &ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, &ctx, farg0Val, farg1Val) } default: - return nil, errors.New("context to widget.RichTextSegment: context fn Select: expected function") + return nil, errors.New("context to widget.RichTextSegment: context fn Select: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj5, ok := wordToObj["SelectedText"] + ctxObj5, ok := wordToObj["selected-text"] if !ok { return nil, errors.New("context to widget.RichTextSegment: expected context to have function SelectedText") } switch fn := ctxObj5.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to widget.RichTextSegment: context fn SelectedText: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to widget.RichTextSegment: context fn SelectedText: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_SelectedText = func(ctx env.RyeCtx) string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, &ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to widget.RichTextSegment: arg 0: callback result: expected string", + "context to widget.RichTextSegment: arg 0: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -49489,16 +47378,16 @@ func ctxTo_widget_RichTextSegment(ps *env.ProgramState, v env.RyeCtx) (widget.Ri return res } default: - return nil, errors.New("context to widget.RichTextSegment: context fn SelectedText: expected function") + return nil, errors.New("context to widget.RichTextSegment: context fn SelectedText: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj6, ok := wordToObj["Unselect"] + ctxObj6, ok := wordToObj["unselect"] if !ok { return nil, errors.New("context to widget.RichTextSegment: expected context to have function Unselect") } switch fn := ctxObj6.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to widget.RichTextSegment: context fn Unselect: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to widget.RichTextSegment: context fn Unselect: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_Unselect = func(ctx env.RyeCtx) { actualFn := fn @@ -49506,7 +47395,7 @@ func ctxTo_widget_RichTextSegment(ps *env.ProgramState, v env.RyeCtx) (widget.Ri evaldo.CallFunctionArgsN(fn, ps, &ctx) } default: - return nil, errors.New("context to widget.RichTextSegment: context fn Unselect: expected function") + return nil, errors.New("context to widget.RichTextSegment: context fn Unselect: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -49542,14 +47431,14 @@ func ctxTo_widget_TextGridStyle(ps *env.ProgramState, v env.RyeCtx) (widget.Text impl := &iface_widget_TextGridStyle{ self: v, } - ctxObj0, ok := wordToObj["TextColor"] + ctxObj0, ok := wordToObj["text-color"] if !ok { return nil, errors.New("context to widget.TextGridStyle: expected context to have function TextColor") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to widget.TextGridStyle: context fn TextColor: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to widget.TextGridStyle: context fn TextColor: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_TextColor = func(ctx env.RyeCtx) color.Color { actualFn := fn @@ -49558,19 +47447,21 @@ func ctxTo_widget_TextGridStyle(ps *env.ProgramState, v env.RyeCtx) (widget.Text var res color.Color switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to widget.TextGridStyle: arg 0: callback result: expected native of type color.Color", + "context to widget.TextGridStyle: arg 0: callback result: "+"expected native of type color.Color, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to widget.TextGridStyle: arg 0: callback result: expected native", + "context to widget.TextGridStyle: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -49579,16 +47470,16 @@ func ctxTo_widget_TextGridStyle(ps *env.ProgramState, v env.RyeCtx) (widget.Text return res } default: - return nil, errors.New("context to widget.TextGridStyle: context fn TextColor: expected function") + return nil, errors.New("context to widget.TextGridStyle: context fn TextColor: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } - ctxObj1, ok := wordToObj["BackgroundColor"] + ctxObj1, ok := wordToObj["background-color"] if !ok { return nil, errors.New("context to widget.TextGridStyle: expected context to have function BackgroundColor") } switch fn := ctxObj1.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to widget.TextGridStyle: context fn BackgroundColor: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to widget.TextGridStyle: context fn BackgroundColor: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_BackgroundColor = func(ctx env.RyeCtx) color.Color { actualFn := fn @@ -49597,19 +47488,21 @@ func ctxTo_widget_TextGridStyle(ps *env.ProgramState, v env.RyeCtx) (widget.Text var res color.Color switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to widget.TextGridStyle: arg 0: callback result: expected native of type color.Color", + "context to widget.TextGridStyle: arg 0: callback result: "+"expected native of type color.Color, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to widget.TextGridStyle: arg 0: callback result: expected native", + "context to widget.TextGridStyle: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -49618,7 +47511,7 @@ func ctxTo_widget_TextGridStyle(ps *env.ProgramState, v env.RyeCtx) (widget.Text return res } default: - return nil, errors.New("context to widget.TextGridStyle: context fn BackgroundColor: expected function") + return nil, errors.New("context to widget.TextGridStyle: context fn BackgroundColor: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } @@ -49650,14 +47543,14 @@ func ctxTo_widget_ToolbarItem(ps *env.ProgramState, v env.RyeCtx) (widget.Toolba impl := &iface_widget_ToolbarItem{ self: v, } - ctxObj0, ok := wordToObj["ToolbarObject"] + ctxObj0, ok := wordToObj["toolbar-object"] if !ok { return nil, errors.New("context to widget.ToolbarItem: expected context to have function ToolbarObject") } switch fn := ctxObj0.(type) { case env.Function: if fn.Argsn != 0 { - return nil, errors.New("context to widget.ToolbarItem: context fn ToolbarObject: function has invalid number of arguments (expected 0)") + return nil, errors.New("context to widget.ToolbarItem: context fn ToolbarObject: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } impl.fn_ToolbarObject = func(ctx env.RyeCtx) fyne.CanvasObject { actualFn := fn @@ -49669,19 +47562,21 @@ func ctxTo_widget_ToolbarItem(ps *env.ProgramState, v env.RyeCtx) (widget.Toolba var err error res, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to widget.ToolbarItem: arg 0: callback result: "+err.Error()+"", + "context to widget.ToolbarItem: arg 0: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to widget.ToolbarItem: arg 0: callback result: expected native of type fyne.CanvasObject", + "context to widget.ToolbarItem: arg 0: callback result: "+"expected native of type fyne.CanvasObject, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -49689,8 +47584,9 @@ func ctxTo_widget_ToolbarItem(ps *env.ProgramState, v env.RyeCtx) (widget.Toolba } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to widget.ToolbarItem: arg 0: callback result: expected integer to be 0 or nil", + "context to widget.ToolbarItem: arg 0: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -49698,8 +47594,9 @@ func ctxTo_widget_ToolbarItem(ps *env.ProgramState, v env.RyeCtx) (widget.Toolba } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "context to widget.ToolbarItem: arg 0: callback result: expected native", + "context to widget.ToolbarItem: arg 0: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -49708,18 +47605,12 @@ func ctxTo_widget_ToolbarItem(ps *env.ProgramState, v env.RyeCtx) (widget.Toolba return res } default: - return nil, errors.New("context to widget.ToolbarItem: context fn ToolbarObject: expected function") + return nil, errors.New("context to widget.ToolbarItem: context fn ToolbarObject: " + "expected function, but got " + objectDebugString(ps.Idx, fn)) } return impl, nil } -var Builtins = map[string]*env.Builtin{ - "nil": { - Doc: "nil value for go types", - Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - return *env.NewInteger(0) - }, - }, +var builtinsGenerated = map[string]*env.Builtin{ "Go(*app.SettingsSchema)//cloud-config!": { Doc: "Set *app.SettingsSchema CloudConfig value", Argsn: 2, @@ -49727,28 +47618,30 @@ var Builtins = map[string]*env.Builtin{ var self *app.SettingsSchema switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*app.SettingsSchema) - if !ok { + if vc, ok := v.Value.(*app.SettingsSchema); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//cloud-config!: arg 1: expected native of type *app.SettingsSchema") + return env.NewError("Go(*app.SettingsSchema)//cloud-config!: arg 1: " + "expected native of type *app.SettingsSchema, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//cloud-config!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*app.SettingsSchema)//cloud-config!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//cloud-config!: arg 1: expected native") + return env.NewError("Go(*app.SettingsSchema)//cloud-config!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.CloudConfig = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//cloud-config!: arg 2: expected string") + return env.NewError("Go(*app.SettingsSchema)//cloud-config!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.CloudConfig = newVal return arg0 }, }, @@ -49759,21 +47652,21 @@ var Builtins = map[string]*env.Builtin{ var self *app.SettingsSchema switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*app.SettingsSchema) - if !ok { + if vc, ok := v.Value.(*app.SettingsSchema); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//cloud-config?: arg 1: expected native of type *app.SettingsSchema") + return env.NewError("Go(*app.SettingsSchema)//cloud-config?: arg 1: " + "expected native of type *app.SettingsSchema, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//cloud-config?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*app.SettingsSchema)//cloud-config?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//cloud-config?: arg 1: expected native") + return env.NewError("Go(*app.SettingsSchema)//cloud-config?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.CloudConfig) @@ -49787,28 +47680,30 @@ var Builtins = map[string]*env.Builtin{ var self *app.SettingsSchema switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*app.SettingsSchema) - if !ok { + if vc, ok := v.Value.(*app.SettingsSchema); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//cloud-name!: arg 1: expected native of type *app.SettingsSchema") + return env.NewError("Go(*app.SettingsSchema)//cloud-name!: arg 1: " + "expected native of type *app.SettingsSchema, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//cloud-name!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*app.SettingsSchema)//cloud-name!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//cloud-name!: arg 1: expected native") + return env.NewError("Go(*app.SettingsSchema)//cloud-name!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.CloudName = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//cloud-name!: arg 2: expected string") + return env.NewError("Go(*app.SettingsSchema)//cloud-name!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.CloudName = newVal return arg0 }, }, @@ -49819,21 +47714,21 @@ var Builtins = map[string]*env.Builtin{ var self *app.SettingsSchema switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*app.SettingsSchema) - if !ok { + if vc, ok := v.Value.(*app.SettingsSchema); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//cloud-name?: arg 1: expected native of type *app.SettingsSchema") + return env.NewError("Go(*app.SettingsSchema)//cloud-name?: arg 1: " + "expected native of type *app.SettingsSchema, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//cloud-name?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*app.SettingsSchema)//cloud-name?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//cloud-name?: arg 1: expected native") + return env.NewError("Go(*app.SettingsSchema)//cloud-name?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.CloudName) @@ -49847,28 +47742,30 @@ var Builtins = map[string]*env.Builtin{ var self *app.SettingsSchema switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*app.SettingsSchema) - if !ok { + if vc, ok := v.Value.(*app.SettingsSchema); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//disable-animations!: arg 1: expected native of type *app.SettingsSchema") + return env.NewError("Go(*app.SettingsSchema)//disable-animations!: arg 1: " + "expected native of type *app.SettingsSchema, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//disable-animations!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*app.SettingsSchema)//disable-animations!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//disable-animations!: arg 1: expected native") + return env.NewError("Go(*app.SettingsSchema)//disable-animations!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.DisableAnimations = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//disable-animations!: arg 2: expected integer") + return env.NewError("Go(*app.SettingsSchema)//disable-animations!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.DisableAnimations = newVal return arg0 }, }, @@ -49879,21 +47776,21 @@ var Builtins = map[string]*env.Builtin{ var self *app.SettingsSchema switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*app.SettingsSchema) - if !ok { + if vc, ok := v.Value.(*app.SettingsSchema); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//disable-animations?: arg 1: expected native of type *app.SettingsSchema") + return env.NewError("Go(*app.SettingsSchema)//disable-animations?: arg 1: " + "expected native of type *app.SettingsSchema, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//disable-animations?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*app.SettingsSchema)//disable-animations?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//disable-animations?: arg 1: expected native") + return env.NewError("Go(*app.SettingsSchema)//disable-animations?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.DisableAnimations)) @@ -49907,28 +47804,30 @@ var Builtins = map[string]*env.Builtin{ var self *app.SettingsSchema switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*app.SettingsSchema) - if !ok { + if vc, ok := v.Value.(*app.SettingsSchema); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//primary-color!: arg 1: expected native of type *app.SettingsSchema") + return env.NewError("Go(*app.SettingsSchema)//primary-color!: arg 1: " + "expected native of type *app.SettingsSchema, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//primary-color!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*app.SettingsSchema)//primary-color!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//primary-color!: arg 1: expected native") + return env.NewError("Go(*app.SettingsSchema)//primary-color!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.PrimaryColor = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//primary-color!: arg 2: expected string") + return env.NewError("Go(*app.SettingsSchema)//primary-color!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.PrimaryColor = newVal return arg0 }, }, @@ -49939,21 +47838,21 @@ var Builtins = map[string]*env.Builtin{ var self *app.SettingsSchema switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*app.SettingsSchema) - if !ok { + if vc, ok := v.Value.(*app.SettingsSchema); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//primary-color?: arg 1: expected native of type *app.SettingsSchema") + return env.NewError("Go(*app.SettingsSchema)//primary-color?: arg 1: " + "expected native of type *app.SettingsSchema, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//primary-color?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*app.SettingsSchema)//primary-color?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//primary-color?: arg 1: expected native") + return env.NewError("Go(*app.SettingsSchema)//primary-color?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.PrimaryColor) @@ -49967,28 +47866,30 @@ var Builtins = map[string]*env.Builtin{ var self *app.SettingsSchema switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*app.SettingsSchema) - if !ok { + if vc, ok := v.Value.(*app.SettingsSchema); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//scale!: arg 1: expected native of type *app.SettingsSchema") + return env.NewError("Go(*app.SettingsSchema)//scale!: arg 1: " + "expected native of type *app.SettingsSchema, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//scale!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*app.SettingsSchema)//scale!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//scale!: arg 1: expected native") + return env.NewError("Go(*app.SettingsSchema)//scale!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Decimal); ok { - self.Scale = float32(v.Value) + var newVal float32 + if vc, ok := arg1.(env.Decimal); ok { + newVal = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//scale!: arg 2: expected decimal") + return env.NewError("Go(*app.SettingsSchema)//scale!: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } + self.Scale = newVal return arg0 }, }, @@ -49999,21 +47900,21 @@ var Builtins = map[string]*env.Builtin{ var self *app.SettingsSchema switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*app.SettingsSchema) - if !ok { + if vc, ok := v.Value.(*app.SettingsSchema); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//scale?: arg 1: expected native of type *app.SettingsSchema") + return env.NewError("Go(*app.SettingsSchema)//scale?: arg 1: " + "expected native of type *app.SettingsSchema, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//scale?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*app.SettingsSchema)//scale?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//scale?: arg 1: expected native") + return env.NewError("Go(*app.SettingsSchema)//scale?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewDecimal(float64(self.Scale)) @@ -50027,21 +47928,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *app.SettingsSchema switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*app.SettingsSchema) - if !ok { + if vc, ok := v.Value.(*app.SettingsSchema); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//storage-path: arg 1: expected native of type *app.SettingsSchema") + return env.NewError("Go(*app.SettingsSchema)//storage-path: arg 1: " + "expected native of type *app.SettingsSchema, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//storage-path: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*app.SettingsSchema)//storage-path: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//storage-path: arg 1: expected native") + return env.NewError("Go(*app.SettingsSchema)//storage-path: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.StoragePath() var res0Obj env.Object @@ -50056,28 +47957,30 @@ var Builtins = map[string]*env.Builtin{ var self *app.SettingsSchema switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*app.SettingsSchema) - if !ok { + if vc, ok := v.Value.(*app.SettingsSchema); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//theme-name!: arg 1: expected native of type *app.SettingsSchema") + return env.NewError("Go(*app.SettingsSchema)//theme-name!: arg 1: " + "expected native of type *app.SettingsSchema, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//theme-name!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*app.SettingsSchema)//theme-name!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//theme-name!: arg 1: expected native") + return env.NewError("Go(*app.SettingsSchema)//theme-name!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.ThemeName = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//theme-name!: arg 2: expected string") + return env.NewError("Go(*app.SettingsSchema)//theme-name!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.ThemeName = newVal return arg0 }, }, @@ -50088,21 +47991,21 @@ var Builtins = map[string]*env.Builtin{ var self *app.SettingsSchema switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*app.SettingsSchema) - if !ok { + if vc, ok := v.Value.(*app.SettingsSchema); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//theme-name?: arg 1: expected native of type *app.SettingsSchema") + return env.NewError("Go(*app.SettingsSchema)//theme-name?: arg 1: " + "expected native of type *app.SettingsSchema, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//theme-name?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*app.SettingsSchema)//theme-name?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*app.SettingsSchema)//theme-name?: arg 1: expected native") + return env.NewError("Go(*app.SettingsSchema)//theme-name?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.ThemeName) @@ -50116,34 +48019,36 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Circle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Circle) - if !ok { + if vc, ok := v.Value.(*canvas.Circle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//fill-color!: arg 1: expected native of type *canvas.Circle") + return env.NewError("Go(*canvas.Circle)//fill-color!: arg 1: " + "expected native of type *canvas.Circle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//fill-color!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Circle)//fill-color!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//fill-color!: arg 1: expected native") + return env.NewError("Go(*canvas.Circle)//fill-color!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal color.Color switch v := arg1.(type) { case env.Native: - var ok bool - self.FillColor, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//fill-color!: arg 2: expected native of type color.Color") + return env.NewError("Go(*canvas.Circle)//fill-color!: arg 2: " + "expected native of type color.Color, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//fill-color!: arg 2: expected native") + return env.NewError("Go(*canvas.Circle)//fill-color!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.FillColor = newVal return arg0 }, }, @@ -50154,21 +48059,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Circle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Circle) - if !ok { + if vc, ok := v.Value.(*canvas.Circle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//fill-color?: arg 1: expected native of type *canvas.Circle") + return env.NewError("Go(*canvas.Circle)//fill-color?: arg 1: " + "expected native of type *canvas.Circle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//fill-color?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Circle)//fill-color?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//fill-color?: arg 1: expected native") + return env.NewError("Go(*canvas.Circle)//fill-color?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, self.FillColor, "Go(color.Color)") @@ -50182,28 +48087,30 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Circle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Circle) - if !ok { + if vc, ok := v.Value.(*canvas.Circle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//hidden!: arg 1: expected native of type *canvas.Circle") + return env.NewError("Go(*canvas.Circle)//hidden!: arg 1: " + "expected native of type *canvas.Circle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Circle)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//hidden!: arg 1: expected native") + return env.NewError("Go(*canvas.Circle)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//hidden!: arg 2: expected integer") + return env.NewError("Go(*canvas.Circle)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -50214,21 +48121,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Circle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Circle) - if !ok { + if vc, ok := v.Value.(*canvas.Circle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//hidden?: arg 1: expected native of type *canvas.Circle") + return env.NewError("Go(*canvas.Circle)//hidden?: arg 1: " + "expected native of type *canvas.Circle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Circle)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//hidden?: arg 1: expected native") + return env.NewError("Go(*canvas.Circle)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -50242,21 +48149,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Circle switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Circle) - if !ok { + if vc, ok := v.Value.(*canvas.Circle); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//hide: arg 1: expected native of type *canvas.Circle") + return env.NewError("Go(*canvas.Circle)//hide: arg 1: " + "expected native of type *canvas.Circle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Circle)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//hide: arg 1: expected native") + return env.NewError("Go(*canvas.Circle)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -50269,21 +48176,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Circle switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Circle) - if !ok { + if vc, ok := v.Value.(*canvas.Circle); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//min-size: arg 1: expected native of type *canvas.Circle") + return env.NewError("Go(*canvas.Circle)//min-size: arg 1: " + "expected native of type *canvas.Circle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Circle)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//min-size: arg 1: expected native") + return env.NewError("Go(*canvas.Circle)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -50298,42 +48205,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Circle switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Circle) - if !ok { + if vc, ok := v.Value.(*canvas.Circle); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//move: arg 1: expected native of type *canvas.Circle") + return env.NewError("Go(*canvas.Circle)//move: arg 1: " + "expected native of type *canvas.Circle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Circle)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//move: arg 1: expected native") + return env.NewError("Go(*canvas.Circle)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Circle)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//move: arg 2: expected native") + return env.NewError("Go(*canvas.Circle)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -50344,21 +48245,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Circle switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Circle) - if !ok { + if vc, ok := v.Value.(*canvas.Circle); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//position: arg 1: expected native of type *canvas.Circle") + return env.NewError("Go(*canvas.Circle)//position: arg 1: " + "expected native of type *canvas.Circle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Circle)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//position: arg 1: expected native") + return env.NewError("Go(*canvas.Circle)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -50373,34 +48274,42 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Circle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Circle) - if !ok { + if vc, ok := v.Value.(*canvas.Circle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//position-1!: arg 1: expected native of type *canvas.Circle") + return env.NewError("Go(*canvas.Circle)//position-1!: arg 1: " + "expected native of type *canvas.Circle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//position-1!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Circle)//position-1!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//position-1!: arg 1: expected native") + return env.NewError("Go(*canvas.Circle)//position-1!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal *fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - self.Position1, ok = v.Value.(fyne.Position) - if !ok { + if vc, ok := v.Value.(*fyne.Position); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*canvas.Circle)//position-1!: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//position-1!: arg 2: expected native of type fyne.Position") + return env.NewError("Go(*canvas.Circle)//position-1!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//position-1!: arg 2: expected native") + return env.NewError("Go(*canvas.Circle)//position-1!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Position1 = *newVal return arg0 }, }, @@ -50411,21 +48320,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Circle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Circle) - if !ok { + if vc, ok := v.Value.(*canvas.Circle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//position-1?: arg 1: expected native of type *canvas.Circle") + return env.NewError("Go(*canvas.Circle)//position-1?: arg 1: " + "expected native of type *canvas.Circle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//position-1?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Circle)//position-1?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//position-1?: arg 1: expected native") + return env.NewError("Go(*canvas.Circle)//position-1?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, &self.Position1, "Go(*fyne.Position)") @@ -50439,34 +48348,42 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Circle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Circle) - if !ok { + if vc, ok := v.Value.(*canvas.Circle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//position-2!: arg 1: expected native of type *canvas.Circle") + return env.NewError("Go(*canvas.Circle)//position-2!: arg 1: " + "expected native of type *canvas.Circle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//position-2!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Circle)//position-2!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//position-2!: arg 1: expected native") + return env.NewError("Go(*canvas.Circle)//position-2!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal *fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - self.Position2, ok = v.Value.(fyne.Position) - if !ok { + if vc, ok := v.Value.(*fyne.Position); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*canvas.Circle)//position-2!: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//position-2!: arg 2: expected native of type fyne.Position") + return env.NewError("Go(*canvas.Circle)//position-2!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//position-2!: arg 2: expected native") + return env.NewError("Go(*canvas.Circle)//position-2!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Position2 = *newVal return arg0 }, }, @@ -50477,21 +48394,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Circle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Circle) - if !ok { + if vc, ok := v.Value.(*canvas.Circle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//position-2?: arg 1: expected native of type *canvas.Circle") + return env.NewError("Go(*canvas.Circle)//position-2?: arg 1: " + "expected native of type *canvas.Circle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//position-2?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Circle)//position-2?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//position-2?: arg 1: expected native") + return env.NewError("Go(*canvas.Circle)//position-2?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, &self.Position2, "Go(*fyne.Position)") @@ -50505,21 +48422,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Circle switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Circle) - if !ok { + if vc, ok := v.Value.(*canvas.Circle); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//refresh: arg 1: expected native of type *canvas.Circle") + return env.NewError("Go(*canvas.Circle)//refresh: arg 1: " + "expected native of type *canvas.Circle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Circle)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//refresh: arg 1: expected native") + return env.NewError("Go(*canvas.Circle)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -50532,42 +48449,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Circle switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Circle) - if !ok { + if vc, ok := v.Value.(*canvas.Circle); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//resize: arg 1: expected native of type *canvas.Circle") + return env.NewError("Go(*canvas.Circle)//resize: arg 1: " + "expected native of type *canvas.Circle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Circle)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//resize: arg 1: expected native") + return env.NewError("Go(*canvas.Circle)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Circle)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//resize: arg 2: expected native") + return env.NewError("Go(*canvas.Circle)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -50578,21 +48489,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Circle switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Circle) - if !ok { + if vc, ok := v.Value.(*canvas.Circle); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//show: arg 1: expected native of type *canvas.Circle") + return env.NewError("Go(*canvas.Circle)//show: arg 1: " + "expected native of type *canvas.Circle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Circle)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//show: arg 1: expected native") + return env.NewError("Go(*canvas.Circle)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -50605,21 +48516,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Circle switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Circle) - if !ok { + if vc, ok := v.Value.(*canvas.Circle); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//size: arg 1: expected native of type *canvas.Circle") + return env.NewError("Go(*canvas.Circle)//size: arg 1: " + "expected native of type *canvas.Circle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Circle)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//size: arg 1: expected native") + return env.NewError("Go(*canvas.Circle)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -50634,34 +48545,36 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Circle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Circle) - if !ok { + if vc, ok := v.Value.(*canvas.Circle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//stroke-color!: arg 1: expected native of type *canvas.Circle") + return env.NewError("Go(*canvas.Circle)//stroke-color!: arg 1: " + "expected native of type *canvas.Circle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//stroke-color!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Circle)//stroke-color!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//stroke-color!: arg 1: expected native") + return env.NewError("Go(*canvas.Circle)//stroke-color!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal color.Color switch v := arg1.(type) { case env.Native: - var ok bool - self.StrokeColor, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//stroke-color!: arg 2: expected native of type color.Color") + return env.NewError("Go(*canvas.Circle)//stroke-color!: arg 2: " + "expected native of type color.Color, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//stroke-color!: arg 2: expected native") + return env.NewError("Go(*canvas.Circle)//stroke-color!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.StrokeColor = newVal return arg0 }, }, @@ -50672,21 +48585,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Circle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Circle) - if !ok { + if vc, ok := v.Value.(*canvas.Circle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//stroke-color?: arg 1: expected native of type *canvas.Circle") + return env.NewError("Go(*canvas.Circle)//stroke-color?: arg 1: " + "expected native of type *canvas.Circle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//stroke-color?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Circle)//stroke-color?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//stroke-color?: arg 1: expected native") + return env.NewError("Go(*canvas.Circle)//stroke-color?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, self.StrokeColor, "Go(color.Color)") @@ -50700,28 +48613,30 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Circle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Circle) - if !ok { + if vc, ok := v.Value.(*canvas.Circle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//stroke-width!: arg 1: expected native of type *canvas.Circle") + return env.NewError("Go(*canvas.Circle)//stroke-width!: arg 1: " + "expected native of type *canvas.Circle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//stroke-width!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Circle)//stroke-width!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//stroke-width!: arg 1: expected native") + return env.NewError("Go(*canvas.Circle)//stroke-width!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Decimal); ok { - self.StrokeWidth = float32(v.Value) + var newVal float32 + if vc, ok := arg1.(env.Decimal); ok { + newVal = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//stroke-width!: arg 2: expected decimal") + return env.NewError("Go(*canvas.Circle)//stroke-width!: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } + self.StrokeWidth = newVal return arg0 }, }, @@ -50732,21 +48647,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Circle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Circle) - if !ok { + if vc, ok := v.Value.(*canvas.Circle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//stroke-width?: arg 1: expected native of type *canvas.Circle") + return env.NewError("Go(*canvas.Circle)//stroke-width?: arg 1: " + "expected native of type *canvas.Circle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//stroke-width?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Circle)//stroke-width?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//stroke-width?: arg 1: expected native") + return env.NewError("Go(*canvas.Circle)//stroke-width?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewDecimal(float64(self.StrokeWidth)) @@ -50760,21 +48675,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Circle switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Circle) - if !ok { + if vc, ok := v.Value.(*canvas.Circle); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//visible: arg 1: expected native of type *canvas.Circle") + return env.NewError("Go(*canvas.Circle)//visible: arg 1: " + "expected native of type *canvas.Circle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Circle)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Circle)//visible: arg 1: expected native") + return env.NewError("Go(*canvas.Circle)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -50789,21 +48704,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Image switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Image) - if !ok { + if vc, ok := v.Value.(*canvas.Image); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//alpha: arg 1: expected native of type *canvas.Image") + return env.NewError("Go(*canvas.Image)//alpha: arg 1: " + "expected native of type *canvas.Image, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//alpha: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Image)//alpha: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//alpha: arg 1: expected native") + return env.NewError("Go(*canvas.Image)//alpha: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Alpha() var res0Obj env.Object @@ -50818,21 +48733,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Image switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Image) - if !ok { + if vc, ok := v.Value.(*canvas.Image); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//aspect: arg 1: expected native of type *canvas.Image") + return env.NewError("Go(*canvas.Image)//aspect: arg 1: " + "expected native of type *canvas.Image, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//aspect: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Image)//aspect: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//aspect: arg 1: expected native") + return env.NewError("Go(*canvas.Image)//aspect: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Aspect() var res0Obj env.Object @@ -50847,28 +48762,30 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Image switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Image) - if !ok { + if vc, ok := v.Value.(*canvas.Image); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//file!: arg 1: expected native of type *canvas.Image") + return env.NewError("Go(*canvas.Image)//file!: arg 1: " + "expected native of type *canvas.Image, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//file!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Image)//file!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//file!: arg 1: expected native") + return env.NewError("Go(*canvas.Image)//file!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.File = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//file!: arg 2: expected string") + return env.NewError("Go(*canvas.Image)//file!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.File = newVal return arg0 }, }, @@ -50879,21 +48796,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Image switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Image) - if !ok { + if vc, ok := v.Value.(*canvas.Image); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//file?: arg 1: expected native of type *canvas.Image") + return env.NewError("Go(*canvas.Image)//file?: arg 1: " + "expected native of type *canvas.Image, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//file?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Image)//file?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//file?: arg 1: expected native") + return env.NewError("Go(*canvas.Image)//file?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.File) @@ -50907,22 +48824,23 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Image switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Image) - if !ok { + if vc, ok := v.Value.(*canvas.Image); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//fill-mode!: arg 1: expected native of type *canvas.Image") + return env.NewError("Go(*canvas.Image)//fill-mode!: arg 1: " + "expected native of type *canvas.Image, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//fill-mode!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Image)//fill-mode!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//fill-mode!: arg 1: expected native") + return env.NewError("Go(*canvas.Image)//fill-mode!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal canvas.ImageFill { nat, natOk := arg1.(env.Native) var natValOk bool @@ -50931,18 +48849,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(canvas.ImageFill) } if natValOk { - self.FillMode = natVal + newVal = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//fill-mode!: arg 2: expected integer") + return env.NewError("Go(*canvas.Image)//fill-mode!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } - self.FillMode = canvas.ImageFill(u) + newVal = canvas.ImageFill(u) } } + self.FillMode = newVal return arg0 }, }, @@ -50953,21 +48872,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Image switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Image) - if !ok { + if vc, ok := v.Value.(*canvas.Image); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//fill-mode?: arg 1: expected native of type *canvas.Image") + return env.NewError("Go(*canvas.Image)//fill-mode?: arg 1: " + "expected native of type *canvas.Image, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//fill-mode?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Image)//fill-mode?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//fill-mode?: arg 1: expected native") + return env.NewError("Go(*canvas.Image)//fill-mode?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(int(self.FillMode))) @@ -50981,21 +48900,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Image switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Image) - if !ok { + if vc, ok := v.Value.(*canvas.Image); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//hide: arg 1: expected native of type *canvas.Image") + return env.NewError("Go(*canvas.Image)//hide: arg 1: " + "expected native of type *canvas.Image, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Image)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//hide: arg 1: expected native") + return env.NewError("Go(*canvas.Image)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -51008,34 +48927,36 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Image switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Image) - if !ok { + if vc, ok := v.Value.(*canvas.Image); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//image!: arg 1: expected native of type *canvas.Image") + return env.NewError("Go(*canvas.Image)//image!: arg 1: " + "expected native of type *canvas.Image, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//image!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Image)//image!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//image!: arg 1: expected native") + return env.NewError("Go(*canvas.Image)//image!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal image.Image switch v := arg1.(type) { case env.Native: - var ok bool - self.Image, ok = v.Value.(image.Image) - if !ok { + if vc, ok := v.Value.(image.Image); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//image!: arg 2: expected native of type image.Image") + return env.NewError("Go(*canvas.Image)//image!: arg 2: " + "expected native of type image.Image, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//image!: arg 2: expected native") + return env.NewError("Go(*canvas.Image)//image!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Image = newVal return arg0 }, }, @@ -51046,21 +48967,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Image switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Image) - if !ok { + if vc, ok := v.Value.(*canvas.Image); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//image?: arg 1: expected native of type *canvas.Image") + return env.NewError("Go(*canvas.Image)//image?: arg 1: " + "expected native of type *canvas.Image, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//image?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Image)//image?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//image?: arg 1: expected native") + return env.NewError("Go(*canvas.Image)//image?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, self.Image, "Go(image.Image)") @@ -51074,21 +48995,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Image switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Image) - if !ok { + if vc, ok := v.Value.(*canvas.Image); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//min-size: arg 1: expected native of type *canvas.Image") + return env.NewError("Go(*canvas.Image)//min-size: arg 1: " + "expected native of type *canvas.Image, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Image)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//min-size: arg 1: expected native") + return env.NewError("Go(*canvas.Image)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -51103,42 +49024,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Image switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Image) - if !ok { + if vc, ok := v.Value.(*canvas.Image); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//move: arg 1: expected native of type *canvas.Image") + return env.NewError("Go(*canvas.Image)//move: arg 1: " + "expected native of type *canvas.Image, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Image)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//move: arg 1: expected native") + return env.NewError("Go(*canvas.Image)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Image)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//move: arg 2: expected native") + return env.NewError("Go(*canvas.Image)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -51149,21 +49064,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Image switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Image) - if !ok { + if vc, ok := v.Value.(*canvas.Image); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//refresh: arg 1: expected native of type *canvas.Image") + return env.NewError("Go(*canvas.Image)//refresh: arg 1: " + "expected native of type *canvas.Image, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Image)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//refresh: arg 1: expected native") + return env.NewError("Go(*canvas.Image)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -51176,42 +49091,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Image switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Image) - if !ok { + if vc, ok := v.Value.(*canvas.Image); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//resize: arg 1: expected native of type *canvas.Image") + return env.NewError("Go(*canvas.Image)//resize: arg 1: " + "expected native of type *canvas.Image, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Image)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//resize: arg 1: expected native") + return env.NewError("Go(*canvas.Image)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Image)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//resize: arg 2: expected native") + return env.NewError("Go(*canvas.Image)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -51222,47 +49131,49 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Image switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Image) - if !ok { + if vc, ok := v.Value.(*canvas.Image); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//resource!: arg 1: expected native of type *canvas.Image") + return env.NewError("Go(*canvas.Image)//resource!: arg 1: " + "expected native of type *canvas.Image, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//resource!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Image)//resource!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//resource!: arg 1: expected native") + return env.NewError("Go(*canvas.Image)//resource!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.Resource switch v := arg1.(type) { case env.RyeCtx: var err error - self.Resource, err = ctxTo_fyne_Resource(ps, v) + newVal, err = ctxTo_fyne_Resource(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//resource!: arg 2: " + err.Error() + "") + return env.NewError("Go(*canvas.Image)//resource!: arg 2: " + err.Error()) } case env.Native: - var ok bool - self.Resource, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//resource!: arg 2: expected native of type fyne.Resource") + return env.NewError("Go(*canvas.Image)//resource!: arg 2: " + "expected native of type fyne.Resource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//resource!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Image)//resource!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Resource = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//resource!: arg 2: expected native") + return env.NewError("Go(*canvas.Image)//resource!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Resource = newVal return arg0 }, }, @@ -51273,41 +49184,24 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Image switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Image) - if !ok { + if vc, ok := v.Value.(*canvas.Image); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//resource?: arg 1: expected native of type *canvas.Image") + return env.NewError("Go(*canvas.Image)//resource?: arg 1: " + "expected native of type *canvas.Image, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//resource?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Image)//resource?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//resource?: arg 1: expected native") + return env.NewError("Go(*canvas.Image)//resource?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - { - typ := reflect.TypeOf(self.Resource) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - resObj = *env.NewNative(ps.Idx, self.Resource, typRyeName) - } else { - resObj = *env.NewNative(ps.Idx, self.Resource, "Go(fyne.Resource)") - } - } + resObj = ifaceToNative(ps.Idx, self.Resource, "Go(fyne.Resource)") return resObj }, }, @@ -51318,22 +49212,23 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Image switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Image) - if !ok { + if vc, ok := v.Value.(*canvas.Image); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//scale-mode!: arg 1: expected native of type *canvas.Image") + return env.NewError("Go(*canvas.Image)//scale-mode!: arg 1: " + "expected native of type *canvas.Image, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//scale-mode!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Image)//scale-mode!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//scale-mode!: arg 1: expected native") + return env.NewError("Go(*canvas.Image)//scale-mode!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal canvas.ImageScale { nat, natOk := arg1.(env.Native) var natValOk bool @@ -51342,18 +49237,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(canvas.ImageScale) } if natValOk { - self.ScaleMode = natVal + newVal = natVal } else { var u int32 - if v, ok := arg1.(env.Integer); ok { - u = int32(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//scale-mode!: arg 2: expected integer") + return env.NewError("Go(*canvas.Image)//scale-mode!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } - self.ScaleMode = canvas.ImageScale(u) + newVal = canvas.ImageScale(u) } } + self.ScaleMode = newVal return arg0 }, }, @@ -51364,21 +49260,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Image switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Image) - if !ok { + if vc, ok := v.Value.(*canvas.Image); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//scale-mode?: arg 1: expected native of type *canvas.Image") + return env.NewError("Go(*canvas.Image)//scale-mode?: arg 1: " + "expected native of type *canvas.Image, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//scale-mode?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Image)//scale-mode?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//scale-mode?: arg 1: expected native") + return env.NewError("Go(*canvas.Image)//scale-mode?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(int32(self.ScaleMode))) @@ -51392,28 +49288,30 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Image switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Image) - if !ok { + if vc, ok := v.Value.(*canvas.Image); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//translucency!: arg 1: expected native of type *canvas.Image") + return env.NewError("Go(*canvas.Image)//translucency!: arg 1: " + "expected native of type *canvas.Image, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//translucency!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Image)//translucency!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//translucency!: arg 1: expected native") + return env.NewError("Go(*canvas.Image)//translucency!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Decimal); ok { - self.Translucency = float64(v.Value) + var newVal float64 + if vc, ok := arg1.(env.Decimal); ok { + newVal = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//translucency!: arg 2: expected decimal") + return env.NewError("Go(*canvas.Image)//translucency!: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } + self.Translucency = newVal return arg0 }, }, @@ -51424,21 +49322,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Image switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Image) - if !ok { + if vc, ok := v.Value.(*canvas.Image); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//translucency?: arg 1: expected native of type *canvas.Image") + return env.NewError("Go(*canvas.Image)//translucency?: arg 1: " + "expected native of type *canvas.Image, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//translucency?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Image)//translucency?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Image)//translucency?: arg 1: expected native") + return env.NewError("Go(*canvas.Image)//translucency?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewDecimal(float64(self.Translucency)) @@ -51452,28 +49350,30 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Line switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Line) - if !ok { + if vc, ok := v.Value.(*canvas.Line); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//hidden!: arg 1: expected native of type *canvas.Line") + return env.NewError("Go(*canvas.Line)//hidden!: arg 1: " + "expected native of type *canvas.Line, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Line)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//hidden!: arg 1: expected native") + return env.NewError("Go(*canvas.Line)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//hidden!: arg 2: expected integer") + return env.NewError("Go(*canvas.Line)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -51484,21 +49384,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Line switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Line) - if !ok { + if vc, ok := v.Value.(*canvas.Line); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//hidden?: arg 1: expected native of type *canvas.Line") + return env.NewError("Go(*canvas.Line)//hidden?: arg 1: " + "expected native of type *canvas.Line, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Line)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//hidden?: arg 1: expected native") + return env.NewError("Go(*canvas.Line)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -51512,21 +49412,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Line switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Line) - if !ok { + if vc, ok := v.Value.(*canvas.Line); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//hide: arg 1: expected native of type *canvas.Line") + return env.NewError("Go(*canvas.Line)//hide: arg 1: " + "expected native of type *canvas.Line, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Line)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//hide: arg 1: expected native") + return env.NewError("Go(*canvas.Line)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -51539,21 +49439,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Line switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Line) - if !ok { + if vc, ok := v.Value.(*canvas.Line); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//min-size: arg 1: expected native of type *canvas.Line") + return env.NewError("Go(*canvas.Line)//min-size: arg 1: " + "expected native of type *canvas.Line, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Line)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//min-size: arg 1: expected native") + return env.NewError("Go(*canvas.Line)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -51568,42 +49468,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Line switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Line) - if !ok { + if vc, ok := v.Value.(*canvas.Line); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//move: arg 1: expected native of type *canvas.Line") + return env.NewError("Go(*canvas.Line)//move: arg 1: " + "expected native of type *canvas.Line, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Line)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//move: arg 1: expected native") + return env.NewError("Go(*canvas.Line)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Line)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//move: arg 2: expected native") + return env.NewError("Go(*canvas.Line)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -51614,21 +49508,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Line switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Line) - if !ok { + if vc, ok := v.Value.(*canvas.Line); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//position: arg 1: expected native of type *canvas.Line") + return env.NewError("Go(*canvas.Line)//position: arg 1: " + "expected native of type *canvas.Line, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Line)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//position: arg 1: expected native") + return env.NewError("Go(*canvas.Line)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -51643,34 +49537,42 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Line switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Line) - if !ok { + if vc, ok := v.Value.(*canvas.Line); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//position-1!: arg 1: expected native of type *canvas.Line") + return env.NewError("Go(*canvas.Line)//position-1!: arg 1: " + "expected native of type *canvas.Line, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//position-1!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Line)//position-1!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//position-1!: arg 1: expected native") + return env.NewError("Go(*canvas.Line)//position-1!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal *fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - self.Position1, ok = v.Value.(fyne.Position) - if !ok { + if vc, ok := v.Value.(*fyne.Position); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//position-1!: arg 2: expected native of type fyne.Position") + return env.NewError("Go(*canvas.Line)//position-1!: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*canvas.Line)//position-1!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//position-1!: arg 2: expected native") + return env.NewError("Go(*canvas.Line)//position-1!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Position1 = *newVal return arg0 }, }, @@ -51681,21 +49583,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Line switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Line) - if !ok { + if vc, ok := v.Value.(*canvas.Line); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//position-1?: arg 1: expected native of type *canvas.Line") + return env.NewError("Go(*canvas.Line)//position-1?: arg 1: " + "expected native of type *canvas.Line, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//position-1?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Line)//position-1?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//position-1?: arg 1: expected native") + return env.NewError("Go(*canvas.Line)//position-1?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, &self.Position1, "Go(*fyne.Position)") @@ -51709,34 +49611,42 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Line switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Line) - if !ok { + if vc, ok := v.Value.(*canvas.Line); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//position-2!: arg 1: expected native of type *canvas.Line") + return env.NewError("Go(*canvas.Line)//position-2!: arg 1: " + "expected native of type *canvas.Line, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//position-2!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Line)//position-2!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//position-2!: arg 1: expected native") + return env.NewError("Go(*canvas.Line)//position-2!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal *fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - self.Position2, ok = v.Value.(fyne.Position) - if !ok { + if vc, ok := v.Value.(*fyne.Position); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*canvas.Line)//position-2!: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//position-2!: arg 2: expected native of type fyne.Position") + return env.NewError("Go(*canvas.Line)//position-2!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//position-2!: arg 2: expected native") + return env.NewError("Go(*canvas.Line)//position-2!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Position2 = *newVal return arg0 }, }, @@ -51747,21 +49657,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Line switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Line) - if !ok { + if vc, ok := v.Value.(*canvas.Line); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//position-2?: arg 1: expected native of type *canvas.Line") + return env.NewError("Go(*canvas.Line)//position-2?: arg 1: " + "expected native of type *canvas.Line, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//position-2?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Line)//position-2?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//position-2?: arg 1: expected native") + return env.NewError("Go(*canvas.Line)//position-2?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, &self.Position2, "Go(*fyne.Position)") @@ -51775,21 +49685,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Line switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Line) - if !ok { + if vc, ok := v.Value.(*canvas.Line); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//refresh: arg 1: expected native of type *canvas.Line") + return env.NewError("Go(*canvas.Line)//refresh: arg 1: " + "expected native of type *canvas.Line, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Line)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//refresh: arg 1: expected native") + return env.NewError("Go(*canvas.Line)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -51802,42 +49712,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Line switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Line) - if !ok { + if vc, ok := v.Value.(*canvas.Line); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//resize: arg 1: expected native of type *canvas.Line") + return env.NewError("Go(*canvas.Line)//resize: arg 1: " + "expected native of type *canvas.Line, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Line)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//resize: arg 1: expected native") + return env.NewError("Go(*canvas.Line)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Line)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//resize: arg 2: expected native") + return env.NewError("Go(*canvas.Line)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -51848,21 +49752,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Line switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Line) - if !ok { + if vc, ok := v.Value.(*canvas.Line); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//show: arg 1: expected native of type *canvas.Line") + return env.NewError("Go(*canvas.Line)//show: arg 1: " + "expected native of type *canvas.Line, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Line)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//show: arg 1: expected native") + return env.NewError("Go(*canvas.Line)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -51875,21 +49779,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Line switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Line) - if !ok { + if vc, ok := v.Value.(*canvas.Line); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//size: arg 1: expected native of type *canvas.Line") + return env.NewError("Go(*canvas.Line)//size: arg 1: " + "expected native of type *canvas.Line, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Line)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//size: arg 1: expected native") + return env.NewError("Go(*canvas.Line)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -51904,34 +49808,36 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Line switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Line) - if !ok { + if vc, ok := v.Value.(*canvas.Line); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//stroke-color!: arg 1: expected native of type *canvas.Line") + return env.NewError("Go(*canvas.Line)//stroke-color!: arg 1: " + "expected native of type *canvas.Line, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//stroke-color!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Line)//stroke-color!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//stroke-color!: arg 1: expected native") + return env.NewError("Go(*canvas.Line)//stroke-color!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal color.Color switch v := arg1.(type) { case env.Native: - var ok bool - self.StrokeColor, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//stroke-color!: arg 2: expected native of type color.Color") + return env.NewError("Go(*canvas.Line)//stroke-color!: arg 2: " + "expected native of type color.Color, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//stroke-color!: arg 2: expected native") + return env.NewError("Go(*canvas.Line)//stroke-color!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.StrokeColor = newVal return arg0 }, }, @@ -51942,21 +49848,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Line switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Line) - if !ok { + if vc, ok := v.Value.(*canvas.Line); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//stroke-color?: arg 1: expected native of type *canvas.Line") + return env.NewError("Go(*canvas.Line)//stroke-color?: arg 1: " + "expected native of type *canvas.Line, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//stroke-color?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Line)//stroke-color?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//stroke-color?: arg 1: expected native") + return env.NewError("Go(*canvas.Line)//stroke-color?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, self.StrokeColor, "Go(color.Color)") @@ -51970,28 +49876,30 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Line switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Line) - if !ok { + if vc, ok := v.Value.(*canvas.Line); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//stroke-width!: arg 1: expected native of type *canvas.Line") + return env.NewError("Go(*canvas.Line)//stroke-width!: arg 1: " + "expected native of type *canvas.Line, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//stroke-width!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Line)//stroke-width!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//stroke-width!: arg 1: expected native") + return env.NewError("Go(*canvas.Line)//stroke-width!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Decimal); ok { - self.StrokeWidth = float32(v.Value) + var newVal float32 + if vc, ok := arg1.(env.Decimal); ok { + newVal = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//stroke-width!: arg 2: expected decimal") + return env.NewError("Go(*canvas.Line)//stroke-width!: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } + self.StrokeWidth = newVal return arg0 }, }, @@ -52002,21 +49910,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Line switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Line) - if !ok { + if vc, ok := v.Value.(*canvas.Line); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//stroke-width?: arg 1: expected native of type *canvas.Line") + return env.NewError("Go(*canvas.Line)//stroke-width?: arg 1: " + "expected native of type *canvas.Line, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//stroke-width?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Line)//stroke-width?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//stroke-width?: arg 1: expected native") + return env.NewError("Go(*canvas.Line)//stroke-width?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewDecimal(float64(self.StrokeWidth)) @@ -52030,21 +49938,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Line switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Line) - if !ok { + if vc, ok := v.Value.(*canvas.Line); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//visible: arg 1: expected native of type *canvas.Line") + return env.NewError("Go(*canvas.Line)//visible: arg 1: " + "expected native of type *canvas.Line, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Line)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Line)//visible: arg 1: expected native") + return env.NewError("Go(*canvas.Line)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -52059,28 +49967,30 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.LinearGradient switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.LinearGradient) - if !ok { + if vc, ok := v.Value.(*canvas.LinearGradient); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//angle!: arg 1: expected native of type *canvas.LinearGradient") + return env.NewError("Go(*canvas.LinearGradient)//angle!: arg 1: " + "expected native of type *canvas.LinearGradient, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//angle!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.LinearGradient)//angle!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//angle!: arg 1: expected native") + return env.NewError("Go(*canvas.LinearGradient)//angle!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Decimal); ok { - self.Angle = float64(v.Value) + var newVal float64 + if vc, ok := arg1.(env.Decimal); ok { + newVal = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//angle!: arg 2: expected decimal") + return env.NewError("Go(*canvas.LinearGradient)//angle!: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } + self.Angle = newVal return arg0 }, }, @@ -52091,21 +50001,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.LinearGradient switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.LinearGradient) - if !ok { + if vc, ok := v.Value.(*canvas.LinearGradient); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//angle?: arg 1: expected native of type *canvas.LinearGradient") + return env.NewError("Go(*canvas.LinearGradient)//angle?: arg 1: " + "expected native of type *canvas.LinearGradient, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//angle?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.LinearGradient)//angle?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//angle?: arg 1: expected native") + return env.NewError("Go(*canvas.LinearGradient)//angle?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewDecimal(float64(self.Angle)) @@ -52119,34 +50029,36 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.LinearGradient switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.LinearGradient) - if !ok { + if vc, ok := v.Value.(*canvas.LinearGradient); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//end-color!: arg 1: expected native of type *canvas.LinearGradient") + return env.NewError("Go(*canvas.LinearGradient)//end-color!: arg 1: " + "expected native of type *canvas.LinearGradient, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//end-color!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.LinearGradient)//end-color!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//end-color!: arg 1: expected native") + return env.NewError("Go(*canvas.LinearGradient)//end-color!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal color.Color switch v := arg1.(type) { case env.Native: - var ok bool - self.EndColor, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//end-color!: arg 2: expected native of type color.Color") + return env.NewError("Go(*canvas.LinearGradient)//end-color!: arg 2: " + "expected native of type color.Color, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//end-color!: arg 2: expected native") + return env.NewError("Go(*canvas.LinearGradient)//end-color!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.EndColor = newVal return arg0 }, }, @@ -52157,21 +50069,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.LinearGradient switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.LinearGradient) - if !ok { + if vc, ok := v.Value.(*canvas.LinearGradient); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//end-color?: arg 1: expected native of type *canvas.LinearGradient") + return env.NewError("Go(*canvas.LinearGradient)//end-color?: arg 1: " + "expected native of type *canvas.LinearGradient, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//end-color?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.LinearGradient)//end-color?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//end-color?: arg 1: expected native") + return env.NewError("Go(*canvas.LinearGradient)//end-color?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, self.EndColor, "Go(color.Color)") @@ -52185,35 +50097,35 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.LinearGradient switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.LinearGradient) - if !ok { + if vc, ok := v.Value.(*canvas.LinearGradient); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//generate: arg 1: expected native of type *canvas.LinearGradient") + return env.NewError("Go(*canvas.LinearGradient)//generate: arg 1: " + "expected native of type *canvas.LinearGradient, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//generate: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.LinearGradient)//generate: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//generate: arg 1: expected native") + return env.NewError("Go(*canvas.LinearGradient)//generate: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//generate: arg 2: expected integer") + return env.NewError("Go(*canvas.LinearGradient)//generate: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val int - if v, ok := arg2.(env.Integer); ok { - arg2Val = int(v.Value) + if vc, ok := arg2.(env.Integer); ok { + arg2Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//generate: arg 3: expected integer") + return env.NewError("Go(*canvas.LinearGradient)//generate: arg 3: " + "expected integer, but got " + objectDebugString(ps.Idx, arg2)) } res0 := arg0Val.Generate(arg1Val, arg2Val) var res0Obj env.Object @@ -52228,21 +50140,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.LinearGradient switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.LinearGradient) - if !ok { + if vc, ok := v.Value.(*canvas.LinearGradient); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//hide: arg 1: expected native of type *canvas.LinearGradient") + return env.NewError("Go(*canvas.LinearGradient)//hide: arg 1: " + "expected native of type *canvas.LinearGradient, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.LinearGradient)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//hide: arg 1: expected native") + return env.NewError("Go(*canvas.LinearGradient)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -52255,42 +50167,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.LinearGradient switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.LinearGradient) - if !ok { + if vc, ok := v.Value.(*canvas.LinearGradient); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//move: arg 1: expected native of type *canvas.LinearGradient") + return env.NewError("Go(*canvas.LinearGradient)//move: arg 1: " + "expected native of type *canvas.LinearGradient, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.LinearGradient)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//move: arg 1: expected native") + return env.NewError("Go(*canvas.LinearGradient)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.LinearGradient)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//move: arg 2: expected native") + return env.NewError("Go(*canvas.LinearGradient)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -52301,21 +50207,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.LinearGradient switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.LinearGradient) - if !ok { + if vc, ok := v.Value.(*canvas.LinearGradient); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//refresh: arg 1: expected native of type *canvas.LinearGradient") + return env.NewError("Go(*canvas.LinearGradient)//refresh: arg 1: " + "expected native of type *canvas.LinearGradient, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.LinearGradient)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//refresh: arg 1: expected native") + return env.NewError("Go(*canvas.LinearGradient)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -52328,34 +50234,36 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.LinearGradient switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.LinearGradient) - if !ok { + if vc, ok := v.Value.(*canvas.LinearGradient); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//start-color!: arg 1: expected native of type *canvas.LinearGradient") + return env.NewError("Go(*canvas.LinearGradient)//start-color!: arg 1: " + "expected native of type *canvas.LinearGradient, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//start-color!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.LinearGradient)//start-color!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//start-color!: arg 1: expected native") + return env.NewError("Go(*canvas.LinearGradient)//start-color!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal color.Color switch v := arg1.(type) { case env.Native: - var ok bool - self.StartColor, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//start-color!: arg 2: expected native of type color.Color") + return env.NewError("Go(*canvas.LinearGradient)//start-color!: arg 2: " + "expected native of type color.Color, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//start-color!: arg 2: expected native") + return env.NewError("Go(*canvas.LinearGradient)//start-color!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.StartColor = newVal return arg0 }, }, @@ -52366,21 +50274,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.LinearGradient switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.LinearGradient) - if !ok { + if vc, ok := v.Value.(*canvas.LinearGradient); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//start-color?: arg 1: expected native of type *canvas.LinearGradient") + return env.NewError("Go(*canvas.LinearGradient)//start-color?: arg 1: " + "expected native of type *canvas.LinearGradient, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//start-color?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.LinearGradient)//start-color?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.LinearGradient)//start-color?: arg 1: expected native") + return env.NewError("Go(*canvas.LinearGradient)//start-color?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, self.StartColor, "Go(color.Color)") @@ -52394,28 +50302,30 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.RadialGradient switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.RadialGradient) - if !ok { + if vc, ok := v.Value.(*canvas.RadialGradient); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//center-offset-x!: arg 1: expected native of type *canvas.RadialGradient") + return env.NewError("Go(*canvas.RadialGradient)//center-offset-x!: arg 1: " + "expected native of type *canvas.RadialGradient, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//center-offset-x!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.RadialGradient)//center-offset-x!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//center-offset-x!: arg 1: expected native") + return env.NewError("Go(*canvas.RadialGradient)//center-offset-x!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Decimal); ok { - self.CenterOffsetX = float64(v.Value) + var newVal float64 + if vc, ok := arg1.(env.Decimal); ok { + newVal = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//center-offset-x!: arg 2: expected decimal") + return env.NewError("Go(*canvas.RadialGradient)//center-offset-x!: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } + self.CenterOffsetX = newVal return arg0 }, }, @@ -52426,21 +50336,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.RadialGradient switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.RadialGradient) - if !ok { + if vc, ok := v.Value.(*canvas.RadialGradient); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//center-offset-x?: arg 1: expected native of type *canvas.RadialGradient") + return env.NewError("Go(*canvas.RadialGradient)//center-offset-x?: arg 1: " + "expected native of type *canvas.RadialGradient, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//center-offset-x?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.RadialGradient)//center-offset-x?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//center-offset-x?: arg 1: expected native") + return env.NewError("Go(*canvas.RadialGradient)//center-offset-x?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewDecimal(float64(self.CenterOffsetX)) @@ -52454,28 +50364,30 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.RadialGradient switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.RadialGradient) - if !ok { + if vc, ok := v.Value.(*canvas.RadialGradient); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//center-offset-y!: arg 1: expected native of type *canvas.RadialGradient") + return env.NewError("Go(*canvas.RadialGradient)//center-offset-y!: arg 1: " + "expected native of type *canvas.RadialGradient, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//center-offset-y!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.RadialGradient)//center-offset-y!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//center-offset-y!: arg 1: expected native") + return env.NewError("Go(*canvas.RadialGradient)//center-offset-y!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Decimal); ok { - self.CenterOffsetY = float64(v.Value) + var newVal float64 + if vc, ok := arg1.(env.Decimal); ok { + newVal = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//center-offset-y!: arg 2: expected decimal") + return env.NewError("Go(*canvas.RadialGradient)//center-offset-y!: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } + self.CenterOffsetY = newVal return arg0 }, }, @@ -52486,21 +50398,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.RadialGradient switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.RadialGradient) - if !ok { + if vc, ok := v.Value.(*canvas.RadialGradient); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//center-offset-y?: arg 1: expected native of type *canvas.RadialGradient") + return env.NewError("Go(*canvas.RadialGradient)//center-offset-y?: arg 1: " + "expected native of type *canvas.RadialGradient, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//center-offset-y?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.RadialGradient)//center-offset-y?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//center-offset-y?: arg 1: expected native") + return env.NewError("Go(*canvas.RadialGradient)//center-offset-y?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewDecimal(float64(self.CenterOffsetY)) @@ -52514,34 +50426,36 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.RadialGradient switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.RadialGradient) - if !ok { + if vc, ok := v.Value.(*canvas.RadialGradient); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//end-color!: arg 1: expected native of type *canvas.RadialGradient") + return env.NewError("Go(*canvas.RadialGradient)//end-color!: arg 1: " + "expected native of type *canvas.RadialGradient, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//end-color!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.RadialGradient)//end-color!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//end-color!: arg 1: expected native") + return env.NewError("Go(*canvas.RadialGradient)//end-color!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal color.Color switch v := arg1.(type) { case env.Native: - var ok bool - self.EndColor, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//end-color!: arg 2: expected native of type color.Color") + return env.NewError("Go(*canvas.RadialGradient)//end-color!: arg 2: " + "expected native of type color.Color, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//end-color!: arg 2: expected native") + return env.NewError("Go(*canvas.RadialGradient)//end-color!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.EndColor = newVal return arg0 }, }, @@ -52552,21 +50466,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.RadialGradient switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.RadialGradient) - if !ok { + if vc, ok := v.Value.(*canvas.RadialGradient); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//end-color?: arg 1: expected native of type *canvas.RadialGradient") + return env.NewError("Go(*canvas.RadialGradient)//end-color?: arg 1: " + "expected native of type *canvas.RadialGradient, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//end-color?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.RadialGradient)//end-color?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//end-color?: arg 1: expected native") + return env.NewError("Go(*canvas.RadialGradient)//end-color?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, self.EndColor, "Go(color.Color)") @@ -52580,35 +50494,35 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.RadialGradient switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.RadialGradient) - if !ok { + if vc, ok := v.Value.(*canvas.RadialGradient); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//generate: arg 1: expected native of type *canvas.RadialGradient") + return env.NewError("Go(*canvas.RadialGradient)//generate: arg 1: " + "expected native of type *canvas.RadialGradient, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//generate: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.RadialGradient)//generate: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//generate: arg 1: expected native") + return env.NewError("Go(*canvas.RadialGradient)//generate: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//generate: arg 2: expected integer") + return env.NewError("Go(*canvas.RadialGradient)//generate: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val int - if v, ok := arg2.(env.Integer); ok { - arg2Val = int(v.Value) + if vc, ok := arg2.(env.Integer); ok { + arg2Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//generate: arg 3: expected integer") + return env.NewError("Go(*canvas.RadialGradient)//generate: arg 3: " + "expected integer, but got " + objectDebugString(ps.Idx, arg2)) } res0 := arg0Val.Generate(arg1Val, arg2Val) var res0Obj env.Object @@ -52623,21 +50537,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.RadialGradient switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.RadialGradient) - if !ok { + if vc, ok := v.Value.(*canvas.RadialGradient); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//hide: arg 1: expected native of type *canvas.RadialGradient") + return env.NewError("Go(*canvas.RadialGradient)//hide: arg 1: " + "expected native of type *canvas.RadialGradient, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.RadialGradient)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//hide: arg 1: expected native") + return env.NewError("Go(*canvas.RadialGradient)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -52650,42 +50564,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.RadialGradient switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.RadialGradient) - if !ok { + if vc, ok := v.Value.(*canvas.RadialGradient); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//move: arg 1: expected native of type *canvas.RadialGradient") + return env.NewError("Go(*canvas.RadialGradient)//move: arg 1: " + "expected native of type *canvas.RadialGradient, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.RadialGradient)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//move: arg 1: expected native") + return env.NewError("Go(*canvas.RadialGradient)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.RadialGradient)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//move: arg 2: expected native") + return env.NewError("Go(*canvas.RadialGradient)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -52696,21 +50604,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.RadialGradient switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.RadialGradient) - if !ok { + if vc, ok := v.Value.(*canvas.RadialGradient); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//refresh: arg 1: expected native of type *canvas.RadialGradient") + return env.NewError("Go(*canvas.RadialGradient)//refresh: arg 1: " + "expected native of type *canvas.RadialGradient, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.RadialGradient)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//refresh: arg 1: expected native") + return env.NewError("Go(*canvas.RadialGradient)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -52723,34 +50631,36 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.RadialGradient switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.RadialGradient) - if !ok { + if vc, ok := v.Value.(*canvas.RadialGradient); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//start-color!: arg 1: expected native of type *canvas.RadialGradient") + return env.NewError("Go(*canvas.RadialGradient)//start-color!: arg 1: " + "expected native of type *canvas.RadialGradient, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//start-color!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.RadialGradient)//start-color!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//start-color!: arg 1: expected native") + return env.NewError("Go(*canvas.RadialGradient)//start-color!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal color.Color switch v := arg1.(type) { case env.Native: - var ok bool - self.StartColor, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//start-color!: arg 2: expected native of type color.Color") + return env.NewError("Go(*canvas.RadialGradient)//start-color!: arg 2: " + "expected native of type color.Color, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//start-color!: arg 2: expected native") + return env.NewError("Go(*canvas.RadialGradient)//start-color!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.StartColor = newVal return arg0 }, }, @@ -52761,21 +50671,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.RadialGradient switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.RadialGradient) - if !ok { + if vc, ok := v.Value.(*canvas.RadialGradient); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//start-color?: arg 1: expected native of type *canvas.RadialGradient") + return env.NewError("Go(*canvas.RadialGradient)//start-color?: arg 1: " + "expected native of type *canvas.RadialGradient, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//start-color?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.RadialGradient)//start-color?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.RadialGradient)//start-color?: arg 1: expected native") + return env.NewError("Go(*canvas.RadialGradient)//start-color?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, self.StartColor, "Go(color.Color)") @@ -52789,21 +50699,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Raster switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Raster) - if !ok { + if vc, ok := v.Value.(*canvas.Raster); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//alpha: arg 1: expected native of type *canvas.Raster") + return env.NewError("Go(*canvas.Raster)//alpha: arg 1: " + "expected native of type *canvas.Raster, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//alpha: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Raster)//alpha: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//alpha: arg 1: expected native") + return env.NewError("Go(*canvas.Raster)//alpha: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Alpha() var res0Obj env.Object @@ -52818,51 +50728,54 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Raster switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Raster) - if !ok { + if vc, ok := v.Value.(*canvas.Raster); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//generator!: arg 1: expected native of type *canvas.Raster") + return env.NewError("Go(*canvas.Raster)//generator!: arg 1: " + "expected native of type *canvas.Raster, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//generator!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Raster)//generator!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//generator!: arg 1: expected native") + return env.NewError("Go(*canvas.Raster)//generator!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(int, int) image.Image switch fn := arg1.(type) { case env.Function: if fn.Argsn != 2 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//generator!: arg 2: function has invalid number of arguments (expected 2)") + return env.NewError("Go(*canvas.Raster)//generator!: arg 2: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.Generator = func(arg0 int, arg1 int) image.Image { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) - arg1Val = *env.NewInteger(int64(arg1)) + newVal = func(farg0 int, farg1 int) image.Image { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) + farg1Val = *env.NewInteger(int64(farg1)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val, farg1Val) var res image.Image switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(image.Image) - if !ok { + if vc, ok := v.Value.(image.Image); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*canvas.Raster)//generator!: arg 2: callback result: expected native of type image.Image", + "Go(*canvas.Raster)//generator!: arg 2: callback result: "+"expected native of type image.Image, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*canvas.Raster)//generator!: arg 2: callback result: expected native", + "Go(*canvas.Raster)//generator!: arg 2: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -52873,13 +50786,14 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//generator!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Raster)//generator!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.Generator = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//generator!: arg 2: expected function or nil") + return env.NewError("Go(*canvas.Raster)//generator!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.Generator = newVal return arg0 }, }, @@ -52890,24 +50804,43 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Raster switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Raster) - if !ok { + if vc, ok := v.Value.(*canvas.Raster); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//generator?: arg 1: expected native of type *canvas.Raster") + return env.NewError("Go(*canvas.Raster)//generator?: arg 1: " + "expected native of type *canvas.Raster, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//generator?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Raster)//generator?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//generator?: arg 1: expected native") + return env.NewError("Go(*canvas.Raster)//generator?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.Generator, "Go(func(int, int) (image.Image))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val int + if vc, ok := arg0.(env.Integer); ok { + arg0Val = int(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*canvas.Raster)//generator?: arg 1: " + "expected integer, but got " + objectDebugString(ps.Idx, arg0)) + } + var arg1Val int + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*canvas.Raster)//generator?: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) + } + res0 := self.Generator(arg0Val, arg1Val) + var res0Obj env.Object + res0Obj = *env.NewNative(ps.Idx, res0, "Go(image.Image)") + return res0Obj + }, 2, false, false, "Returned func") return resObj }, }, @@ -52918,21 +50851,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Raster switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Raster) - if !ok { + if vc, ok := v.Value.(*canvas.Raster); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//hide: arg 1: expected native of type *canvas.Raster") + return env.NewError("Go(*canvas.Raster)//hide: arg 1: " + "expected native of type *canvas.Raster, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Raster)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//hide: arg 1: expected native") + return env.NewError("Go(*canvas.Raster)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -52945,42 +50878,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Raster switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Raster) - if !ok { + if vc, ok := v.Value.(*canvas.Raster); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//move: arg 1: expected native of type *canvas.Raster") + return env.NewError("Go(*canvas.Raster)//move: arg 1: " + "expected native of type *canvas.Raster, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Raster)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//move: arg 1: expected native") + return env.NewError("Go(*canvas.Raster)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Raster)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//move: arg 2: expected native") + return env.NewError("Go(*canvas.Raster)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -52991,21 +50918,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Raster switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Raster) - if !ok { + if vc, ok := v.Value.(*canvas.Raster); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//refresh: arg 1: expected native of type *canvas.Raster") + return env.NewError("Go(*canvas.Raster)//refresh: arg 1: " + "expected native of type *canvas.Raster, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Raster)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//refresh: arg 1: expected native") + return env.NewError("Go(*canvas.Raster)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -53018,42 +50945,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Raster switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Raster) - if !ok { + if vc, ok := v.Value.(*canvas.Raster); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//resize: arg 1: expected native of type *canvas.Raster") + return env.NewError("Go(*canvas.Raster)//resize: arg 1: " + "expected native of type *canvas.Raster, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Raster)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//resize: arg 1: expected native") + return env.NewError("Go(*canvas.Raster)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Raster)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//resize: arg 2: expected native") + return env.NewError("Go(*canvas.Raster)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -53064,22 +50985,23 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Raster switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Raster) - if !ok { + if vc, ok := v.Value.(*canvas.Raster); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//scale-mode!: arg 1: expected native of type *canvas.Raster") + return env.NewError("Go(*canvas.Raster)//scale-mode!: arg 1: " + "expected native of type *canvas.Raster, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//scale-mode!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Raster)//scale-mode!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//scale-mode!: arg 1: expected native") + return env.NewError("Go(*canvas.Raster)//scale-mode!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal canvas.ImageScale { nat, natOk := arg1.(env.Native) var natValOk bool @@ -53088,18 +51010,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(canvas.ImageScale) } if natValOk { - self.ScaleMode = natVal + newVal = natVal } else { var u int32 - if v, ok := arg1.(env.Integer); ok { - u = int32(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//scale-mode!: arg 2: expected integer") + return env.NewError("Go(*canvas.Raster)//scale-mode!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } - self.ScaleMode = canvas.ImageScale(u) + newVal = canvas.ImageScale(u) } } + self.ScaleMode = newVal return arg0 }, }, @@ -53110,21 +51033,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Raster switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Raster) - if !ok { + if vc, ok := v.Value.(*canvas.Raster); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//scale-mode?: arg 1: expected native of type *canvas.Raster") + return env.NewError("Go(*canvas.Raster)//scale-mode?: arg 1: " + "expected native of type *canvas.Raster, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//scale-mode?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Raster)//scale-mode?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//scale-mode?: arg 1: expected native") + return env.NewError("Go(*canvas.Raster)//scale-mode?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(int32(self.ScaleMode))) @@ -53138,28 +51061,30 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Raster switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Raster) - if !ok { + if vc, ok := v.Value.(*canvas.Raster); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//translucency!: arg 1: expected native of type *canvas.Raster") + return env.NewError("Go(*canvas.Raster)//translucency!: arg 1: " + "expected native of type *canvas.Raster, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//translucency!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Raster)//translucency!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//translucency!: arg 1: expected native") + return env.NewError("Go(*canvas.Raster)//translucency!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Decimal); ok { - self.Translucency = float64(v.Value) + var newVal float64 + if vc, ok := arg1.(env.Decimal); ok { + newVal = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//translucency!: arg 2: expected decimal") + return env.NewError("Go(*canvas.Raster)//translucency!: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } + self.Translucency = newVal return arg0 }, }, @@ -53170,21 +51095,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Raster switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Raster) - if !ok { + if vc, ok := v.Value.(*canvas.Raster); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//translucency?: arg 1: expected native of type *canvas.Raster") + return env.NewError("Go(*canvas.Raster)//translucency?: arg 1: " + "expected native of type *canvas.Raster, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//translucency?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Raster)//translucency?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Raster)//translucency?: arg 1: expected native") + return env.NewError("Go(*canvas.Raster)//translucency?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewDecimal(float64(self.Translucency)) @@ -53198,28 +51123,30 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Rectangle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Rectangle) - if !ok { + if vc, ok := v.Value.(*canvas.Rectangle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//corner-radius!: arg 1: expected native of type *canvas.Rectangle") + return env.NewError("Go(*canvas.Rectangle)//corner-radius!: arg 1: " + "expected native of type *canvas.Rectangle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//corner-radius!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Rectangle)//corner-radius!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//corner-radius!: arg 1: expected native") + return env.NewError("Go(*canvas.Rectangle)//corner-radius!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Decimal); ok { - self.CornerRadius = float32(v.Value) + var newVal float32 + if vc, ok := arg1.(env.Decimal); ok { + newVal = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//corner-radius!: arg 2: expected decimal") + return env.NewError("Go(*canvas.Rectangle)//corner-radius!: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } + self.CornerRadius = newVal return arg0 }, }, @@ -53230,21 +51157,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Rectangle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Rectangle) - if !ok { + if vc, ok := v.Value.(*canvas.Rectangle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//corner-radius?: arg 1: expected native of type *canvas.Rectangle") + return env.NewError("Go(*canvas.Rectangle)//corner-radius?: arg 1: " + "expected native of type *canvas.Rectangle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//corner-radius?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Rectangle)//corner-radius?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//corner-radius?: arg 1: expected native") + return env.NewError("Go(*canvas.Rectangle)//corner-radius?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewDecimal(float64(self.CornerRadius)) @@ -53258,34 +51185,36 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Rectangle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Rectangle) - if !ok { + if vc, ok := v.Value.(*canvas.Rectangle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//fill-color!: arg 1: expected native of type *canvas.Rectangle") + return env.NewError("Go(*canvas.Rectangle)//fill-color!: arg 1: " + "expected native of type *canvas.Rectangle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//fill-color!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Rectangle)//fill-color!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//fill-color!: arg 1: expected native") + return env.NewError("Go(*canvas.Rectangle)//fill-color!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal color.Color switch v := arg1.(type) { case env.Native: - var ok bool - self.FillColor, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//fill-color!: arg 2: expected native of type color.Color") + return env.NewError("Go(*canvas.Rectangle)//fill-color!: arg 2: " + "expected native of type color.Color, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//fill-color!: arg 2: expected native") + return env.NewError("Go(*canvas.Rectangle)//fill-color!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.FillColor = newVal return arg0 }, }, @@ -53296,21 +51225,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Rectangle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Rectangle) - if !ok { + if vc, ok := v.Value.(*canvas.Rectangle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//fill-color?: arg 1: expected native of type *canvas.Rectangle") + return env.NewError("Go(*canvas.Rectangle)//fill-color?: arg 1: " + "expected native of type *canvas.Rectangle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//fill-color?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Rectangle)//fill-color?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//fill-color?: arg 1: expected native") + return env.NewError("Go(*canvas.Rectangle)//fill-color?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, self.FillColor, "Go(color.Color)") @@ -53324,21 +51253,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Rectangle switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Rectangle) - if !ok { + if vc, ok := v.Value.(*canvas.Rectangle); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//hide: arg 1: expected native of type *canvas.Rectangle") + return env.NewError("Go(*canvas.Rectangle)//hide: arg 1: " + "expected native of type *canvas.Rectangle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Rectangle)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//hide: arg 1: expected native") + return env.NewError("Go(*canvas.Rectangle)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -53351,42 +51280,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Rectangle switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Rectangle) - if !ok { + if vc, ok := v.Value.(*canvas.Rectangle); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//move: arg 1: expected native of type *canvas.Rectangle") + return env.NewError("Go(*canvas.Rectangle)//move: arg 1: " + "expected native of type *canvas.Rectangle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Rectangle)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//move: arg 1: expected native") + return env.NewError("Go(*canvas.Rectangle)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Rectangle)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//move: arg 2: expected native") + return env.NewError("Go(*canvas.Rectangle)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -53397,21 +51320,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Rectangle switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Rectangle) - if !ok { + if vc, ok := v.Value.(*canvas.Rectangle); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//refresh: arg 1: expected native of type *canvas.Rectangle") + return env.NewError("Go(*canvas.Rectangle)//refresh: arg 1: " + "expected native of type *canvas.Rectangle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Rectangle)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//refresh: arg 1: expected native") + return env.NewError("Go(*canvas.Rectangle)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -53424,42 +51347,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Rectangle switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Rectangle) - if !ok { + if vc, ok := v.Value.(*canvas.Rectangle); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//resize: arg 1: expected native of type *canvas.Rectangle") + return env.NewError("Go(*canvas.Rectangle)//resize: arg 1: " + "expected native of type *canvas.Rectangle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Rectangle)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//resize: arg 1: expected native") + return env.NewError("Go(*canvas.Rectangle)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Rectangle)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//resize: arg 2: expected native") + return env.NewError("Go(*canvas.Rectangle)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -53470,34 +51387,36 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Rectangle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Rectangle) - if !ok { + if vc, ok := v.Value.(*canvas.Rectangle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//stroke-color!: arg 1: expected native of type *canvas.Rectangle") + return env.NewError("Go(*canvas.Rectangle)//stroke-color!: arg 1: " + "expected native of type *canvas.Rectangle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//stroke-color!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Rectangle)//stroke-color!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//stroke-color!: arg 1: expected native") + return env.NewError("Go(*canvas.Rectangle)//stroke-color!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal color.Color switch v := arg1.(type) { case env.Native: - var ok bool - self.StrokeColor, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//stroke-color!: arg 2: expected native of type color.Color") + return env.NewError("Go(*canvas.Rectangle)//stroke-color!: arg 2: " + "expected native of type color.Color, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//stroke-color!: arg 2: expected native") + return env.NewError("Go(*canvas.Rectangle)//stroke-color!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.StrokeColor = newVal return arg0 }, }, @@ -53508,21 +51427,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Rectangle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Rectangle) - if !ok { + if vc, ok := v.Value.(*canvas.Rectangle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//stroke-color?: arg 1: expected native of type *canvas.Rectangle") + return env.NewError("Go(*canvas.Rectangle)//stroke-color?: arg 1: " + "expected native of type *canvas.Rectangle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//stroke-color?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Rectangle)//stroke-color?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//stroke-color?: arg 1: expected native") + return env.NewError("Go(*canvas.Rectangle)//stroke-color?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, self.StrokeColor, "Go(color.Color)") @@ -53536,28 +51455,30 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Rectangle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Rectangle) - if !ok { + if vc, ok := v.Value.(*canvas.Rectangle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//stroke-width!: arg 1: expected native of type *canvas.Rectangle") + return env.NewError("Go(*canvas.Rectangle)//stroke-width!: arg 1: " + "expected native of type *canvas.Rectangle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//stroke-width!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Rectangle)//stroke-width!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//stroke-width!: arg 1: expected native") + return env.NewError("Go(*canvas.Rectangle)//stroke-width!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Decimal); ok { - self.StrokeWidth = float32(v.Value) + var newVal float32 + if vc, ok := arg1.(env.Decimal); ok { + newVal = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//stroke-width!: arg 2: expected decimal") + return env.NewError("Go(*canvas.Rectangle)//stroke-width!: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } + self.StrokeWidth = newVal return arg0 }, }, @@ -53568,21 +51489,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Rectangle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Rectangle) - if !ok { + if vc, ok := v.Value.(*canvas.Rectangle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//stroke-width?: arg 1: expected native of type *canvas.Rectangle") + return env.NewError("Go(*canvas.Rectangle)//stroke-width?: arg 1: " + "expected native of type *canvas.Rectangle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//stroke-width?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Rectangle)//stroke-width?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Rectangle)//stroke-width?: arg 1: expected native") + return env.NewError("Go(*canvas.Rectangle)//stroke-width?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewDecimal(float64(self.StrokeWidth)) @@ -53596,22 +51517,23 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Text switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Text) - if !ok { + if vc, ok := v.Value.(*canvas.Text); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//alignment!: arg 1: expected native of type *canvas.Text") + return env.NewError("Go(*canvas.Text)//alignment!: arg 1: " + "expected native of type *canvas.Text, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//alignment!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Text)//alignment!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//alignment!: arg 1: expected native") + return env.NewError("Go(*canvas.Text)//alignment!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.TextAlign { nat, natOk := arg1.(env.Native) var natValOk bool @@ -53620,18 +51542,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(fyne.TextAlign) } if natValOk { - self.Alignment = natVal + newVal = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//alignment!: arg 2: expected integer") + return env.NewError("Go(*canvas.Text)//alignment!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } - self.Alignment = fyne.TextAlign(u) + newVal = fyne.TextAlign(u) } } + self.Alignment = newVal return arg0 }, }, @@ -53642,21 +51565,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Text switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Text) - if !ok { + if vc, ok := v.Value.(*canvas.Text); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//alignment?: arg 1: expected native of type *canvas.Text") + return env.NewError("Go(*canvas.Text)//alignment?: arg 1: " + "expected native of type *canvas.Text, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//alignment?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Text)//alignment?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//alignment?: arg 1: expected native") + return env.NewError("Go(*canvas.Text)//alignment?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(int(self.Alignment))) @@ -53670,34 +51593,36 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Text switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Text) - if !ok { + if vc, ok := v.Value.(*canvas.Text); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//color!: arg 1: expected native of type *canvas.Text") + return env.NewError("Go(*canvas.Text)//color!: arg 1: " + "expected native of type *canvas.Text, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//color!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Text)//color!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//color!: arg 1: expected native") + return env.NewError("Go(*canvas.Text)//color!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal color.Color switch v := arg1.(type) { case env.Native: - var ok bool - self.Color, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//color!: arg 2: expected native of type color.Color") + return env.NewError("Go(*canvas.Text)//color!: arg 2: " + "expected native of type color.Color, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//color!: arg 2: expected native") + return env.NewError("Go(*canvas.Text)//color!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Color = newVal return arg0 }, }, @@ -53708,21 +51633,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Text switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Text) - if !ok { + if vc, ok := v.Value.(*canvas.Text); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//color?: arg 1: expected native of type *canvas.Text") + return env.NewError("Go(*canvas.Text)//color?: arg 1: " + "expected native of type *canvas.Text, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//color?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Text)//color?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//color?: arg 1: expected native") + return env.NewError("Go(*canvas.Text)//color?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, self.Color, "Go(color.Color)") @@ -53736,21 +51661,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Text switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Text) - if !ok { + if vc, ok := v.Value.(*canvas.Text); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//hide: arg 1: expected native of type *canvas.Text") + return env.NewError("Go(*canvas.Text)//hide: arg 1: " + "expected native of type *canvas.Text, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Text)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//hide: arg 1: expected native") + return env.NewError("Go(*canvas.Text)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -53763,21 +51688,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Text switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Text) - if !ok { + if vc, ok := v.Value.(*canvas.Text); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//min-size: arg 1: expected native of type *canvas.Text") + return env.NewError("Go(*canvas.Text)//min-size: arg 1: " + "expected native of type *canvas.Text, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Text)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//min-size: arg 1: expected native") + return env.NewError("Go(*canvas.Text)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -53792,42 +51717,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Text switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Text) - if !ok { + if vc, ok := v.Value.(*canvas.Text); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//move: arg 1: expected native of type *canvas.Text") + return env.NewError("Go(*canvas.Text)//move: arg 1: " + "expected native of type *canvas.Text, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Text)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//move: arg 1: expected native") + return env.NewError("Go(*canvas.Text)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Text)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//move: arg 2: expected native") + return env.NewError("Go(*canvas.Text)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -53838,21 +51757,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Text switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Text) - if !ok { + if vc, ok := v.Value.(*canvas.Text); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//refresh: arg 1: expected native of type *canvas.Text") + return env.NewError("Go(*canvas.Text)//refresh: arg 1: " + "expected native of type *canvas.Text, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Text)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//refresh: arg 1: expected native") + return env.NewError("Go(*canvas.Text)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -53865,42 +51784,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Text switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Text) - if !ok { + if vc, ok := v.Value.(*canvas.Text); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//resize: arg 1: expected native of type *canvas.Text") + return env.NewError("Go(*canvas.Text)//resize: arg 1: " + "expected native of type *canvas.Text, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Text)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//resize: arg 1: expected native") + return env.NewError("Go(*canvas.Text)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Text)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//resize: arg 2: expected native") + return env.NewError("Go(*canvas.Text)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -53911,42 +51824,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *canvas.Text switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*canvas.Text) - if !ok { + if vc, ok := v.Value.(*canvas.Text); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//set-min-size: arg 1: expected native of type *canvas.Text") + return env.NewError("Go(*canvas.Text)//set-min-size: arg 1: " + "expected native of type *canvas.Text, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//set-min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Text)//set-min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//set-min-size: arg 1: expected native") + return env.NewError("Go(*canvas.Text)//set-min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//set-min-size: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//set-min-size: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Text)//set-min-size: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//set-min-size: arg 2: expected native") + return env.NewError("Go(*canvas.Text)//set-min-size: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.SetMinSize(*arg1Val) + arg0Val.SetMinSize(arg1Val) return arg0 }, }, @@ -53957,28 +51864,30 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Text switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Text) - if !ok { + if vc, ok := v.Value.(*canvas.Text); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//text!: arg 1: expected native of type *canvas.Text") + return env.NewError("Go(*canvas.Text)//text!: arg 1: " + "expected native of type *canvas.Text, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//text!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Text)//text!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//text!: arg 1: expected native") + return env.NewError("Go(*canvas.Text)//text!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.Text = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//text!: arg 2: expected string") + return env.NewError("Go(*canvas.Text)//text!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.Text = newVal return arg0 }, }, @@ -53989,28 +51898,30 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Text switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Text) - if !ok { + if vc, ok := v.Value.(*canvas.Text); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//text-size!: arg 1: expected native of type *canvas.Text") + return env.NewError("Go(*canvas.Text)//text-size!: arg 1: " + "expected native of type *canvas.Text, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//text-size!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Text)//text-size!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//text-size!: arg 1: expected native") + return env.NewError("Go(*canvas.Text)//text-size!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Decimal); ok { - self.TextSize = float32(v.Value) + var newVal float32 + if vc, ok := arg1.(env.Decimal); ok { + newVal = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//text-size!: arg 2: expected decimal") + return env.NewError("Go(*canvas.Text)//text-size!: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } + self.TextSize = newVal return arg0 }, }, @@ -54021,21 +51932,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Text switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Text) - if !ok { + if vc, ok := v.Value.(*canvas.Text); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//text-size?: arg 1: expected native of type *canvas.Text") + return env.NewError("Go(*canvas.Text)//text-size?: arg 1: " + "expected native of type *canvas.Text, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//text-size?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Text)//text-size?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//text-size?: arg 1: expected native") + return env.NewError("Go(*canvas.Text)//text-size?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewDecimal(float64(self.TextSize)) @@ -54049,34 +51960,42 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Text switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Text) - if !ok { + if vc, ok := v.Value.(*canvas.Text); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//text-style!: arg 1: expected native of type *canvas.Text") + return env.NewError("Go(*canvas.Text)//text-style!: arg 1: " + "expected native of type *canvas.Text, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//text-style!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Text)//text-style!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//text-style!: arg 1: expected native") + return env.NewError("Go(*canvas.Text)//text-style!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal *fyne.TextStyle switch v := arg1.(type) { case env.Native: - var ok bool - self.TextStyle, ok = v.Value.(fyne.TextStyle) - if !ok { + if vc, ok := v.Value.(*fyne.TextStyle); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*canvas.Text)//text-style!: arg 2: " + "expected native of type *fyne.TextStyle, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//text-style!: arg 2: expected native of type fyne.TextStyle") + return env.NewError("Go(*canvas.Text)//text-style!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//text-style!: arg 2: expected native") + return env.NewError("Go(*canvas.Text)//text-style!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.TextStyle = *newVal return arg0 }, }, @@ -54087,21 +52006,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Text switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Text) - if !ok { + if vc, ok := v.Value.(*canvas.Text); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//text-style?: arg 1: expected native of type *canvas.Text") + return env.NewError("Go(*canvas.Text)//text-style?: arg 1: " + "expected native of type *canvas.Text, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//text-style?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Text)//text-style?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//text-style?: arg 1: expected native") + return env.NewError("Go(*canvas.Text)//text-style?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, &self.TextStyle, "Go(*fyne.TextStyle)") @@ -54115,21 +52034,21 @@ var Builtins = map[string]*env.Builtin{ var self *canvas.Text switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*canvas.Text) - if !ok { + if vc, ok := v.Value.(*canvas.Text); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//text?: arg 1: expected native of type *canvas.Text") + return env.NewError("Go(*canvas.Text)//text?: arg 1: " + "expected native of type *canvas.Text, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//text?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*canvas.Text)//text?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*canvas.Text)//text?: arg 1: expected native") + return env.NewError("Go(*canvas.Text)//text?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.Text) @@ -54143,45 +52062,119 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//append: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//append: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//append: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *container.TabItem switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*container.TabItem) - if !ok { + if vc, ok := v.Value.(*container.TabItem); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//append: arg 2: expected native of type *container.TabItem") + return env.NewError("Go(*container.AppTabs)//append: arg 2: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//append: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//append: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//append: arg 2: expected native") + return env.NewError("Go(*container.AppTabs)//append: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Append(arg1Val) return arg0 }, }, + "Go(*container.AppTabs)//base-widget!": { + Doc: "Set *container.AppTabs BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *container.AppTabs + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*container.AppTabs); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*container.AppTabs)//base-widget!: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*container.AppTabs)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*container.AppTabs)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*container.AppTabs)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*container.AppTabs)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*container.AppTabs)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*container.AppTabs)//base-widget?": { + Doc: "Get *container.AppTabs BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *container.AppTabs + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*container.AppTabs); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*container.AppTabs)//base-widget?: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*container.AppTabs)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*container.AppTabs)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj + }, + }, "Go(*container.AppTabs)//create-renderer": { Doc: "(*container.AppTabs).CreateRenderer", Argsn: 1, @@ -54189,42 +52182,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//create-renderer: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//create-renderer: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//create-renderer: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -54235,21 +52211,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//current-tab: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//current-tab: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//current-tab: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//current-tab: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//current-tab: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//current-tab: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CurrentTab() var res0Obj env.Object @@ -54264,21 +52240,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//current-tab-index: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//current-tab-index: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//current-tab-index: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//current-tab-index: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//current-tab-index: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//current-tab-index: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CurrentTabIndex() var res0Obj env.Object @@ -54293,28 +52269,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//disable-index: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//disable-index: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//disable-index: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//disable-index: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//disable-index: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//disable-index: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//disable-index: arg 2: expected integer") + return env.NewError("Go(*container.AppTabs)//disable-index: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.DisableIndex(arg1Val) return arg0 @@ -54327,40 +52303,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//disable-item: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//disable-item: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//disable-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//disable-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//disable-item: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//disable-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *container.TabItem switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*container.TabItem) - if !ok { + if vc, ok := v.Value.(*container.TabItem); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//disable-item: arg 2: expected native of type *container.TabItem") + return env.NewError("Go(*container.AppTabs)//disable-item: arg 2: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//disable-item: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//disable-item: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//disable-item: arg 2: expected native") + return env.NewError("Go(*container.AppTabs)//disable-item: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.DisableItem(arg1Val) return arg0 @@ -54373,28 +52349,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//enable-index: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//enable-index: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//enable-index: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//enable-index: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//enable-index: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//enable-index: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//enable-index: arg 2: expected integer") + return env.NewError("Go(*container.AppTabs)//enable-index: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.EnableIndex(arg1Val) return arg0 @@ -54407,40 +52383,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//enable-item: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//enable-item: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//enable-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//enable-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//enable-item: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//enable-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *container.TabItem switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*container.TabItem) - if !ok { + if vc, ok := v.Value.(*container.TabItem); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//enable-item: arg 2: expected native of type *container.TabItem") + return env.NewError("Go(*container.AppTabs)//enable-item: arg 2: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//enable-item: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//enable-item: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//enable-item: arg 2: expected native") + return env.NewError("Go(*container.AppTabs)//enable-item: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.EnableItem(arg1Val) return arg0 @@ -54453,21 +52429,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//extend-base-widget: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//extend-base-widget: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -54476,24 +52452,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*container.AppTabs)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*container.AppTabs)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*container.AppTabs)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -54506,28 +52482,30 @@ var Builtins = map[string]*env.Builtin{ var self *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//hidden!: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//hidden!: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//hidden!: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//hidden!: arg 2: expected integer") + return env.NewError("Go(*container.AppTabs)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -54538,21 +52516,21 @@ var Builtins = map[string]*env.Builtin{ var self *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//hidden?: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//hidden?: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//hidden?: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -54566,21 +52544,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//hide: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//hide: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//hide: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -54593,62 +52571,57 @@ var Builtins = map[string]*env.Builtin{ var self *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//items!: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//items!: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//items!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//items!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//items!: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//items!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal []*container.TabItem switch v := arg1.(type) { case env.Block: - self.Items = make([]*container.TabItem, len(v.Series.S)) + newVal = make([]*container.TabItem, len(v.Series.S)) for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - self.Items[i], ok = v.Value.(*container.TabItem) - if !ok { + if vc, ok := v.Value.(*container.TabItem); ok { + newVal[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//items!: arg 2: block item: expected native of type *container.TabItem") + return env.NewError("Go(*container.AppTabs)//items!: arg 2: " + "block item: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//items!: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//items!: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Items[i] = nil + newVal[i] = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//items!: arg 2: block item: expected native") + return env.NewError("Go(*container.AppTabs)//items!: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - self.Items, ok = v.Value.([]*container.TabItem) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//items!: arg 2: expected native of type []*container.TabItem") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//items!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//items!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Items = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//items!: arg 2: expected block, native or nil") + return env.NewError("Go(*container.AppTabs)//items!: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } + self.Items = newVal return arg0 }, }, @@ -54659,21 +52632,21 @@ var Builtins = map[string]*env.Builtin{ var self *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//items?: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//items?: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//items?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//items?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//items?: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//items?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object { @@ -54693,21 +52666,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//min-size: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//min-size: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//min-size: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -54722,42 +52695,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//move: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//move: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//move: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//move: arg 2: expected native") + return env.NewError("Go(*container.AppTabs)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -54768,45 +52735,47 @@ var Builtins = map[string]*env.Builtin{ var self *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//on-changed!: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//on-changed!: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//on-changed!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//on-changed!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//on-changed!: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//on-changed!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(*container.TabItem) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//on-changed!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*container.AppTabs)//on-changed!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnChanged = func(arg0 *container.TabItem) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*container.TabItem)") + newVal = func(farg0 *container.TabItem) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*container.TabItem)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//on-changed!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//on-changed!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnChanged = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//on-changed!: arg 2: expected function or nil") + return env.NewError("Go(*container.AppTabs)//on-changed!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnChanged = newVal return arg0 }, }, @@ -54817,24 +52786,46 @@ var Builtins = map[string]*env.Builtin{ var self *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//on-changed?: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//on-changed?: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//on-changed?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//on-changed?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//on-changed?: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//on-changed?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnChanged, "Go(func(*container.TabItem))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val *container.TabItem + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*container.TabItem); ok { + arg0Val = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*container.AppTabs)//on-changed?: arg 1: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*container.AppTabs)//on-changed?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg0Val = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*container.AppTabs)//on-changed?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.OnChanged(arg0Val) + return nil + }, 1, false, false, "Returned func") return resObj }, }, @@ -54845,45 +52836,47 @@ var Builtins = map[string]*env.Builtin{ var self *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//on-selected!: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//on-selected!: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//on-selected!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//on-selected!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//on-selected!: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//on-selected!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(*container.TabItem) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//on-selected!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*container.AppTabs)//on-selected!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnSelected = func(arg0 *container.TabItem) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*container.TabItem)") + newVal = func(farg0 *container.TabItem) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*container.TabItem)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//on-selected!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//on-selected!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnSelected = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//on-selected!: arg 2: expected function or nil") + return env.NewError("Go(*container.AppTabs)//on-selected!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnSelected = newVal return arg0 }, }, @@ -54894,24 +52887,46 @@ var Builtins = map[string]*env.Builtin{ var self *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//on-selected?: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//on-selected?: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//on-selected?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//on-selected?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//on-selected?: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//on-selected?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnSelected, "Go(func(*container.TabItem))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val *container.TabItem + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*container.TabItem); ok { + arg0Val = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*container.AppTabs)//on-selected?: arg 1: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*container.AppTabs)//on-selected?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg0Val = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*container.AppTabs)//on-selected?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.OnSelected(arg0Val) + return nil + }, 1, false, false, "Returned func") return resObj }, }, @@ -54922,45 +52937,47 @@ var Builtins = map[string]*env.Builtin{ var self *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//on-unselected!: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//on-unselected!: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//on-unselected!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//on-unselected!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//on-unselected!: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//on-unselected!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(*container.TabItem) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//on-unselected!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*container.AppTabs)//on-unselected!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnUnselected = func(arg0 *container.TabItem) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*container.TabItem)") + newVal = func(farg0 *container.TabItem) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*container.TabItem)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//on-unselected!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//on-unselected!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnUnselected = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//on-unselected!: arg 2: expected function or nil") + return env.NewError("Go(*container.AppTabs)//on-unselected!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnUnselected = newVal return arg0 }, }, @@ -54971,24 +52988,46 @@ var Builtins = map[string]*env.Builtin{ var self *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//on-unselected?: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//on-unselected?: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//on-unselected?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//on-unselected?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//on-unselected?: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//on-unselected?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnUnselected, "Go(func(*container.TabItem))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val *container.TabItem + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*container.TabItem); ok { + arg0Val = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*container.AppTabs)//on-unselected?: arg 1: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*container.AppTabs)//on-unselected?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg0Val = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*container.AppTabs)//on-unselected?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.OnUnselected(arg0Val) + return nil + }, 1, false, false, "Returned func") return resObj }, }, @@ -54999,21 +53038,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//position: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//position: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//position: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -55028,21 +53067,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//refresh: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//refresh: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//refresh: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -55055,40 +53094,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//remove: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//remove: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//remove: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//remove: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//remove: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//remove: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *container.TabItem switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*container.TabItem) - if !ok { + if vc, ok := v.Value.(*container.TabItem); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//remove: arg 2: expected native of type *container.TabItem") + return env.NewError("Go(*container.AppTabs)//remove: arg 2: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//remove: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//remove: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//remove: arg 2: expected native") + return env.NewError("Go(*container.AppTabs)//remove: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Remove(arg1Val) return arg0 @@ -55101,28 +53140,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//remove-index: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//remove-index: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//remove-index: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//remove-index: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//remove-index: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//remove-index: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//remove-index: arg 2: expected integer") + return env.NewError("Go(*container.AppTabs)//remove-index: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.RemoveIndex(arg1Val) return arg0 @@ -55135,42 +53174,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//resize: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//resize: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//resize: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//resize: arg 2: expected native") + return env.NewError("Go(*container.AppTabs)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -55181,40 +53214,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//select: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//select: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//select: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//select: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//select: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//select: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *container.TabItem switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*container.TabItem) - if !ok { + if vc, ok := v.Value.(*container.TabItem); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//select: arg 2: expected native of type *container.TabItem") + return env.NewError("Go(*container.AppTabs)//select: arg 2: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//select: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//select: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//select: arg 2: expected native") + return env.NewError("Go(*container.AppTabs)//select: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Select(arg1Val) return arg0 @@ -55227,28 +53260,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//select-index: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//select-index: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//select-index: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//select-index: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//select-index: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//select-index: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//select-index: arg 2: expected integer") + return env.NewError("Go(*container.AppTabs)//select-index: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SelectIndex(arg1Val) return arg0 @@ -55261,40 +53294,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//select-tab: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//select-tab: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//select-tab: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//select-tab: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//select-tab: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//select-tab: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *container.TabItem switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*container.TabItem) - if !ok { + if vc, ok := v.Value.(*container.TabItem); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//select-tab: arg 2: expected native of type *container.TabItem") + return env.NewError("Go(*container.AppTabs)//select-tab: arg 2: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//select-tab: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//select-tab: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//select-tab: arg 2: expected native") + return env.NewError("Go(*container.AppTabs)//select-tab: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SelectTab(arg1Val) return arg0 @@ -55307,28 +53340,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//select-tab-index: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//select-tab-index: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//select-tab-index: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//select-tab-index: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//select-tab-index: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//select-tab-index: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//select-tab-index: arg 2: expected integer") + return env.NewError("Go(*container.AppTabs)//select-tab-index: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SelectTabIndex(arg1Val) return arg0 @@ -55341,21 +53374,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//selected: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//selected: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//selected: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//selected: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//selected: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//selected: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Selected() var res0Obj env.Object @@ -55370,21 +53403,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//selected-index: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//selected-index: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//selected-index: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//selected-index: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//selected-index: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//selected-index: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.SelectedIndex() var res0Obj env.Object @@ -55399,21 +53432,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//set-items: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//set-items: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//set-items: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//set-items: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//set-items: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//set-items: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []*container.TabItem switch v := arg1.(type) { @@ -55422,39 +53455,32 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg1Val[i], ok = v.Value.(*container.TabItem) - if !ok { + if vc, ok := v.Value.(*container.TabItem); ok { + arg1Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//set-items: arg 2: block item: expected native of type *container.TabItem") + return env.NewError("Go(*container.AppTabs)//set-items: arg 2: " + "block item: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//set-items: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//set-items: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val[i] = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//set-items: arg 2: block item: expected native") + return env.NewError("Go(*container.AppTabs)//set-items: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]*container.TabItem) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//set-items: arg 2: expected native of type []*container.TabItem") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//set-items: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//set-items: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//set-items: arg 2: expected block, native or nil") + return env.NewError("Go(*container.AppTabs)//set-items: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetItems(arg1Val) return arg0 @@ -55467,21 +53493,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//set-tab-location: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//set-tab-location: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//set-tab-location: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//set-tab-location: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//set-tab-location: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//set-tab-location: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val container.TabLocation { @@ -55495,11 +53521,11 @@ var Builtins = map[string]*env.Builtin{ arg1Val = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//set-tab-location: arg 2: expected integer") + return env.NewError("Go(*container.AppTabs)//set-tab-location: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg1Val = container.TabLocation(u) } @@ -55515,21 +53541,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//show: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//show: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//show: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -55542,21 +53568,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//size: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//size: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//size: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -55571,21 +53597,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.AppTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.AppTabs) - if !ok { + if vc, ok := v.Value.(*container.AppTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//visible: arg 1: expected native of type *container.AppTabs") + return env.NewError("Go(*container.AppTabs)//visible: arg 1: " + "expected native of type *container.AppTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.AppTabs)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.AppTabs)//visible: arg 1: expected native") + return env.NewError("Go(*container.AppTabs)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -55600,45 +53626,119 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//append: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//append: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//append: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *container.TabItem switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*container.TabItem) - if !ok { + if vc, ok := v.Value.(*container.TabItem); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//append: arg 2: expected native of type *container.TabItem") + return env.NewError("Go(*container.DocTabs)//append: arg 2: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//append: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//append: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//append: arg 2: expected native") + return env.NewError("Go(*container.DocTabs)//append: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Append(arg1Val) return arg0 }, }, + "Go(*container.DocTabs)//base-widget!": { + Doc: "Set *container.DocTabs BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *container.DocTabs + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*container.DocTabs); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*container.DocTabs)//base-widget!: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*container.DocTabs)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*container.DocTabs)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*container.DocTabs)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*container.DocTabs)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*container.DocTabs)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*container.DocTabs)//base-widget?": { + Doc: "Get *container.DocTabs BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *container.DocTabs + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*container.DocTabs); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*container.DocTabs)//base-widget?: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*container.DocTabs)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*container.DocTabs)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj + }, + }, "Go(*container.DocTabs)//close-intercept!": { Doc: "Set *container.DocTabs CloseIntercept value", Argsn: 2, @@ -55646,45 +53746,47 @@ var Builtins = map[string]*env.Builtin{ var self *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//close-intercept!: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//close-intercept!: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//close-intercept!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//close-intercept!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//close-intercept!: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//close-intercept!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(*container.TabItem) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//close-intercept!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*container.DocTabs)//close-intercept!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.CloseIntercept = func(arg0 *container.TabItem) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*container.TabItem)") + newVal = func(farg0 *container.TabItem) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*container.TabItem)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//close-intercept!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//close-intercept!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.CloseIntercept = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//close-intercept!: arg 2: expected function or nil") + return env.NewError("Go(*container.DocTabs)//close-intercept!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.CloseIntercept = newVal return arg0 }, }, @@ -55695,24 +53797,46 @@ var Builtins = map[string]*env.Builtin{ var self *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//close-intercept?: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//close-intercept?: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//close-intercept?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//close-intercept?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//close-intercept?: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//close-intercept?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.CloseIntercept, "Go(func(*container.TabItem))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val *container.TabItem + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*container.TabItem); ok { + arg0Val = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*container.DocTabs)//close-intercept?: arg 1: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*container.DocTabs)//close-intercept?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg0Val = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*container.DocTabs)//close-intercept?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.CloseIntercept(arg0Val) + return nil + }, 1, false, false, "Returned func") return resObj }, }, @@ -55723,42 +53847,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//create-renderer: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//create-renderer: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//create-renderer: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -55769,40 +53876,42 @@ var Builtins = map[string]*env.Builtin{ var self *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//create-tab!: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//create-tab!: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//create-tab!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//create-tab!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//create-tab!: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//create-tab!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func() *container.TabItem switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//create-tab!: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(*container.DocTabs)//create-tab!: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.CreateTab = func() *container.TabItem { + newVal = func() *container.TabItem { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, ps.Ctx) var res *container.TabItem switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(*container.TabItem) - if !ok { + if vc, ok := v.Value.(*container.TabItem); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*container.DocTabs)//create-tab!: arg 2: callback result: expected native of type *container.TabItem", + "Go(*container.DocTabs)//create-tab!: arg 2: callback result: "+"expected native of type *container.TabItem, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -55810,8 +53919,9 @@ var Builtins = map[string]*env.Builtin{ } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*container.DocTabs)//create-tab!: arg 2: callback result: expected integer to be 0 or nil", + "Go(*container.DocTabs)//create-tab!: arg 2: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -55819,8 +53929,9 @@ var Builtins = map[string]*env.Builtin{ } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*container.DocTabs)//create-tab!: arg 2: callback result: expected native", + "Go(*container.DocTabs)//create-tab!: arg 2: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -55831,13 +53942,14 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//create-tab!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//create-tab!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.CreateTab = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//create-tab!: arg 2: expected function or nil") + return env.NewError("Go(*container.DocTabs)//create-tab!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.CreateTab = newVal return arg0 }, }, @@ -55848,24 +53960,29 @@ var Builtins = map[string]*env.Builtin{ var self *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//create-tab?: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//create-tab?: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//create-tab?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//create-tab?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//create-tab?: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//create-tab?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.CreateTab, "Go(func() (*container.TabItem))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + res0 := self.CreateTab() + var res0Obj env.Object + res0Obj = *env.NewNative(ps.Idx, res0, "Go(*container.TabItem)") + return res0Obj + }, 0, false, false, "Returned func") return resObj }, }, @@ -55876,28 +53993,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//disable-index: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//disable-index: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//disable-index: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//disable-index: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//disable-index: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//disable-index: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//disable-index: arg 2: expected integer") + return env.NewError("Go(*container.DocTabs)//disable-index: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.DisableIndex(arg1Val) return arg0 @@ -55910,40 +54027,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//disable-item: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//disable-item: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//disable-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//disable-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//disable-item: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//disable-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *container.TabItem switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*container.TabItem) - if !ok { + if vc, ok := v.Value.(*container.TabItem); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//disable-item: arg 2: expected native of type *container.TabItem") + return env.NewError("Go(*container.DocTabs)//disable-item: arg 2: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//disable-item: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//disable-item: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//disable-item: arg 2: expected native") + return env.NewError("Go(*container.DocTabs)//disable-item: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.DisableItem(arg1Val) return arg0 @@ -55956,28 +54073,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//enable-index: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//enable-index: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//enable-index: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//enable-index: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//enable-index: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//enable-index: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//enable-index: arg 2: expected integer") + return env.NewError("Go(*container.DocTabs)//enable-index: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.EnableIndex(arg1Val) return arg0 @@ -55990,40 +54107,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//enable-item: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//enable-item: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//enable-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//enable-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//enable-item: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//enable-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *container.TabItem switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*container.TabItem) - if !ok { + if vc, ok := v.Value.(*container.TabItem); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//enable-item: arg 2: expected native of type *container.TabItem") + return env.NewError("Go(*container.DocTabs)//enable-item: arg 2: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//enable-item: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//enable-item: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//enable-item: arg 2: expected native") + return env.NewError("Go(*container.DocTabs)//enable-item: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.EnableItem(arg1Val) return arg0 @@ -56036,21 +54153,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//extend-base-widget: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//extend-base-widget: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -56059,24 +54176,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*container.DocTabs)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*container.DocTabs)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*container.DocTabs)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -56089,28 +54206,30 @@ var Builtins = map[string]*env.Builtin{ var self *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//hidden!: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//hidden!: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//hidden!: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//hidden!: arg 2: expected integer") + return env.NewError("Go(*container.DocTabs)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -56121,21 +54240,21 @@ var Builtins = map[string]*env.Builtin{ var self *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//hidden?: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//hidden?: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//hidden?: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -56149,21 +54268,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//hide: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//hide: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//hide: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -56176,62 +54295,57 @@ var Builtins = map[string]*env.Builtin{ var self *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//items!: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//items!: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//items!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//items!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//items!: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//items!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal []*container.TabItem switch v := arg1.(type) { case env.Block: - self.Items = make([]*container.TabItem, len(v.Series.S)) + newVal = make([]*container.TabItem, len(v.Series.S)) for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - self.Items[i], ok = v.Value.(*container.TabItem) - if !ok { + if vc, ok := v.Value.(*container.TabItem); ok { + newVal[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//items!: arg 2: block item: expected native of type *container.TabItem") + return env.NewError("Go(*container.DocTabs)//items!: arg 2: " + "block item: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//items!: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//items!: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Items[i] = nil + newVal[i] = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//items!: arg 2: block item: expected native") + return env.NewError("Go(*container.DocTabs)//items!: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - self.Items, ok = v.Value.([]*container.TabItem) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//items!: arg 2: expected native of type []*container.TabItem") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//items!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//items!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Items = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//items!: arg 2: expected block, native or nil") + return env.NewError("Go(*container.DocTabs)//items!: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } + self.Items = newVal return arg0 }, }, @@ -56242,21 +54356,21 @@ var Builtins = map[string]*env.Builtin{ var self *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//items?: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//items?: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//items?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//items?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//items?: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//items?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object { @@ -56276,21 +54390,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//min-size: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//min-size: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//min-size: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -56305,42 +54419,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//move: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//move: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//move: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//move: arg 2: expected native") + return env.NewError("Go(*container.DocTabs)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -56351,45 +54459,47 @@ var Builtins = map[string]*env.Builtin{ var self *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//on-closed!: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//on-closed!: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//on-closed!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//on-closed!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//on-closed!: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//on-closed!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(*container.TabItem) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//on-closed!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*container.DocTabs)//on-closed!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnClosed = func(arg0 *container.TabItem) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*container.TabItem)") + newVal = func(farg0 *container.TabItem) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*container.TabItem)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//on-closed!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//on-closed!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnClosed = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//on-closed!: arg 2: expected function or nil") + return env.NewError("Go(*container.DocTabs)//on-closed!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnClosed = newVal return arg0 }, }, @@ -56400,24 +54510,46 @@ var Builtins = map[string]*env.Builtin{ var self *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//on-closed?: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//on-closed?: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//on-closed?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//on-closed?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//on-closed?: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//on-closed?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnClosed, "Go(func(*container.TabItem))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val *container.TabItem + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*container.TabItem); ok { + arg0Val = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*container.DocTabs)//on-closed?: arg 1: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*container.DocTabs)//on-closed?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg0Val = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*container.DocTabs)//on-closed?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.OnClosed(arg0Val) + return nil + }, 1, false, false, "Returned func") return resObj }, }, @@ -56428,45 +54560,47 @@ var Builtins = map[string]*env.Builtin{ var self *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//on-selected!: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//on-selected!: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//on-selected!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//on-selected!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//on-selected!: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//on-selected!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(*container.TabItem) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//on-selected!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*container.DocTabs)//on-selected!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnSelected = func(arg0 *container.TabItem) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*container.TabItem)") + newVal = func(farg0 *container.TabItem) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*container.TabItem)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//on-selected!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//on-selected!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnSelected = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//on-selected!: arg 2: expected function or nil") + return env.NewError("Go(*container.DocTabs)//on-selected!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnSelected = newVal return arg0 }, }, @@ -56477,24 +54611,46 @@ var Builtins = map[string]*env.Builtin{ var self *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//on-selected?: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//on-selected?: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//on-selected?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//on-selected?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//on-selected?: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//on-selected?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnSelected, "Go(func(*container.TabItem))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val *container.TabItem + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*container.TabItem); ok { + arg0Val = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*container.DocTabs)//on-selected?: arg 1: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*container.DocTabs)//on-selected?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg0Val = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*container.DocTabs)//on-selected?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.OnSelected(arg0Val) + return nil + }, 1, false, false, "Returned func") return resObj }, }, @@ -56505,45 +54661,47 @@ var Builtins = map[string]*env.Builtin{ var self *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//on-unselected!: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//on-unselected!: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//on-unselected!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//on-unselected!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//on-unselected!: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//on-unselected!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(*container.TabItem) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//on-unselected!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*container.DocTabs)//on-unselected!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnUnselected = func(arg0 *container.TabItem) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*container.TabItem)") + newVal = func(farg0 *container.TabItem) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*container.TabItem)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//on-unselected!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//on-unselected!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnUnselected = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//on-unselected!: arg 2: expected function or nil") + return env.NewError("Go(*container.DocTabs)//on-unselected!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnUnselected = newVal return arg0 }, }, @@ -56554,24 +54712,46 @@ var Builtins = map[string]*env.Builtin{ var self *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//on-unselected?: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//on-unselected?: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//on-unselected?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//on-unselected?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//on-unselected?: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//on-unselected?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnUnselected, "Go(func(*container.TabItem))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val *container.TabItem + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*container.TabItem); ok { + arg0Val = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*container.DocTabs)//on-unselected?: arg 1: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*container.DocTabs)//on-unselected?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg0Val = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*container.DocTabs)//on-unselected?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.OnUnselected(arg0Val) + return nil + }, 1, false, false, "Returned func") return resObj }, }, @@ -56582,21 +54762,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//position: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//position: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//position: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -56611,21 +54791,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//refresh: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//refresh: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//refresh: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -56638,40 +54818,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//remove: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//remove: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//remove: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//remove: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//remove: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//remove: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *container.TabItem switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*container.TabItem) - if !ok { + if vc, ok := v.Value.(*container.TabItem); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//remove: arg 2: expected native of type *container.TabItem") + return env.NewError("Go(*container.DocTabs)//remove: arg 2: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//remove: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//remove: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//remove: arg 2: expected native") + return env.NewError("Go(*container.DocTabs)//remove: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Remove(arg1Val) return arg0 @@ -56684,28 +54864,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//remove-index: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//remove-index: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//remove-index: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//remove-index: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//remove-index: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//remove-index: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//remove-index: arg 2: expected integer") + return env.NewError("Go(*container.DocTabs)//remove-index: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.RemoveIndex(arg1Val) return arg0 @@ -56718,42 +54898,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//resize: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//resize: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//resize: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//resize: arg 2: expected native") + return env.NewError("Go(*container.DocTabs)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -56764,40 +54938,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//select: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//select: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//select: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//select: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//select: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//select: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *container.TabItem switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*container.TabItem) - if !ok { + if vc, ok := v.Value.(*container.TabItem); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//select: arg 2: expected native of type *container.TabItem") + return env.NewError("Go(*container.DocTabs)//select: arg 2: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//select: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//select: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//select: arg 2: expected native") + return env.NewError("Go(*container.DocTabs)//select: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Select(arg1Val) return arg0 @@ -56810,28 +54984,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//select-index: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//select-index: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//select-index: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//select-index: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//select-index: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//select-index: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//select-index: arg 2: expected integer") + return env.NewError("Go(*container.DocTabs)//select-index: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SelectIndex(arg1Val) return arg0 @@ -56844,21 +55018,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//selected: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//selected: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//selected: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//selected: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//selected: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//selected: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Selected() var res0Obj env.Object @@ -56873,21 +55047,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//selected-index: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//selected-index: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//selected-index: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//selected-index: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//selected-index: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//selected-index: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.SelectedIndex() var res0Obj env.Object @@ -56902,21 +55076,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//set-items: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//set-items: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//set-items: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//set-items: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//set-items: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//set-items: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []*container.TabItem switch v := arg1.(type) { @@ -56925,39 +55099,32 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg1Val[i], ok = v.Value.(*container.TabItem) - if !ok { + if vc, ok := v.Value.(*container.TabItem); ok { + arg1Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//set-items: arg 2: block item: expected native of type *container.TabItem") + return env.NewError("Go(*container.DocTabs)//set-items: arg 2: " + "block item: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//set-items: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//set-items: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val[i] = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//set-items: arg 2: block item: expected native") + return env.NewError("Go(*container.DocTabs)//set-items: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]*container.TabItem) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//set-items: arg 2: expected native of type []*container.TabItem") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//set-items: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//set-items: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//set-items: arg 2: expected block, native or nil") + return env.NewError("Go(*container.DocTabs)//set-items: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetItems(arg1Val) return arg0 @@ -56970,21 +55137,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//set-tab-location: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//set-tab-location: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//set-tab-location: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//set-tab-location: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//set-tab-location: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//set-tab-location: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val container.TabLocation { @@ -56998,11 +55165,11 @@ var Builtins = map[string]*env.Builtin{ arg1Val = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//set-tab-location: arg 2: expected integer") + return env.NewError("Go(*container.DocTabs)//set-tab-location: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg1Val = container.TabLocation(u) } @@ -57018,21 +55185,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//show: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//show: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//show: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -57045,21 +55212,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//size: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//size: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//size: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -57074,21 +55241,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.DocTabs switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.DocTabs) - if !ok { + if vc, ok := v.Value.(*container.DocTabs); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//visible: arg 1: expected native of type *container.DocTabs") + return env.NewError("Go(*container.DocTabs)//visible: arg 1: " + "expected native of type *container.DocTabs, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.DocTabs)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.DocTabs)//visible: arg 1: expected native") + return env.NewError("Go(*container.DocTabs)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -57096,6 +55263,80 @@ var Builtins = map[string]*env.Builtin{ return res0Obj }, }, + "Go(*container.Split)//base-widget!": { + Doc: "Set *container.Split BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *container.Split + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*container.Split); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*container.Split)//base-widget!: arg 1: " + "expected native of type *container.Split, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*container.Split)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*container.Split)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*container.Split)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*container.Split)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*container.Split)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*container.Split)//base-widget?": { + Doc: "Get *container.Split BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *container.Split + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*container.Split); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*container.Split)//base-widget?: arg 1: " + "expected native of type *container.Split, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*container.Split)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*container.Split)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj + }, + }, "Go(*container.Split)//create-renderer": { Doc: "(*container.Split).CreateRenderer", Argsn: 1, @@ -57103,42 +55344,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.Split switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.Split) - if !ok { + if vc, ok := v.Value.(*container.Split); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//create-renderer: arg 1: expected native of type *container.Split") + return env.NewError("Go(*container.Split)//create-renderer: arg 1: " + "expected native of type *container.Split, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.Split)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.Split)//create-renderer: arg 1: expected native") + return env.NewError("Go(*container.Split)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -57149,21 +55373,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.Split switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.Split) - if !ok { + if vc, ok := v.Value.(*container.Split); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//extend-base-widget: arg 1: expected native of type *container.Split") + return env.NewError("Go(*container.Split)//extend-base-widget: arg 1: " + "expected native of type *container.Split, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.Split)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.Split)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*container.Split)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -57172,24 +55396,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*container.Split)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*container.Split)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.Split)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.Split)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*container.Split)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -57202,28 +55426,30 @@ var Builtins = map[string]*env.Builtin{ var self *container.Split switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.Split) - if !ok { + if vc, ok := v.Value.(*container.Split); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//hidden!: arg 1: expected native of type *container.Split") + return env.NewError("Go(*container.Split)//hidden!: arg 1: " + "expected native of type *container.Split, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.Split)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.Split)//hidden!: arg 1: expected native") + return env.NewError("Go(*container.Split)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//hidden!: arg 2: expected integer") + return env.NewError("Go(*container.Split)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -57234,21 +55460,21 @@ var Builtins = map[string]*env.Builtin{ var self *container.Split switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.Split) - if !ok { + if vc, ok := v.Value.(*container.Split); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//hidden?: arg 1: expected native of type *container.Split") + return env.NewError("Go(*container.Split)//hidden?: arg 1: " + "expected native of type *container.Split, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.Split)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.Split)//hidden?: arg 1: expected native") + return env.NewError("Go(*container.Split)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -57262,21 +55488,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.Split switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.Split) - if !ok { + if vc, ok := v.Value.(*container.Split); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//hide: arg 1: expected native of type *container.Split") + return env.NewError("Go(*container.Split)//hide: arg 1: " + "expected native of type *container.Split, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.Split)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.Split)//hide: arg 1: expected native") + return env.NewError("Go(*container.Split)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -57289,28 +55515,30 @@ var Builtins = map[string]*env.Builtin{ var self *container.Split switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.Split) - if !ok { + if vc, ok := v.Value.(*container.Split); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//horizontal!: arg 1: expected native of type *container.Split") + return env.NewError("Go(*container.Split)//horizontal!: arg 1: " + "expected native of type *container.Split, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//horizontal!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.Split)//horizontal!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.Split)//horizontal!: arg 1: expected native") + return env.NewError("Go(*container.Split)//horizontal!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Horizontal = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//horizontal!: arg 2: expected integer") + return env.NewError("Go(*container.Split)//horizontal!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Horizontal = newVal return arg0 }, }, @@ -57321,21 +55549,21 @@ var Builtins = map[string]*env.Builtin{ var self *container.Split switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.Split) - if !ok { + if vc, ok := v.Value.(*container.Split); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//horizontal?: arg 1: expected native of type *container.Split") + return env.NewError("Go(*container.Split)//horizontal?: arg 1: " + "expected native of type *container.Split, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//horizontal?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.Split)//horizontal?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.Split)//horizontal?: arg 1: expected native") + return env.NewError("Go(*container.Split)//horizontal?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Horizontal)) @@ -57349,47 +55577,49 @@ var Builtins = map[string]*env.Builtin{ var self *container.Split switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.Split) - if !ok { + if vc, ok := v.Value.(*container.Split); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//leading!: arg 1: expected native of type *container.Split") + return env.NewError("Go(*container.Split)//leading!: arg 1: " + "expected native of type *container.Split, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//leading!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.Split)//leading!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.Split)//leading!: arg 1: expected native") + return env.NewError("Go(*container.Split)//leading!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.CanvasObject switch v := arg1.(type) { case env.RyeCtx: var err error - self.Leading, err = ctxTo_fyne_CanvasObject(ps, v) + newVal, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//leading!: arg 2: " + err.Error() + "") + return env.NewError("Go(*container.Split)//leading!: arg 2: " + err.Error()) } case env.Native: - var ok bool - self.Leading, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//leading!: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("Go(*container.Split)//leading!: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//leading!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.Split)//leading!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Leading = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.Split)//leading!: arg 2: expected native") + return env.NewError("Go(*container.Split)//leading!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Leading = newVal return arg0 }, }, @@ -57400,41 +55630,24 @@ var Builtins = map[string]*env.Builtin{ var self *container.Split switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.Split) - if !ok { + if vc, ok := v.Value.(*container.Split); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//leading?: arg 1: expected native of type *container.Split") + return env.NewError("Go(*container.Split)//leading?: arg 1: " + "expected native of type *container.Split, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//leading?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.Split)//leading?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.Split)//leading?: arg 1: expected native") + return env.NewError("Go(*container.Split)//leading?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - { - typ := reflect.TypeOf(self.Leading) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - resObj = *env.NewNative(ps.Idx, self.Leading, typRyeName) - } else { - resObj = *env.NewNative(ps.Idx, self.Leading, "Go(fyne.CanvasObject)") - } - } + resObj = ifaceToNative(ps.Idx, self.Leading, "Go(fyne.CanvasObject)") return resObj }, }, @@ -57445,21 +55658,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.Split switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.Split) - if !ok { + if vc, ok := v.Value.(*container.Split); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//min-size: arg 1: expected native of type *container.Split") + return env.NewError("Go(*container.Split)//min-size: arg 1: " + "expected native of type *container.Split, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.Split)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.Split)//min-size: arg 1: expected native") + return env.NewError("Go(*container.Split)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -57474,42 +55687,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.Split switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.Split) - if !ok { + if vc, ok := v.Value.(*container.Split); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//move: arg 1: expected native of type *container.Split") + return env.NewError("Go(*container.Split)//move: arg 1: " + "expected native of type *container.Split, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.Split)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.Split)//move: arg 1: expected native") + return env.NewError("Go(*container.Split)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*container.Split)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.Split)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.Split)//move: arg 2: expected native") + return env.NewError("Go(*container.Split)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -57520,28 +55727,30 @@ var Builtins = map[string]*env.Builtin{ var self *container.Split switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.Split) - if !ok { + if vc, ok := v.Value.(*container.Split); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//offset!: arg 1: expected native of type *container.Split") + return env.NewError("Go(*container.Split)//offset!: arg 1: " + "expected native of type *container.Split, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//offset!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.Split)//offset!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.Split)//offset!: arg 1: expected native") + return env.NewError("Go(*container.Split)//offset!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Decimal); ok { - self.Offset = float64(v.Value) + var newVal float64 + if vc, ok := arg1.(env.Decimal); ok { + newVal = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//offset!: arg 2: expected decimal") + return env.NewError("Go(*container.Split)//offset!: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } + self.Offset = newVal return arg0 }, }, @@ -57552,21 +55761,21 @@ var Builtins = map[string]*env.Builtin{ var self *container.Split switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.Split) - if !ok { + if vc, ok := v.Value.(*container.Split); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//offset?: arg 1: expected native of type *container.Split") + return env.NewError("Go(*container.Split)//offset?: arg 1: " + "expected native of type *container.Split, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//offset?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.Split)//offset?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.Split)//offset?: arg 1: expected native") + return env.NewError("Go(*container.Split)//offset?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewDecimal(float64(self.Offset)) @@ -57580,21 +55789,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.Split switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.Split) - if !ok { + if vc, ok := v.Value.(*container.Split); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//position: arg 1: expected native of type *container.Split") + return env.NewError("Go(*container.Split)//position: arg 1: " + "expected native of type *container.Split, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.Split)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.Split)//position: arg 1: expected native") + return env.NewError("Go(*container.Split)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -57609,21 +55818,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.Split switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.Split) - if !ok { + if vc, ok := v.Value.(*container.Split); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//refresh: arg 1: expected native of type *container.Split") + return env.NewError("Go(*container.Split)//refresh: arg 1: " + "expected native of type *container.Split, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.Split)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.Split)//refresh: arg 1: expected native") + return env.NewError("Go(*container.Split)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -57636,42 +55845,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.Split switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.Split) - if !ok { + if vc, ok := v.Value.(*container.Split); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//resize: arg 1: expected native of type *container.Split") + return env.NewError("Go(*container.Split)//resize: arg 1: " + "expected native of type *container.Split, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.Split)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.Split)//resize: arg 1: expected native") + return env.NewError("Go(*container.Split)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*container.Split)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.Split)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.Split)//resize: arg 2: expected native") + return env.NewError("Go(*container.Split)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -57682,28 +55885,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.Split switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.Split) - if !ok { + if vc, ok := v.Value.(*container.Split); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//set-offset: arg 1: expected native of type *container.Split") + return env.NewError("Go(*container.Split)//set-offset: arg 1: " + "expected native of type *container.Split, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//set-offset: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.Split)//set-offset: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.Split)//set-offset: arg 1: expected native") + return env.NewError("Go(*container.Split)//set-offset: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val float64 - if v, ok := arg1.(env.Decimal); ok { - arg1Val = float64(v.Value) + if vc, ok := arg1.(env.Decimal); ok { + arg1Val = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//set-offset: arg 2: expected decimal") + return env.NewError("Go(*container.Split)//set-offset: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetOffset(arg1Val) return arg0 @@ -57716,21 +55919,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.Split switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.Split) - if !ok { + if vc, ok := v.Value.(*container.Split); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//show: arg 1: expected native of type *container.Split") + return env.NewError("Go(*container.Split)//show: arg 1: " + "expected native of type *container.Split, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.Split)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.Split)//show: arg 1: expected native") + return env.NewError("Go(*container.Split)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -57743,21 +55946,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.Split switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.Split) - if !ok { + if vc, ok := v.Value.(*container.Split); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//size: arg 1: expected native of type *container.Split") + return env.NewError("Go(*container.Split)//size: arg 1: " + "expected native of type *container.Split, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.Split)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.Split)//size: arg 1: expected native") + return env.NewError("Go(*container.Split)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -57772,47 +55975,49 @@ var Builtins = map[string]*env.Builtin{ var self *container.Split switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.Split) - if !ok { + if vc, ok := v.Value.(*container.Split); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//trailing!: arg 1: expected native of type *container.Split") + return env.NewError("Go(*container.Split)//trailing!: arg 1: " + "expected native of type *container.Split, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//trailing!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.Split)//trailing!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.Split)//trailing!: arg 1: expected native") + return env.NewError("Go(*container.Split)//trailing!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.CanvasObject switch v := arg1.(type) { case env.RyeCtx: var err error - self.Trailing, err = ctxTo_fyne_CanvasObject(ps, v) + newVal, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//trailing!: arg 2: " + err.Error() + "") + return env.NewError("Go(*container.Split)//trailing!: arg 2: " + err.Error()) } case env.Native: - var ok bool - self.Trailing, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//trailing!: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("Go(*container.Split)//trailing!: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//trailing!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.Split)//trailing!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Trailing = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.Split)//trailing!: arg 2: expected native") + return env.NewError("Go(*container.Split)//trailing!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Trailing = newVal return arg0 }, }, @@ -57823,41 +56028,24 @@ var Builtins = map[string]*env.Builtin{ var self *container.Split switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.Split) - if !ok { + if vc, ok := v.Value.(*container.Split); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//trailing?: arg 1: expected native of type *container.Split") + return env.NewError("Go(*container.Split)//trailing?: arg 1: " + "expected native of type *container.Split, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//trailing?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.Split)//trailing?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.Split)//trailing?: arg 1: expected native") + return env.NewError("Go(*container.Split)//trailing?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - { - typ := reflect.TypeOf(self.Trailing) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - resObj = *env.NewNative(ps.Idx, self.Trailing, typRyeName) - } else { - resObj = *env.NewNative(ps.Idx, self.Trailing, "Go(fyne.CanvasObject)") - } - } + resObj = ifaceToNative(ps.Idx, self.Trailing, "Go(fyne.CanvasObject)") return resObj }, }, @@ -57868,21 +56056,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.Split switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.Split) - if !ok { + if vc, ok := v.Value.(*container.Split); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//visible: arg 1: expected native of type *container.Split") + return env.NewError("Go(*container.Split)//visible: arg 1: " + "expected native of type *container.Split, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.Split)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.Split)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.Split)//visible: arg 1: expected native") + return env.NewError("Go(*container.Split)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -57897,47 +56085,49 @@ var Builtins = map[string]*env.Builtin{ var self *container.TabItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.TabItem) - if !ok { + if vc, ok := v.Value.(*container.TabItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//content!: arg 1: expected native of type *container.TabItem") + return env.NewError("Go(*container.TabItem)//content!: arg 1: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//content!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.TabItem)//content!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//content!: arg 1: expected native") + return env.NewError("Go(*container.TabItem)//content!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.CanvasObject switch v := arg1.(type) { case env.RyeCtx: var err error - self.Content, err = ctxTo_fyne_CanvasObject(ps, v) + newVal, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//content!: arg 2: " + err.Error() + "") + return env.NewError("Go(*container.TabItem)//content!: arg 2: " + err.Error()) } case env.Native: - var ok bool - self.Content, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//content!: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("Go(*container.TabItem)//content!: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//content!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.TabItem)//content!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Content = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//content!: arg 2: expected native") + return env.NewError("Go(*container.TabItem)//content!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Content = newVal return arg0 }, }, @@ -57948,41 +56138,24 @@ var Builtins = map[string]*env.Builtin{ var self *container.TabItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.TabItem) - if !ok { + if vc, ok := v.Value.(*container.TabItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//content?: arg 1: expected native of type *container.TabItem") + return env.NewError("Go(*container.TabItem)//content?: arg 1: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//content?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.TabItem)//content?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//content?: arg 1: expected native") + return env.NewError("Go(*container.TabItem)//content?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - { - typ := reflect.TypeOf(self.Content) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - resObj = *env.NewNative(ps.Idx, self.Content, typRyeName) - } else { - resObj = *env.NewNative(ps.Idx, self.Content, "Go(fyne.CanvasObject)") - } - } + resObj = ifaceToNative(ps.Idx, self.Content, "Go(fyne.CanvasObject)") return resObj }, }, @@ -57993,21 +56166,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *container.TabItem switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*container.TabItem) - if !ok { + if vc, ok := v.Value.(*container.TabItem); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//disabled: arg 1: expected native of type *container.TabItem") + return env.NewError("Go(*container.TabItem)//disabled: arg 1: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//disabled: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.TabItem)//disabled: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//disabled: arg 1: expected native") + return env.NewError("Go(*container.TabItem)//disabled: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Disabled() var res0Obj env.Object @@ -58022,47 +56195,49 @@ var Builtins = map[string]*env.Builtin{ var self *container.TabItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.TabItem) - if !ok { + if vc, ok := v.Value.(*container.TabItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//icon!: arg 1: expected native of type *container.TabItem") + return env.NewError("Go(*container.TabItem)//icon!: arg 1: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//icon!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.TabItem)//icon!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//icon!: arg 1: expected native") + return env.NewError("Go(*container.TabItem)//icon!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.Resource switch v := arg1.(type) { case env.RyeCtx: var err error - self.Icon, err = ctxTo_fyne_Resource(ps, v) + newVal, err = ctxTo_fyne_Resource(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//icon!: arg 2: " + err.Error() + "") + return env.NewError("Go(*container.TabItem)//icon!: arg 2: " + err.Error()) } case env.Native: - var ok bool - self.Icon, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//icon!: arg 2: expected native of type fyne.Resource") + return env.NewError("Go(*container.TabItem)//icon!: arg 2: " + "expected native of type fyne.Resource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//icon!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*container.TabItem)//icon!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Icon = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//icon!: arg 2: expected native") + return env.NewError("Go(*container.TabItem)//icon!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Icon = newVal return arg0 }, }, @@ -58073,41 +56248,24 @@ var Builtins = map[string]*env.Builtin{ var self *container.TabItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.TabItem) - if !ok { + if vc, ok := v.Value.(*container.TabItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//icon?: arg 1: expected native of type *container.TabItem") + return env.NewError("Go(*container.TabItem)//icon?: arg 1: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//icon?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.TabItem)//icon?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//icon?: arg 1: expected native") + return env.NewError("Go(*container.TabItem)//icon?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - { - typ := reflect.TypeOf(self.Icon) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - resObj = *env.NewNative(ps.Idx, self.Icon, typRyeName) - } else { - resObj = *env.NewNative(ps.Idx, self.Icon, "Go(fyne.Resource)") - } - } + resObj = ifaceToNative(ps.Idx, self.Icon, "Go(fyne.Resource)") return resObj }, }, @@ -58118,28 +56276,30 @@ var Builtins = map[string]*env.Builtin{ var self *container.TabItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.TabItem) - if !ok { + if vc, ok := v.Value.(*container.TabItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//text!: arg 1: expected native of type *container.TabItem") + return env.NewError("Go(*container.TabItem)//text!: arg 1: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//text!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.TabItem)//text!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//text!: arg 1: expected native") + return env.NewError("Go(*container.TabItem)//text!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.Text = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//text!: arg 2: expected string") + return env.NewError("Go(*container.TabItem)//text!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.Text = newVal return arg0 }, }, @@ -58150,21 +56310,21 @@ var Builtins = map[string]*env.Builtin{ var self *container.TabItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*container.TabItem) - if !ok { + if vc, ok := v.Value.(*container.TabItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//text?: arg 1: expected native of type *container.TabItem") + return env.NewError("Go(*container.TabItem)//text?: arg 1: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//text?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*container.TabItem)//text?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*container.TabItem)//text?: arg 1: expected native") + return env.NewError("Go(*container.TabItem)//text?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.Text) @@ -58178,21 +56338,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *desktop.CustomShortcut switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*desktop.CustomShortcut) - if !ok { + if vc, ok := v.Value.(*desktop.CustomShortcut); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*desktop.CustomShortcut)//key: arg 1: expected native of type *desktop.CustomShortcut") + return env.NewError("Go(*desktop.CustomShortcut)//key: arg 1: " + "expected native of type *desktop.CustomShortcut, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*desktop.CustomShortcut)//key: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*desktop.CustomShortcut)//key: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*desktop.CustomShortcut)//key: arg 1: expected native") + return env.NewError("Go(*desktop.CustomShortcut)//key: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Key() var res0Obj env.Object @@ -58207,22 +56367,23 @@ var Builtins = map[string]*env.Builtin{ var self *desktop.CustomShortcut switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*desktop.CustomShortcut) - if !ok { + if vc, ok := v.Value.(*desktop.CustomShortcut); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*desktop.CustomShortcut)//key-name!: arg 1: expected native of type *desktop.CustomShortcut") + return env.NewError("Go(*desktop.CustomShortcut)//key-name!: arg 1: " + "expected native of type *desktop.CustomShortcut, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*desktop.CustomShortcut)//key-name!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*desktop.CustomShortcut)//key-name!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*desktop.CustomShortcut)//key-name!: arg 1: expected native") + return env.NewError("Go(*desktop.CustomShortcut)//key-name!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.KeyName { nat, natOk := arg1.(env.Native) var natValOk bool @@ -58231,18 +56392,67 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(fyne.KeyName) } if natValOk { - self.KeyName = natVal + newVal = natVal } else { var u string - if v, ok := arg1.(env.String); ok { - u = string(v.Value) + if vc, ok := arg1.(env.String); ok { + u = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*desktop.CustomShortcut)//key-name!: arg 2: expected string") + return env.NewError("Go(*desktop.CustomShortcut)//key-name!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } - self.KeyName = fyne.KeyName(u) + newVal = fyne.KeyName(u) } } + self.KeyName = newVal + return arg0 + }, + }, + "Go(*desktop.CustomShortcut)//key-name!-1": { + Doc: "Set *desktop.CustomShortcut KeyName value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *desktop.CustomShortcut + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*desktop.CustomShortcut); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*desktop.CustomShortcut)//key-name!-1: arg 1: " + "expected native of type *desktop.CustomShortcut, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*desktop.CustomShortcut)//key-name!-1: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*desktop.CustomShortcut)//key-name!-1: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal fyne.KeyName + { + nat, natOk := arg1.(env.Native) + var natValOk bool + var natVal fyne.KeyName + if natOk { + natVal, natValOk = nat.Value.(fyne.KeyName) + } + if natValOk { + newVal = natVal + } else { + var u string + if vc, ok := arg1.(env.String); ok { + u = string(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*desktop.CustomShortcut)//key-name!-1: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) + } + newVal = fyne.KeyName(u) + } + } + self.KeyName = newVal return arg0 }, }, @@ -58253,21 +56463,49 @@ var Builtins = map[string]*env.Builtin{ var self *desktop.CustomShortcut switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*desktop.CustomShortcut) - if !ok { + if vc, ok := v.Value.(*desktop.CustomShortcut); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*desktop.CustomShortcut)//key-name?: arg 1: expected native of type *desktop.CustomShortcut") + return env.NewError("Go(*desktop.CustomShortcut)//key-name?: arg 1: " + "expected native of type *desktop.CustomShortcut, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*desktop.CustomShortcut)//key-name?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*desktop.CustomShortcut)//key-name?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*desktop.CustomShortcut)//key-name?: arg 1: expected native") + return env.NewError("Go(*desktop.CustomShortcut)//key-name?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewString(string(self.KeyName)) + return resObj + }, + }, + "Go(*desktop.CustomShortcut)//key-name?-1": { + Doc: "Get *desktop.CustomShortcut KeyName value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *desktop.CustomShortcut + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*desktop.CustomShortcut); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*desktop.CustomShortcut)//key-name?-1: arg 1: " + "expected native of type *desktop.CustomShortcut, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*desktop.CustomShortcut)//key-name?-1: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*desktop.CustomShortcut)//key-name?-1: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(string(self.KeyName)) @@ -58281,21 +56519,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *desktop.CustomShortcut switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*desktop.CustomShortcut) - if !ok { + if vc, ok := v.Value.(*desktop.CustomShortcut); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*desktop.CustomShortcut)//mod: arg 1: expected native of type *desktop.CustomShortcut") + return env.NewError("Go(*desktop.CustomShortcut)//mod: arg 1: " + "expected native of type *desktop.CustomShortcut, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*desktop.CustomShortcut)//mod: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*desktop.CustomShortcut)//mod: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*desktop.CustomShortcut)//mod: arg 1: expected native") + return env.NewError("Go(*desktop.CustomShortcut)//mod: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Mod() var res0Obj env.Object @@ -58310,22 +56548,23 @@ var Builtins = map[string]*env.Builtin{ var self *desktop.CustomShortcut switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*desktop.CustomShortcut) - if !ok { + if vc, ok := v.Value.(*desktop.CustomShortcut); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*desktop.CustomShortcut)//modifier!: arg 1: expected native of type *desktop.CustomShortcut") + return env.NewError("Go(*desktop.CustomShortcut)//modifier!: arg 1: " + "expected native of type *desktop.CustomShortcut, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*desktop.CustomShortcut)//modifier!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*desktop.CustomShortcut)//modifier!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*desktop.CustomShortcut)//modifier!: arg 1: expected native") + return env.NewError("Go(*desktop.CustomShortcut)//modifier!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.KeyModifier { nat, natOk := arg1.(env.Native) var natValOk bool @@ -58334,18 +56573,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(fyne.KeyModifier) } if natValOk { - self.Modifier = natVal + newVal = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*desktop.CustomShortcut)//modifier!: arg 2: expected integer") + return env.NewError("Go(*desktop.CustomShortcut)//modifier!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } - self.Modifier = fyne.KeyModifier(u) + newVal = fyne.KeyModifier(u) } } + self.Modifier = newVal return arg0 }, }, @@ -58356,21 +56596,21 @@ var Builtins = map[string]*env.Builtin{ var self *desktop.CustomShortcut switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*desktop.CustomShortcut) - if !ok { + if vc, ok := v.Value.(*desktop.CustomShortcut); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*desktop.CustomShortcut)//modifier?: arg 1: expected native of type *desktop.CustomShortcut") + return env.NewError("Go(*desktop.CustomShortcut)//modifier?: arg 1: " + "expected native of type *desktop.CustomShortcut, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*desktop.CustomShortcut)//modifier?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*desktop.CustomShortcut)//modifier?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*desktop.CustomShortcut)//modifier?: arg 1: expected native") + return env.NewError("Go(*desktop.CustomShortcut)//modifier?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(int(self.Modifier))) @@ -58384,21 +56624,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *desktop.CustomShortcut switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*desktop.CustomShortcut) - if !ok { + if vc, ok := v.Value.(*desktop.CustomShortcut); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*desktop.CustomShortcut)//shortcut-name: arg 1: expected native of type *desktop.CustomShortcut") + return env.NewError("Go(*desktop.CustomShortcut)//shortcut-name: arg 1: " + "expected native of type *desktop.CustomShortcut, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*desktop.CustomShortcut)//shortcut-name: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*desktop.CustomShortcut)//shortcut-name: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*desktop.CustomShortcut)//shortcut-name: arg 1: expected native") + return env.NewError("Go(*desktop.CustomShortcut)//shortcut-name: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.ShortcutName() var res0Obj env.Object @@ -58413,34 +56653,42 @@ var Builtins = map[string]*env.Builtin{ var self *desktop.MouseEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//absolute-position!: arg 1: expected native of type *desktop.MouseEvent") + return env.NewError("Go(*desktop.MouseEvent)//absolute-position!: arg 1: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//absolute-position!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*desktop.MouseEvent)//absolute-position!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//absolute-position!: arg 1: expected native") + return env.NewError("Go(*desktop.MouseEvent)//absolute-position!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal *fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - self.AbsolutePosition, ok = v.Value.(fyne.Position) - if !ok { + if vc, ok := v.Value.(*fyne.Position); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*desktop.MouseEvent)//absolute-position!: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//absolute-position!: arg 2: expected native of type fyne.Position") + return env.NewError("Go(*desktop.MouseEvent)//absolute-position!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//absolute-position!: arg 2: expected native") + return env.NewError("Go(*desktop.MouseEvent)//absolute-position!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.AbsolutePosition = *newVal return arg0 }, }, @@ -58451,21 +56699,21 @@ var Builtins = map[string]*env.Builtin{ var self *desktop.MouseEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//absolute-position?: arg 1: expected native of type *desktop.MouseEvent") + return env.NewError("Go(*desktop.MouseEvent)//absolute-position?: arg 1: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//absolute-position?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*desktop.MouseEvent)//absolute-position?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//absolute-position?: arg 1: expected native") + return env.NewError("Go(*desktop.MouseEvent)//absolute-position?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, &self.AbsolutePosition, "Go(*fyne.Position)") @@ -58479,22 +56727,23 @@ var Builtins = map[string]*env.Builtin{ var self *desktop.MouseEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//button!: arg 1: expected native of type *desktop.MouseEvent") + return env.NewError("Go(*desktop.MouseEvent)//button!: arg 1: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//button!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*desktop.MouseEvent)//button!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//button!: arg 1: expected native") + return env.NewError("Go(*desktop.MouseEvent)//button!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal desktop.MouseButton { nat, natOk := arg1.(env.Native) var natValOk bool @@ -58503,18 +56752,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(desktop.MouseButton) } if natValOk { - self.Button = natVal + newVal = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//button!: arg 2: expected integer") + return env.NewError("Go(*desktop.MouseEvent)//button!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } - self.Button = desktop.MouseButton(u) + newVal = desktop.MouseButton(u) } } + self.Button = newVal return arg0 }, }, @@ -58525,21 +56775,21 @@ var Builtins = map[string]*env.Builtin{ var self *desktop.MouseEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//button?: arg 1: expected native of type *desktop.MouseEvent") + return env.NewError("Go(*desktop.MouseEvent)//button?: arg 1: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//button?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*desktop.MouseEvent)//button?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//button?: arg 1: expected native") + return env.NewError("Go(*desktop.MouseEvent)//button?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(int(self.Button))) @@ -58553,22 +56803,23 @@ var Builtins = map[string]*env.Builtin{ var self *desktop.MouseEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//modifier!: arg 1: expected native of type *desktop.MouseEvent") + return env.NewError("Go(*desktop.MouseEvent)//modifier!: arg 1: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//modifier!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*desktop.MouseEvent)//modifier!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//modifier!: arg 1: expected native") + return env.NewError("Go(*desktop.MouseEvent)//modifier!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.KeyModifier { nat, natOk := arg1.(env.Native) var natValOk bool @@ -58577,18 +56828,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(fyne.KeyModifier) } if natValOk { - self.Modifier = natVal + newVal = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//modifier!: arg 2: expected integer") + return env.NewError("Go(*desktop.MouseEvent)//modifier!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } - self.Modifier = fyne.KeyModifier(u) + newVal = fyne.KeyModifier(u) } } + self.Modifier = newVal return arg0 }, }, @@ -58599,27 +56851,101 @@ var Builtins = map[string]*env.Builtin{ var self *desktop.MouseEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//modifier?: arg 1: expected native of type *desktop.MouseEvent") + return env.NewError("Go(*desktop.MouseEvent)//modifier?: arg 1: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//modifier?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*desktop.MouseEvent)//modifier?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//modifier?: arg 1: expected native") + return env.NewError("Go(*desktop.MouseEvent)//modifier?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(int(self.Modifier))) return resObj }, }, + "Go(*desktop.MouseEvent)//point-event!": { + Doc: "Set *desktop.MouseEvent PointEvent value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *desktop.MouseEvent + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*desktop.MouseEvent)//point-event!: arg 1: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*desktop.MouseEvent)//point-event!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*desktop.MouseEvent)//point-event!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *fyne.PointEvent + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.PointEvent); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*desktop.MouseEvent)//point-event!: arg 2: " + "expected native of type *fyne.PointEvent, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*desktop.MouseEvent)//point-event!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*desktop.MouseEvent)//point-event!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.PointEvent = *newVal + return arg0 + }, + }, + "Go(*desktop.MouseEvent)//point-event?": { + Doc: "Get *desktop.MouseEvent PointEvent value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *desktop.MouseEvent + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*desktop.MouseEvent)//point-event?: arg 1: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*desktop.MouseEvent)//point-event?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*desktop.MouseEvent)//point-event?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.PointEvent, "Go(*fyne.PointEvent)") + return resObj + }, + }, "Go(*desktop.MouseEvent)//position!": { Doc: "Set *desktop.MouseEvent Position value", Argsn: 2, @@ -58627,34 +56953,42 @@ var Builtins = map[string]*env.Builtin{ var self *desktop.MouseEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//position!: arg 1: expected native of type *desktop.MouseEvent") + return env.NewError("Go(*desktop.MouseEvent)//position!: arg 1: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//position!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*desktop.MouseEvent)//position!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//position!: arg 1: expected native") + return env.NewError("Go(*desktop.MouseEvent)//position!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal *fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - self.Position, ok = v.Value.(fyne.Position) - if !ok { + if vc, ok := v.Value.(*fyne.Position); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*desktop.MouseEvent)//position!: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//position!: arg 2: expected native of type fyne.Position") + return env.NewError("Go(*desktop.MouseEvent)//position!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//position!: arg 2: expected native") + return env.NewError("Go(*desktop.MouseEvent)//position!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Position = *newVal return arg0 }, }, @@ -58665,21 +56999,21 @@ var Builtins = map[string]*env.Builtin{ var self *desktop.MouseEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//position?: arg 1: expected native of type *desktop.MouseEvent") + return env.NewError("Go(*desktop.MouseEvent)//position?: arg 1: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//position?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*desktop.MouseEvent)//position?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*desktop.MouseEvent)//position?: arg 1: expected native") + return env.NewError("Go(*desktop.MouseEvent)//position?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, &self.Position, "Go(*fyne.Position)") @@ -58693,28 +57027,30 @@ var Builtins = map[string]*env.Builtin{ var self *dialog.ColorPickerDialog switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*dialog.ColorPickerDialog) - if !ok { + if vc, ok := v.Value.(*dialog.ColorPickerDialog); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.ColorPickerDialog)//advanced!: arg 1: expected native of type *dialog.ColorPickerDialog") + return env.NewError("Go(*dialog.ColorPickerDialog)//advanced!: arg 1: " + "expected native of type *dialog.ColorPickerDialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.ColorPickerDialog)//advanced!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.ColorPickerDialog)//advanced!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.ColorPickerDialog)//advanced!: arg 1: expected native") + return env.NewError("Go(*dialog.ColorPickerDialog)//advanced!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Advanced = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.ColorPickerDialog)//advanced!: arg 2: expected integer") + return env.NewError("Go(*dialog.ColorPickerDialog)//advanced!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Advanced = newVal return arg0 }, }, @@ -58725,21 +57061,21 @@ var Builtins = map[string]*env.Builtin{ var self *dialog.ColorPickerDialog switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*dialog.ColorPickerDialog) - if !ok { + if vc, ok := v.Value.(*dialog.ColorPickerDialog); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.ColorPickerDialog)//advanced?: arg 1: expected native of type *dialog.ColorPickerDialog") + return env.NewError("Go(*dialog.ColorPickerDialog)//advanced?: arg 1: " + "expected native of type *dialog.ColorPickerDialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.ColorPickerDialog)//advanced?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.ColorPickerDialog)//advanced?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.ColorPickerDialog)//advanced?: arg 1: expected native") + return env.NewError("Go(*dialog.ColorPickerDialog)//advanced?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Advanced)) @@ -58753,21 +57089,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *dialog.ColorPickerDialog switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*dialog.ColorPickerDialog) - if !ok { + if vc, ok := v.Value.(*dialog.ColorPickerDialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.ColorPickerDialog)//refresh: arg 1: expected native of type *dialog.ColorPickerDialog") + return env.NewError("Go(*dialog.ColorPickerDialog)//refresh: arg 1: " + "expected native of type *dialog.ColorPickerDialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.ColorPickerDialog)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.ColorPickerDialog)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.ColorPickerDialog)//refresh: arg 1: expected native") + return env.NewError("Go(*dialog.ColorPickerDialog)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -58780,34 +57116,34 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *dialog.ColorPickerDialog switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*dialog.ColorPickerDialog) - if !ok { + if vc, ok := v.Value.(*dialog.ColorPickerDialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.ColorPickerDialog)//set-color: arg 1: expected native of type *dialog.ColorPickerDialog") + return env.NewError("Go(*dialog.ColorPickerDialog)//set-color: arg 1: " + "expected native of type *dialog.ColorPickerDialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.ColorPickerDialog)//set-color: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.ColorPickerDialog)//set-color: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.ColorPickerDialog)//set-color: arg 1: expected native") + return env.NewError("Go(*dialog.ColorPickerDialog)//set-color: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val color.Color switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.ColorPickerDialog)//set-color: arg 2: expected native of type color.Color") + return env.NewError("Go(*dialog.ColorPickerDialog)//set-color: arg 2: " + "expected native of type color.Color, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*dialog.ColorPickerDialog)//set-color: arg 2: expected native") + return env.NewError("Go(*dialog.ColorPickerDialog)//set-color: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetColor(arg1Val) return arg0 @@ -58820,21 +57156,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *dialog.ColorPickerDialog switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*dialog.ColorPickerDialog) - if !ok { + if vc, ok := v.Value.(*dialog.ColorPickerDialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.ColorPickerDialog)//show: arg 1: expected native of type *dialog.ColorPickerDialog") + return env.NewError("Go(*dialog.ColorPickerDialog)//show: arg 1: " + "expected native of type *dialog.ColorPickerDialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.ColorPickerDialog)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.ColorPickerDialog)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.ColorPickerDialog)//show: arg 1: expected native") + return env.NewError("Go(*dialog.ColorPickerDialog)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -58847,21 +57183,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *dialog.ConfirmDialog switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*dialog.ConfirmDialog) - if !ok { + if vc, ok := v.Value.(*dialog.ConfirmDialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.ConfirmDialog)//set-confirm-importance: arg 1: expected native of type *dialog.ConfirmDialog") + return env.NewError("Go(*dialog.ConfirmDialog)//set-confirm-importance: arg 1: " + "expected native of type *dialog.ConfirmDialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.ConfirmDialog)//set-confirm-importance: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.ConfirmDialog)//set-confirm-importance: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.ConfirmDialog)//set-confirm-importance: arg 1: expected native") + return env.NewError("Go(*dialog.ConfirmDialog)//set-confirm-importance: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val widget.Importance { @@ -58875,11 +57211,11 @@ var Builtins = map[string]*env.Builtin{ arg1Val = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.ConfirmDialog)//set-confirm-importance: arg 2: expected integer") + return env.NewError("Go(*dialog.ConfirmDialog)//set-confirm-importance: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg1Val = widget.Importance(u) } @@ -58895,28 +57231,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *dialog.ConfirmDialog switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*dialog.ConfirmDialog) - if !ok { + if vc, ok := v.Value.(*dialog.ConfirmDialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.ConfirmDialog)//set-confirm-text: arg 1: expected native of type *dialog.ConfirmDialog") + return env.NewError("Go(*dialog.ConfirmDialog)//set-confirm-text: arg 1: " + "expected native of type *dialog.ConfirmDialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.ConfirmDialog)//set-confirm-text: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.ConfirmDialog)//set-confirm-text: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.ConfirmDialog)//set-confirm-text: arg 1: expected native") + return env.NewError("Go(*dialog.ConfirmDialog)//set-confirm-text: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.ConfirmDialog)//set-confirm-text: arg 2: expected string") + return env.NewError("Go(*dialog.ConfirmDialog)//set-confirm-text: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetConfirmText(arg1Val) return arg0 @@ -58929,21 +57265,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *dialog.CustomDialog switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*dialog.CustomDialog) - if !ok { + if vc, ok := v.Value.(*dialog.CustomDialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.CustomDialog)//set-buttons: arg 1: expected native of type *dialog.CustomDialog") + return env.NewError("Go(*dialog.CustomDialog)//set-buttons: arg 1: " + "expected native of type *dialog.CustomDialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.CustomDialog)//set-buttons: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.CustomDialog)//set-buttons: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.CustomDialog)//set-buttons: arg 1: expected native") + return env.NewError("Go(*dialog.CustomDialog)//set-buttons: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []fyne.CanvasObject switch v := arg1.(type) { @@ -58956,47 +57292,114 @@ var Builtins = map[string]*env.Builtin{ arg1Val[i], err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*dialog.CustomDialog)//set-buttons: arg 2: block item: " + err.Error() + "") + return env.NewError("Go(*dialog.CustomDialog)//set-buttons: arg 2: " + "block item: " + err.Error()) } case env.Native: - var ok bool - arg1Val[i], ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.CustomDialog)//set-buttons: arg 2: block item: expected native of type fyne.CanvasObject") + return env.NewError("Go(*dialog.CustomDialog)//set-buttons: arg 2: " + "block item: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.CustomDialog)//set-buttons: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.CustomDialog)//set-buttons: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val[i] = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.CustomDialog)//set-buttons: arg 2: block item: expected native") + return env.NewError("Go(*dialog.CustomDialog)//set-buttons: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*dialog.CustomDialog)//set-buttons: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg1Val = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*dialog.CustomDialog)//set-buttons: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) + } + arg0Val.SetButtons(arg1Val) + return arg0 + }, + }, + "Go(*dialog.EntryDialog)//form-dialog!": { + Doc: "Set *dialog.EntryDialog FormDialog value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *dialog.EntryDialog + switch v := arg0.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.([]fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(*dialog.EntryDialog); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.CustomDialog)//set-buttons: arg 2: expected native of type []fyne.CanvasObject") + return env.NewError("Go(*dialog.EntryDialog)//form-dialog!: arg 1: " + "expected native of type *dialog.EntryDialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.CustomDialog)//set-buttons: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.EntryDialog)//form-dialog!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - arg1Val = nil + self = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.CustomDialog)//set-buttons: arg 2: expected block, native or nil") + return env.NewError("Go(*dialog.EntryDialog)//form-dialog!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.SetButtons(arg1Val) + var newVal *dialog.FormDialog + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*dialog.FormDialog); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*dialog.EntryDialog)//form-dialog!: arg 2: " + "expected native of type *dialog.FormDialog, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*dialog.EntryDialog)//form-dialog!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*dialog.EntryDialog)//form-dialog!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.FormDialog = newVal return arg0 }, }, + "Go(*dialog.EntryDialog)//form-dialog?": { + Doc: "Get *dialog.EntryDialog FormDialog value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *dialog.EntryDialog + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*dialog.EntryDialog); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*dialog.EntryDialog)//form-dialog?: arg 1: " + "expected native of type *dialog.EntryDialog, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*dialog.EntryDialog)//form-dialog?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*dialog.EntryDialog)//form-dialog?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, self.FormDialog, "Go(*dialog.FormDialog)") + return resObj + }, + }, "Go(*dialog.EntryDialog)//set-on-closed": { Doc: "(*dialog.EntryDialog).SetOnClosed", Argsn: 2, @@ -59004,28 +57407,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *dialog.EntryDialog switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*dialog.EntryDialog) - if !ok { + if vc, ok := v.Value.(*dialog.EntryDialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.EntryDialog)//set-on-closed: arg 1: expected native of type *dialog.EntryDialog") + return env.NewError("Go(*dialog.EntryDialog)//set-on-closed: arg 1: " + "expected native of type *dialog.EntryDialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.EntryDialog)//set-on-closed: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.EntryDialog)//set-on-closed: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.EntryDialog)//set-on-closed: arg 1: expected native") + return env.NewError("Go(*dialog.EntryDialog)//set-on-closed: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func() switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.EntryDialog)//set-on-closed: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(*dialog.EntryDialog)//set-on-closed: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } arg1Val = func() { actualFn := fn @@ -59035,12 +57438,12 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.EntryDialog)//set-on-closed: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.EntryDialog)//set-on-closed: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.EntryDialog)//set-on-closed: arg 2: expected function or nil") + return env.NewError("Go(*dialog.EntryDialog)//set-on-closed: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } arg0Val.SetOnClosed(arg1Val) return arg0 @@ -59053,28 +57456,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *dialog.EntryDialog switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*dialog.EntryDialog) - if !ok { + if vc, ok := v.Value.(*dialog.EntryDialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.EntryDialog)//set-placeholder: arg 1: expected native of type *dialog.EntryDialog") + return env.NewError("Go(*dialog.EntryDialog)//set-placeholder: arg 1: " + "expected native of type *dialog.EntryDialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.EntryDialog)//set-placeholder: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.EntryDialog)//set-placeholder: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.EntryDialog)//set-placeholder: arg 1: expected native") + return env.NewError("Go(*dialog.EntryDialog)//set-placeholder: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.EntryDialog)//set-placeholder: arg 2: expected string") + return env.NewError("Go(*dialog.EntryDialog)//set-placeholder: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetPlaceholder(arg1Val) return arg0 @@ -59087,28 +57490,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *dialog.EntryDialog switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*dialog.EntryDialog) - if !ok { + if vc, ok := v.Value.(*dialog.EntryDialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.EntryDialog)//set-text: arg 1: expected native of type *dialog.EntryDialog") + return env.NewError("Go(*dialog.EntryDialog)//set-text: arg 1: " + "expected native of type *dialog.EntryDialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.EntryDialog)//set-text: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.EntryDialog)//set-text: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.EntryDialog)//set-text: arg 1: expected native") + return env.NewError("Go(*dialog.EntryDialog)//set-text: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.EntryDialog)//set-text: arg 2: expected string") + return env.NewError("Go(*dialog.EntryDialog)//set-text: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetText(arg1Val) return arg0 @@ -59121,21 +57524,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *dialog.EntryDialog switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*dialog.EntryDialog) - if !ok { + if vc, ok := v.Value.(*dialog.EntryDialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.EntryDialog)//submit: arg 1: expected native of type *dialog.EntryDialog") + return env.NewError("Go(*dialog.EntryDialog)//submit: arg 1: " + "expected native of type *dialog.EntryDialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.EntryDialog)//submit: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.EntryDialog)//submit: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.EntryDialog)//submit: arg 1: expected native") + return env.NewError("Go(*dialog.EntryDialog)//submit: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Submit() return arg0 @@ -59148,21 +57551,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *dialog.FileDialog switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*dialog.FileDialog) - if !ok { + if vc, ok := v.Value.(*dialog.FileDialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//hide: arg 1: expected native of type *dialog.FileDialog") + return env.NewError("Go(*dialog.FileDialog)//hide: arg 1: " + "expected native of type *dialog.FileDialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.FileDialog)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//hide: arg 1: expected native") + return env.NewError("Go(*dialog.FileDialog)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -59175,21 +57578,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *dialog.FileDialog switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*dialog.FileDialog) - if !ok { + if vc, ok := v.Value.(*dialog.FileDialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//min-size: arg 1: expected native of type *dialog.FileDialog") + return env.NewError("Go(*dialog.FileDialog)//min-size: arg 1: " + "expected native of type *dialog.FileDialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.FileDialog)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//min-size: arg 1: expected native") + return env.NewError("Go(*dialog.FileDialog)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -59204,21 +57607,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *dialog.FileDialog switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*dialog.FileDialog) - if !ok { + if vc, ok := v.Value.(*dialog.FileDialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//refresh: arg 1: expected native of type *dialog.FileDialog") + return env.NewError("Go(*dialog.FileDialog)//refresh: arg 1: " + "expected native of type *dialog.FileDialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.FileDialog)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//refresh: arg 1: expected native") + return env.NewError("Go(*dialog.FileDialog)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -59231,42 +57634,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *dialog.FileDialog switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*dialog.FileDialog) - if !ok { + if vc, ok := v.Value.(*dialog.FileDialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//resize: arg 1: expected native of type *dialog.FileDialog") + return env.NewError("Go(*dialog.FileDialog)//resize: arg 1: " + "expected native of type *dialog.FileDialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.FileDialog)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//resize: arg 1: expected native") + return env.NewError("Go(*dialog.FileDialog)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.FileDialog)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//resize: arg 2: expected native") + return env.NewError("Go(*dialog.FileDialog)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -59277,28 +57674,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *dialog.FileDialog switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*dialog.FileDialog) - if !ok { + if vc, ok := v.Value.(*dialog.FileDialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-confirm-text: arg 1: expected native of type *dialog.FileDialog") + return env.NewError("Go(*dialog.FileDialog)//set-confirm-text: arg 1: " + "expected native of type *dialog.FileDialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-confirm-text: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.FileDialog)//set-confirm-text: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-confirm-text: arg 1: expected native") + return env.NewError("Go(*dialog.FileDialog)//set-confirm-text: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-confirm-text: arg 2: expected string") + return env.NewError("Go(*dialog.FileDialog)//set-confirm-text: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetConfirmText(arg1Val) return arg0 @@ -59311,28 +57708,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *dialog.FileDialog switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*dialog.FileDialog) - if !ok { + if vc, ok := v.Value.(*dialog.FileDialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-dismiss-text: arg 1: expected native of type *dialog.FileDialog") + return env.NewError("Go(*dialog.FileDialog)//set-dismiss-text: arg 1: " + "expected native of type *dialog.FileDialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-dismiss-text: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.FileDialog)//set-dismiss-text: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-dismiss-text: arg 1: expected native") + return env.NewError("Go(*dialog.FileDialog)//set-dismiss-text: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-dismiss-text: arg 2: expected string") + return env.NewError("Go(*dialog.FileDialog)//set-dismiss-text: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetDismissText(arg1Val) return arg0 @@ -59345,28 +57742,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *dialog.FileDialog switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*dialog.FileDialog) - if !ok { + if vc, ok := v.Value.(*dialog.FileDialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-file-name: arg 1: expected native of type *dialog.FileDialog") + return env.NewError("Go(*dialog.FileDialog)//set-file-name: arg 1: " + "expected native of type *dialog.FileDialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-file-name: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.FileDialog)//set-file-name: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-file-name: arg 1: expected native") + return env.NewError("Go(*dialog.FileDialog)//set-file-name: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-file-name: arg 2: expected string") + return env.NewError("Go(*dialog.FileDialog)//set-file-name: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetFileName(arg1Val) return arg0 @@ -59379,21 +57776,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *dialog.FileDialog switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*dialog.FileDialog) - if !ok { + if vc, ok := v.Value.(*dialog.FileDialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-filter: arg 1: expected native of type *dialog.FileDialog") + return env.NewError("Go(*dialog.FileDialog)//set-filter: arg 1: " + "expected native of type *dialog.FileDialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-filter: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.FileDialog)//set-filter: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-filter: arg 1: expected native") + return env.NewError("Go(*dialog.FileDialog)//set-filter: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val storage.FileFilter switch v := arg1.(type) { @@ -59402,24 +57799,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_storage_FileFilter(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-filter: arg 2: " + err.Error() + "") + return env.NewError("Go(*dialog.FileDialog)//set-filter: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(storage.FileFilter) - if !ok { + if vc, ok := v.Value.(storage.FileFilter); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-filter: arg 2: expected native of type storage.FileFilter") + return env.NewError("Go(*dialog.FileDialog)//set-filter: arg 2: " + "expected native of type storage.FileFilter, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-filter: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.FileDialog)//set-filter: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-filter: arg 2: expected native") + return env.NewError("Go(*dialog.FileDialog)//set-filter: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetFilter(arg1Val) return arg0 @@ -59432,21 +57829,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *dialog.FileDialog switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*dialog.FileDialog) - if !ok { + if vc, ok := v.Value.(*dialog.FileDialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-location: arg 1: expected native of type *dialog.FileDialog") + return env.NewError("Go(*dialog.FileDialog)//set-location: arg 1: " + "expected native of type *dialog.FileDialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-location: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.FileDialog)//set-location: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-location: arg 1: expected native") + return env.NewError("Go(*dialog.FileDialog)//set-location: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.ListableURI switch v := arg1.(type) { @@ -59455,24 +57852,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_ListableURI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-location: arg 2: " + err.Error() + "") + return env.NewError("Go(*dialog.FileDialog)//set-location: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.ListableURI) - if !ok { + if vc, ok := v.Value.(fyne.ListableURI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-location: arg 2: expected native of type fyne.ListableURI") + return env.NewError("Go(*dialog.FileDialog)//set-location: arg 2: " + "expected native of type fyne.ListableURI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-location: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.FileDialog)//set-location: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-location: arg 2: expected native") + return env.NewError("Go(*dialog.FileDialog)//set-location: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetLocation(arg1Val) return arg0 @@ -59485,28 +57882,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *dialog.FileDialog switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*dialog.FileDialog) - if !ok { + if vc, ok := v.Value.(*dialog.FileDialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-on-closed: arg 1: expected native of type *dialog.FileDialog") + return env.NewError("Go(*dialog.FileDialog)//set-on-closed: arg 1: " + "expected native of type *dialog.FileDialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-on-closed: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.FileDialog)//set-on-closed: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-on-closed: arg 1: expected native") + return env.NewError("Go(*dialog.FileDialog)//set-on-closed: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func() switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-on-closed: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(*dialog.FileDialog)//set-on-closed: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } arg1Val = func() { actualFn := fn @@ -59516,12 +57913,12 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-on-closed: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.FileDialog)//set-on-closed: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//set-on-closed: arg 2: expected function or nil") + return env.NewError("Go(*dialog.FileDialog)//set-on-closed: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } arg0Val.SetOnClosed(arg1Val) return arg0 @@ -59534,21 +57931,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *dialog.FileDialog switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*dialog.FileDialog) - if !ok { + if vc, ok := v.Value.(*dialog.FileDialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//show: arg 1: expected native of type *dialog.FileDialog") + return env.NewError("Go(*dialog.FileDialog)//show: arg 1: " + "expected native of type *dialog.FileDialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.FileDialog)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.FileDialog)//show: arg 1: expected native") + return env.NewError("Go(*dialog.FileDialog)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -59561,21 +57958,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *dialog.FormDialog switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*dialog.FormDialog) - if !ok { + if vc, ok := v.Value.(*dialog.FormDialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.FormDialog)//submit: arg 1: expected native of type *dialog.FormDialog") + return env.NewError("Go(*dialog.FormDialog)//submit: arg 1: " + "expected native of type *dialog.FormDialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.FormDialog)//submit: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.FormDialog)//submit: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.FormDialog)//submit: arg 1: expected native") + return env.NewError("Go(*dialog.FormDialog)//submit: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Submit() return arg0 @@ -59588,28 +57985,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *dialog.ProgressDialog switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*dialog.ProgressDialog) - if !ok { + if vc, ok := v.Value.(*dialog.ProgressDialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.ProgressDialog)//set-value: arg 1: expected native of type *dialog.ProgressDialog") + return env.NewError("Go(*dialog.ProgressDialog)//set-value: arg 1: " + "expected native of type *dialog.ProgressDialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.ProgressDialog)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.ProgressDialog)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.ProgressDialog)//set-value: arg 1: expected native") + return env.NewError("Go(*dialog.ProgressDialog)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val float64 - if v, ok := arg1.(env.Decimal); ok { - arg1Val = float64(v.Value) + if vc, ok := arg1.(env.Decimal); ok { + arg1Val = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.ProgressDialog)//set-value: arg 2: expected decimal") + return env.NewError("Go(*dialog.ProgressDialog)//set-value: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetValue(arg1Val) return arg0 @@ -59622,21 +58019,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *dialog.ProgressInfiniteDialog switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*dialog.ProgressInfiniteDialog) - if !ok { + if vc, ok := v.Value.(*dialog.ProgressInfiniteDialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*dialog.ProgressInfiniteDialog)//hide: arg 1: expected native of type *dialog.ProgressInfiniteDialog") + return env.NewError("Go(*dialog.ProgressInfiniteDialog)//hide: arg 1: " + "expected native of type *dialog.ProgressInfiniteDialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*dialog.ProgressInfiniteDialog)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*dialog.ProgressInfiniteDialog)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*dialog.ProgressInfiniteDialog)//hide: arg 1: expected native") + return env.NewError("Go(*dialog.ProgressInfiniteDialog)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -59649,28 +58046,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Animation switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Animation) - if !ok { + if vc, ok := v.Value.(*fyne.Animation); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//auto-reverse!: arg 1: expected native of type *fyne.Animation") + return env.NewError("Go(*fyne.Animation)//auto-reverse!: arg 1: " + "expected native of type *fyne.Animation, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//auto-reverse!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Animation)//auto-reverse!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//auto-reverse!: arg 1: expected native") + return env.NewError("Go(*fyne.Animation)//auto-reverse!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.AutoReverse = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//auto-reverse!: arg 2: expected integer") + return env.NewError("Go(*fyne.Animation)//auto-reverse!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.AutoReverse = newVal return arg0 }, }, @@ -59681,21 +58080,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Animation switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Animation) - if !ok { + if vc, ok := v.Value.(*fyne.Animation); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//auto-reverse?: arg 1: expected native of type *fyne.Animation") + return env.NewError("Go(*fyne.Animation)//auto-reverse?: arg 1: " + "expected native of type *fyne.Animation, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//auto-reverse?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Animation)//auto-reverse?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//auto-reverse?: arg 1: expected native") + return env.NewError("Go(*fyne.Animation)//auto-reverse?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.AutoReverse)) @@ -59709,22 +58108,23 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Animation switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Animation) - if !ok { + if vc, ok := v.Value.(*fyne.Animation); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//curve!: arg 1: expected native of type *fyne.Animation") + return env.NewError("Go(*fyne.Animation)//curve!: arg 1: " + "expected native of type *fyne.Animation, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//curve!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Animation)//curve!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//curve!: arg 1: expected native") + return env.NewError("Go(*fyne.Animation)//curve!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.AnimationCurve { nat, natOk := arg1.(env.Native) var natValOk bool @@ -59733,27 +58133,28 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(fyne.AnimationCurve) } if natValOk { - self.Curve = natVal + newVal = natVal } else { var u func(float32) float32 switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//curve!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*fyne.Animation)//curve!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - u = func(arg0 float32) float32 { - var arg0Val env.Object - arg0Val = *env.NewDecimal(float64(arg0)) + u = func(farg0 float32) float32 { + var farg0Val env.Object + farg0Val = *env.NewDecimal(float64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) var res float32 - if v, ok := ps.Res.(env.Decimal); ok { - res = float32(v.Value) + if vc, ok := ps.Res.(env.Decimal); ok { + res = float32(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*fyne.Animation)//curve!: arg 2: callback result: expected decimal", + "Go(*fyne.Animation)//curve!: arg 2: callback result: "+"expected decimal, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -59764,16 +58165,17 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//curve!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Animation)//curve!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } u = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//curve!: arg 2: expected function or nil") + return env.NewError("Go(*fyne.Animation)//curve!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } - self.Curve = fyne.AnimationCurve(u) + newVal = fyne.AnimationCurve(u) } } + self.Curve = newVal return arg0 }, }, @@ -59784,24 +58186,36 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Animation switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Animation) - if !ok { + if vc, ok := v.Value.(*fyne.Animation); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//curve?: arg 1: expected native of type *fyne.Animation") + return env.NewError("Go(*fyne.Animation)//curve?: arg 1: " + "expected native of type *fyne.Animation, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//curve?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Animation)//curve?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//curve?: arg 1: expected native") + return env.NewError("Go(*fyne.Animation)//curve?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, (func(float32) float32)(self.Curve), "Go(func(float32) (float32))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val float32 + if vc, ok := arg0.(env.Decimal); ok { + arg0Val = float32(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Animation)//curve?: arg 1: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg0)) + } + res0 := (func(float32) float32)(self.Curve)(arg0Val) + var res0Obj env.Object + res0Obj = *env.NewDecimal(float64(res0)) + return res0Obj + }, 1, false, false, "Returned func") return resObj }, }, @@ -59812,34 +58226,36 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Animation switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Animation) - if !ok { + if vc, ok := v.Value.(*fyne.Animation); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//duration!: arg 1: expected native of type *fyne.Animation") + return env.NewError("Go(*fyne.Animation)//duration!: arg 1: " + "expected native of type *fyne.Animation, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//duration!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Animation)//duration!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//duration!: arg 1: expected native") + return env.NewError("Go(*fyne.Animation)//duration!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal time.Duration switch v := arg1.(type) { case env.Native: - var ok bool - self.Duration, ok = v.Value.(time.Duration) - if !ok { + if vc, ok := v.Value.(time.Duration); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//duration!: arg 2: expected native of type time.Duration") + return env.NewError("Go(*fyne.Animation)//duration!: arg 2: " + "expected native of type time.Duration, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//duration!: arg 2: expected native") + return env.NewError("Go(*fyne.Animation)//duration!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Duration = newVal return arg0 }, }, @@ -59850,21 +58266,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Animation switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Animation) - if !ok { + if vc, ok := v.Value.(*fyne.Animation); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//duration?: arg 1: expected native of type *fyne.Animation") + return env.NewError("Go(*fyne.Animation)//duration?: arg 1: " + "expected native of type *fyne.Animation, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//duration?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Animation)//duration?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//duration?: arg 1: expected native") + return env.NewError("Go(*fyne.Animation)//duration?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, self.Duration, "Go(time.Duration)") @@ -59878,28 +58294,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Animation switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Animation) - if !ok { + if vc, ok := v.Value.(*fyne.Animation); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//repeat-count!: arg 1: expected native of type *fyne.Animation") + return env.NewError("Go(*fyne.Animation)//repeat-count!: arg 1: " + "expected native of type *fyne.Animation, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//repeat-count!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Animation)//repeat-count!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//repeat-count!: arg 1: expected native") + return env.NewError("Go(*fyne.Animation)//repeat-count!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.RepeatCount = int(v.Value) + var newVal int + if vc, ok := arg1.(env.Integer); ok { + newVal = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//repeat-count!: arg 2: expected integer") + return env.NewError("Go(*fyne.Animation)//repeat-count!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.RepeatCount = newVal return arg0 }, }, @@ -59910,21 +58328,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Animation switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Animation) - if !ok { + if vc, ok := v.Value.(*fyne.Animation); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//repeat-count?: arg 1: expected native of type *fyne.Animation") + return env.NewError("Go(*fyne.Animation)//repeat-count?: arg 1: " + "expected native of type *fyne.Animation, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//repeat-count?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Animation)//repeat-count?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//repeat-count?: arg 1: expected native") + return env.NewError("Go(*fyne.Animation)//repeat-count?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(self.RepeatCount)) @@ -59938,21 +58356,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.Animation switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Animation) - if !ok { + if vc, ok := v.Value.(*fyne.Animation); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//start: arg 1: expected native of type *fyne.Animation") + return env.NewError("Go(*fyne.Animation)//start: arg 1: " + "expected native of type *fyne.Animation, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//start: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Animation)//start: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//start: arg 1: expected native") + return env.NewError("Go(*fyne.Animation)//start: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Start() return arg0 @@ -59965,21 +58383,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.Animation switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Animation) - if !ok { + if vc, ok := v.Value.(*fyne.Animation); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//stop: arg 1: expected native of type *fyne.Animation") + return env.NewError("Go(*fyne.Animation)//stop: arg 1: " + "expected native of type *fyne.Animation, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//stop: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Animation)//stop: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//stop: arg 1: expected native") + return env.NewError("Go(*fyne.Animation)//stop: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Stop() return arg0 @@ -59992,45 +58410,47 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Animation switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Animation) - if !ok { + if vc, ok := v.Value.(*fyne.Animation); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//tick!: arg 1: expected native of type *fyne.Animation") + return env.NewError("Go(*fyne.Animation)//tick!: arg 1: " + "expected native of type *fyne.Animation, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//tick!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Animation)//tick!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//tick!: arg 1: expected native") + return env.NewError("Go(*fyne.Animation)//tick!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(float32) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//tick!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*fyne.Animation)//tick!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.Tick = func(arg0 float32) { - var arg0Val env.Object - arg0Val = *env.NewDecimal(float64(arg0)) + newVal = func(farg0 float32) { + var farg0Val env.Object + farg0Val = *env.NewDecimal(float64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//tick!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Animation)//tick!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.Tick = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//tick!: arg 2: expected function or nil") + return env.NewError("Go(*fyne.Animation)//tick!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.Tick = newVal return arg0 }, }, @@ -60041,24 +58461,34 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Animation switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Animation) - if !ok { + if vc, ok := v.Value.(*fyne.Animation); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//tick?: arg 1: expected native of type *fyne.Animation") + return env.NewError("Go(*fyne.Animation)//tick?: arg 1: " + "expected native of type *fyne.Animation, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//tick?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Animation)//tick?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Animation)//tick?: arg 1: expected native") + return env.NewError("Go(*fyne.Animation)//tick?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.Tick, "Go(func(float32))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val float32 + if vc, ok := arg0.(env.Decimal); ok { + arg0Val = float32(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Animation)//tick?: arg 1: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg0)) + } + self.Tick(arg0Val) + return nil + }, 1, false, false, "Returned func") return resObj }, }, @@ -60069,28 +58499,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.AppMetadata switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.AppMetadata) - if !ok { + if vc, ok := v.Value.(*fyne.AppMetadata); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//build!: arg 1: expected native of type *fyne.AppMetadata") + return env.NewError("Go(*fyne.AppMetadata)//build!: arg 1: " + "expected native of type *fyne.AppMetadata, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//build!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.AppMetadata)//build!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//build!: arg 1: expected native") + return env.NewError("Go(*fyne.AppMetadata)//build!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Build = int(v.Value) + var newVal int + if vc, ok := arg1.(env.Integer); ok { + newVal = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//build!: arg 2: expected integer") + return env.NewError("Go(*fyne.AppMetadata)//build!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Build = newVal return arg0 }, }, @@ -60101,21 +58533,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.AppMetadata switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.AppMetadata) - if !ok { + if vc, ok := v.Value.(*fyne.AppMetadata); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//build?: arg 1: expected native of type *fyne.AppMetadata") + return env.NewError("Go(*fyne.AppMetadata)//build?: arg 1: " + "expected native of type *fyne.AppMetadata, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//build?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.AppMetadata)//build?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//build?: arg 1: expected native") + return env.NewError("Go(*fyne.AppMetadata)//build?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(self.Build)) @@ -60129,76 +58561,71 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.AppMetadata switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.AppMetadata) - if !ok { + if vc, ok := v.Value.(*fyne.AppMetadata); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//custom!: arg 1: expected native of type *fyne.AppMetadata") + return env.NewError("Go(*fyne.AppMetadata)//custom!: arg 1: " + "expected native of type *fyne.AppMetadata, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//custom!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.AppMetadata)//custom!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//custom!: arg 1: expected native") + return env.NewError("Go(*fyne.AppMetadata)//custom!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal map[string]string switch v := arg1.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//custom!: arg 2: expected block to have length of multiple of 2") + return env.NewError("Go(*fyne.AppMetadata)//custom!: arg 2: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } - self.Custom = make(map[string]string, len(v.Series.S)/2) + newVal = make(map[string]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//custom!: arg 2: map key: expected string") + return env.NewError("Go(*fyne.AppMetadata)//custom!: arg 2: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV string - if v, ok := v.Series.S[i+1].(env.String); ok { - mapV = string(v.Value) + if vc, ok := v.Series.S[i+1].(env.String); ok { + mapV = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//custom!: arg 2: map value: expected string") + return env.NewError("Go(*fyne.AppMetadata)//custom!: arg 2: " + "map value: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+1])) } - self.Custom[mapK] = mapV + newVal[mapK] = mapV } case env.Dict: - self.Custom = make(map[string]string, len(v.Data)) + newVal = make(map[string]string, len(v.Data)) for dictK, dictV := range v.Data { mapK := dictK var mapV string - if v, ok := dictV.(env.String); ok { - mapV = string(v.Value) + if vc, ok := dictV.(env.String); ok { + mapV = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//custom!: arg 2: map value: expected string") + return env.NewError("Go(*fyne.AppMetadata)//custom!: arg 2: " + "map value: " + "expected string, but got " + objectDebugString(ps.Idx, dictV)) } - self.Custom[mapK] = mapV - } - case env.Native: - var ok bool - self.Custom, ok = v.Value.(map[string]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//custom!: arg 2: expected native of type map[string]string") + newVal[mapK] = mapV } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//custom!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.AppMetadata)//custom!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Custom = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//custom!: arg 2: expected native, block, dict or nil") + return env.NewError("Go(*fyne.AppMetadata)//custom!: arg 2: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } + self.Custom = newVal return arg0 }, }, @@ -60209,21 +58636,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.AppMetadata switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.AppMetadata) - if !ok { + if vc, ok := v.Value.(*fyne.AppMetadata); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//custom?: arg 1: expected native of type *fyne.AppMetadata") + return env.NewError("Go(*fyne.AppMetadata)//custom?: arg 1: " + "expected native of type *fyne.AppMetadata, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//custom?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.AppMetadata)//custom?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//custom?: arg 1: expected native") + return env.NewError("Go(*fyne.AppMetadata)//custom?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object { @@ -60245,47 +58672,49 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.AppMetadata switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.AppMetadata) - if !ok { + if vc, ok := v.Value.(*fyne.AppMetadata); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//icon!: arg 1: expected native of type *fyne.AppMetadata") + return env.NewError("Go(*fyne.AppMetadata)//icon!: arg 1: " + "expected native of type *fyne.AppMetadata, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//icon!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.AppMetadata)//icon!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//icon!: arg 1: expected native") + return env.NewError("Go(*fyne.AppMetadata)//icon!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.Resource switch v := arg1.(type) { case env.RyeCtx: var err error - self.Icon, err = ctxTo_fyne_Resource(ps, v) + newVal, err = ctxTo_fyne_Resource(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//icon!: arg 2: " + err.Error() + "") + return env.NewError("Go(*fyne.AppMetadata)//icon!: arg 2: " + err.Error()) } case env.Native: - var ok bool - self.Icon, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//icon!: arg 2: expected native of type fyne.Resource") + return env.NewError("Go(*fyne.AppMetadata)//icon!: arg 2: " + "expected native of type fyne.Resource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//icon!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.AppMetadata)//icon!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Icon = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//icon!: arg 2: expected native") + return env.NewError("Go(*fyne.AppMetadata)//icon!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Icon = newVal return arg0 }, }, @@ -60296,41 +58725,24 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.AppMetadata switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.AppMetadata) - if !ok { + if vc, ok := v.Value.(*fyne.AppMetadata); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//icon?: arg 1: expected native of type *fyne.AppMetadata") + return env.NewError("Go(*fyne.AppMetadata)//icon?: arg 1: " + "expected native of type *fyne.AppMetadata, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//icon?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.AppMetadata)//icon?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//icon?: arg 1: expected native") + return env.NewError("Go(*fyne.AppMetadata)//icon?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - { - typ := reflect.TypeOf(self.Icon) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - resObj = *env.NewNative(ps.Idx, self.Icon, typRyeName) - } else { - resObj = *env.NewNative(ps.Idx, self.Icon, "Go(fyne.Resource)") - } - } + resObj = ifaceToNative(ps.Idx, self.Icon, "Go(fyne.Resource)") return resObj }, }, @@ -60341,28 +58753,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.AppMetadata switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.AppMetadata) - if !ok { + if vc, ok := v.Value.(*fyne.AppMetadata); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//id!: arg 1: expected native of type *fyne.AppMetadata") + return env.NewError("Go(*fyne.AppMetadata)//id!: arg 1: " + "expected native of type *fyne.AppMetadata, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//id!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.AppMetadata)//id!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//id!: arg 1: expected native") + return env.NewError("Go(*fyne.AppMetadata)//id!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.ID = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//id!: arg 2: expected string") + return env.NewError("Go(*fyne.AppMetadata)//id!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.ID = newVal return arg0 }, }, @@ -60373,21 +58787,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.AppMetadata switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.AppMetadata) - if !ok { + if vc, ok := v.Value.(*fyne.AppMetadata); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//id?: arg 1: expected native of type *fyne.AppMetadata") + return env.NewError("Go(*fyne.AppMetadata)//id?: arg 1: " + "expected native of type *fyne.AppMetadata, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//id?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.AppMetadata)//id?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//id?: arg 1: expected native") + return env.NewError("Go(*fyne.AppMetadata)//id?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.ID) @@ -60401,28 +58815,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.AppMetadata switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.AppMetadata) - if !ok { + if vc, ok := v.Value.(*fyne.AppMetadata); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//name!: arg 1: expected native of type *fyne.AppMetadata") + return env.NewError("Go(*fyne.AppMetadata)//name!: arg 1: " + "expected native of type *fyne.AppMetadata, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//name!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.AppMetadata)//name!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//name!: arg 1: expected native") + return env.NewError("Go(*fyne.AppMetadata)//name!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.Name = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//name!: arg 2: expected string") + return env.NewError("Go(*fyne.AppMetadata)//name!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.Name = newVal return arg0 }, }, @@ -60433,21 +58849,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.AppMetadata switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.AppMetadata) - if !ok { + if vc, ok := v.Value.(*fyne.AppMetadata); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//name?: arg 1: expected native of type *fyne.AppMetadata") + return env.NewError("Go(*fyne.AppMetadata)//name?: arg 1: " + "expected native of type *fyne.AppMetadata, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//name?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.AppMetadata)//name?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//name?: arg 1: expected native") + return env.NewError("Go(*fyne.AppMetadata)//name?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.Name) @@ -60461,28 +58877,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.AppMetadata switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.AppMetadata) - if !ok { + if vc, ok := v.Value.(*fyne.AppMetadata); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//release!: arg 1: expected native of type *fyne.AppMetadata") + return env.NewError("Go(*fyne.AppMetadata)//release!: arg 1: " + "expected native of type *fyne.AppMetadata, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//release!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.AppMetadata)//release!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//release!: arg 1: expected native") + return env.NewError("Go(*fyne.AppMetadata)//release!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Release = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//release!: arg 2: expected integer") + return env.NewError("Go(*fyne.AppMetadata)//release!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Release = newVal return arg0 }, }, @@ -60493,21 +58911,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.AppMetadata switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.AppMetadata) - if !ok { + if vc, ok := v.Value.(*fyne.AppMetadata); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//release?: arg 1: expected native of type *fyne.AppMetadata") + return env.NewError("Go(*fyne.AppMetadata)//release?: arg 1: " + "expected native of type *fyne.AppMetadata, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//release?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.AppMetadata)//release?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//release?: arg 1: expected native") + return env.NewError("Go(*fyne.AppMetadata)//release?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Release)) @@ -60521,28 +58939,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.AppMetadata switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.AppMetadata) - if !ok { + if vc, ok := v.Value.(*fyne.AppMetadata); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//version!: arg 1: expected native of type *fyne.AppMetadata") + return env.NewError("Go(*fyne.AppMetadata)//version!: arg 1: " + "expected native of type *fyne.AppMetadata, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//version!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.AppMetadata)//version!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//version!: arg 1: expected native") + return env.NewError("Go(*fyne.AppMetadata)//version!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.Version = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//version!: arg 2: expected string") + return env.NewError("Go(*fyne.AppMetadata)//version!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.Version = newVal return arg0 }, }, @@ -60553,21 +58973,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.AppMetadata switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.AppMetadata) - if !ok { + if vc, ok := v.Value.(*fyne.AppMetadata); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//version?: arg 1: expected native of type *fyne.AppMetadata") + return env.NewError("Go(*fyne.AppMetadata)//version?: arg 1: " + "expected native of type *fyne.AppMetadata, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//version?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.AppMetadata)//version?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.AppMetadata)//version?: arg 1: expected native") + return env.NewError("Go(*fyne.AppMetadata)//version?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.Version) @@ -60581,21 +59001,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.Container switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Container) - if !ok { + if vc, ok := v.Value.(*fyne.Container); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//add: arg 1: expected native of type *fyne.Container") + return env.NewError("Go(*fyne.Container)//add: arg 1: " + "expected native of type *fyne.Container, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//add: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Container)//add: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//add: arg 1: expected native") + return env.NewError("Go(*fyne.Container)//add: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.CanvasObject switch v := arg1.(type) { @@ -60604,24 +59024,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//add: arg 2: " + err.Error() + "") + return env.NewError("Go(*fyne.Container)//add: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//add: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("Go(*fyne.Container)//add: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//add: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Container)//add: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//add: arg 2: expected native") + return env.NewError("Go(*fyne.Container)//add: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Add(arg1Val) return arg0 @@ -60634,21 +59054,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.Container switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Container) - if !ok { + if vc, ok := v.Value.(*fyne.Container); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//add-object: arg 1: expected native of type *fyne.Container") + return env.NewError("Go(*fyne.Container)//add-object: arg 1: " + "expected native of type *fyne.Container, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//add-object: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Container)//add-object: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//add-object: arg 1: expected native") + return env.NewError("Go(*fyne.Container)//add-object: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.CanvasObject switch v := arg1.(type) { @@ -60657,24 +59077,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//add-object: arg 2: " + err.Error() + "") + return env.NewError("Go(*fyne.Container)//add-object: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//add-object: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("Go(*fyne.Container)//add-object: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//add-object: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Container)//add-object: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//add-object: arg 2: expected native") + return env.NewError("Go(*fyne.Container)//add-object: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddObject(arg1Val) return arg0 @@ -60687,28 +59107,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Container switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Container) - if !ok { + if vc, ok := v.Value.(*fyne.Container); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//hidden!: arg 1: expected native of type *fyne.Container") + return env.NewError("Go(*fyne.Container)//hidden!: arg 1: " + "expected native of type *fyne.Container, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Container)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//hidden!: arg 1: expected native") + return env.NewError("Go(*fyne.Container)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//hidden!: arg 2: expected integer") + return env.NewError("Go(*fyne.Container)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -60719,21 +59141,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Container switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Container) - if !ok { + if vc, ok := v.Value.(*fyne.Container); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//hidden?: arg 1: expected native of type *fyne.Container") + return env.NewError("Go(*fyne.Container)//hidden?: arg 1: " + "expected native of type *fyne.Container, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Container)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//hidden?: arg 1: expected native") + return env.NewError("Go(*fyne.Container)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -60747,21 +59169,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.Container switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Container) - if !ok { + if vc, ok := v.Value.(*fyne.Container); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//hide: arg 1: expected native of type *fyne.Container") + return env.NewError("Go(*fyne.Container)//hide: arg 1: " + "expected native of type *fyne.Container, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Container)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//hide: arg 1: expected native") + return env.NewError("Go(*fyne.Container)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -60774,47 +59196,49 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Container switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Container) - if !ok { + if vc, ok := v.Value.(*fyne.Container); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//layout!: arg 1: expected native of type *fyne.Container") + return env.NewError("Go(*fyne.Container)//layout!: arg 1: " + "expected native of type *fyne.Container, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//layout!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Container)//layout!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//layout!: arg 1: expected native") + return env.NewError("Go(*fyne.Container)//layout!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.Layout switch v := arg1.(type) { case env.RyeCtx: var err error - self.Layout, err = ctxTo_fyne_Layout(ps, v) + newVal, err = ctxTo_fyne_Layout(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//layout!: arg 2: " + err.Error() + "") + return env.NewError("Go(*fyne.Container)//layout!: arg 2: " + err.Error()) } case env.Native: - var ok bool - self.Layout, ok = v.Value.(fyne.Layout) - if !ok { + if vc, ok := v.Value.(fyne.Layout); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//layout!: arg 2: expected native of type fyne.Layout") + return env.NewError("Go(*fyne.Container)//layout!: arg 2: " + "expected native of type fyne.Layout, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//layout!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Container)//layout!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Layout = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//layout!: arg 2: expected native") + return env.NewError("Go(*fyne.Container)//layout!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Layout = newVal return arg0 }, }, @@ -60825,41 +59249,24 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Container switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Container) - if !ok { + if vc, ok := v.Value.(*fyne.Container); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//layout?: arg 1: expected native of type *fyne.Container") + return env.NewError("Go(*fyne.Container)//layout?: arg 1: " + "expected native of type *fyne.Container, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//layout?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Container)//layout?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//layout?: arg 1: expected native") + return env.NewError("Go(*fyne.Container)//layout?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - { - typ := reflect.TypeOf(self.Layout) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - resObj = *env.NewNative(ps.Idx, self.Layout, typRyeName) - } else { - resObj = *env.NewNative(ps.Idx, self.Layout, "Go(fyne.Layout)") - } - } + resObj = ifaceToNative(ps.Idx, self.Layout, "Go(fyne.Layout)") return resObj }, }, @@ -60870,21 +59277,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.Container switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Container) - if !ok { + if vc, ok := v.Value.(*fyne.Container); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//min-size: arg 1: expected native of type *fyne.Container") + return env.NewError("Go(*fyne.Container)//min-size: arg 1: " + "expected native of type *fyne.Container, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Container)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//min-size: arg 1: expected native") + return env.NewError("Go(*fyne.Container)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -60899,42 +59306,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.Container switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Container) - if !ok { + if vc, ok := v.Value.(*fyne.Container); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//move: arg 1: expected native of type *fyne.Container") + return env.NewError("Go(*fyne.Container)//move: arg 1: " + "expected native of type *fyne.Container, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Container)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//move: arg 1: expected native") + return env.NewError("Go(*fyne.Container)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Container)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//move: arg 2: expected native") + return env.NewError("Go(*fyne.Container)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -60945,69 +59346,64 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Container switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Container) - if !ok { + if vc, ok := v.Value.(*fyne.Container); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//objects!: arg 1: expected native of type *fyne.Container") + return env.NewError("Go(*fyne.Container)//objects!: arg 1: " + "expected native of type *fyne.Container, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//objects!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Container)//objects!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//objects!: arg 1: expected native") + return env.NewError("Go(*fyne.Container)//objects!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal []fyne.CanvasObject switch v := arg1.(type) { case env.Block: - self.Objects = make([]fyne.CanvasObject, len(v.Series.S)) + newVal = make([]fyne.CanvasObject, len(v.Series.S)) for i, it := range v.Series.S { switch v := it.(type) { case env.RyeCtx: var err error - self.Objects[i], err = ctxTo_fyne_CanvasObject(ps, v) + newVal[i], err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//objects!: arg 2: block item: " + err.Error() + "") + return env.NewError("Go(*fyne.Container)//objects!: arg 2: " + "block item: " + err.Error()) } case env.Native: - var ok bool - self.Objects[i], ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + newVal[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//objects!: arg 2: block item: expected native of type fyne.CanvasObject") + return env.NewError("Go(*fyne.Container)//objects!: arg 2: " + "block item: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//objects!: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Container)//objects!: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Objects[i] = nil + newVal[i] = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//objects!: arg 2: block item: expected native") + return env.NewError("Go(*fyne.Container)//objects!: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - self.Objects, ok = v.Value.([]fyne.CanvasObject) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//objects!: arg 2: expected native of type []fyne.CanvasObject") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//objects!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Container)//objects!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Objects = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//objects!: arg 2: expected block, native or nil") + return env.NewError("Go(*fyne.Container)//objects!: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } + self.Objects = newVal return arg0 }, }, @@ -61018,44 +59414,27 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Container switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Container) - if !ok { + if vc, ok := v.Value.(*fyne.Container); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//objects?: arg 1: expected native of type *fyne.Container") + return env.NewError("Go(*fyne.Container)//objects?: arg 1: " + "expected native of type *fyne.Container, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//objects?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Container)//objects?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//objects?: arg 1: expected native") + return env.NewError("Go(*fyne.Container)//objects?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object { items := make([]env.Object, len(self.Objects)) for i, it := range self.Objects { - { - typ := reflect.TypeOf(it) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - items[i] = *env.NewNative(ps.Idx, it, typRyeName) - } else { - items[i] = *env.NewNative(ps.Idx, it, "Go(fyne.CanvasObject)") - } - } + items[i] = ifaceToNative(ps.Idx, it, "Go(fyne.CanvasObject)") } resObj = *env.NewBlock(*env.NewTSeries(items)) } @@ -61069,21 +59448,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.Container switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Container) - if !ok { + if vc, ok := v.Value.(*fyne.Container); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//position: arg 1: expected native of type *fyne.Container") + return env.NewError("Go(*fyne.Container)//position: arg 1: " + "expected native of type *fyne.Container, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Container)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//position: arg 1: expected native") + return env.NewError("Go(*fyne.Container)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -61098,21 +59477,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.Container switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Container) - if !ok { + if vc, ok := v.Value.(*fyne.Container); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//refresh: arg 1: expected native of type *fyne.Container") + return env.NewError("Go(*fyne.Container)//refresh: arg 1: " + "expected native of type *fyne.Container, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Container)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//refresh: arg 1: expected native") + return env.NewError("Go(*fyne.Container)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -61125,21 +59504,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.Container switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Container) - if !ok { + if vc, ok := v.Value.(*fyne.Container); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//remove: arg 1: expected native of type *fyne.Container") + return env.NewError("Go(*fyne.Container)//remove: arg 1: " + "expected native of type *fyne.Container, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//remove: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Container)//remove: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//remove: arg 1: expected native") + return env.NewError("Go(*fyne.Container)//remove: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.CanvasObject switch v := arg1.(type) { @@ -61148,24 +59527,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//remove: arg 2: " + err.Error() + "") + return env.NewError("Go(*fyne.Container)//remove: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//remove: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("Go(*fyne.Container)//remove: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//remove: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Container)//remove: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//remove: arg 2: expected native") + return env.NewError("Go(*fyne.Container)//remove: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Remove(arg1Val) return arg0 @@ -61178,21 +59557,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.Container switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Container) - if !ok { + if vc, ok := v.Value.(*fyne.Container); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//remove-all: arg 1: expected native of type *fyne.Container") + return env.NewError("Go(*fyne.Container)//remove-all: arg 1: " + "expected native of type *fyne.Container, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//remove-all: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Container)//remove-all: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//remove-all: arg 1: expected native") + return env.NewError("Go(*fyne.Container)//remove-all: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveAll() return arg0 @@ -61205,42 +59584,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.Container switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Container) - if !ok { + if vc, ok := v.Value.(*fyne.Container); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//resize: arg 1: expected native of type *fyne.Container") + return env.NewError("Go(*fyne.Container)//resize: arg 1: " + "expected native of type *fyne.Container, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Container)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//resize: arg 1: expected native") + return env.NewError("Go(*fyne.Container)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Container)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//resize: arg 2: expected native") + return env.NewError("Go(*fyne.Container)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -61251,21 +59624,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.Container switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Container) - if !ok { + if vc, ok := v.Value.(*fyne.Container); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//show: arg 1: expected native of type *fyne.Container") + return env.NewError("Go(*fyne.Container)//show: arg 1: " + "expected native of type *fyne.Container, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Container)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//show: arg 1: expected native") + return env.NewError("Go(*fyne.Container)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -61278,21 +59651,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.Container switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Container) - if !ok { + if vc, ok := v.Value.(*fyne.Container); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//size: arg 1: expected native of type *fyne.Container") + return env.NewError("Go(*fyne.Container)//size: arg 1: " + "expected native of type *fyne.Container, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Container)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//size: arg 1: expected native") + return env.NewError("Go(*fyne.Container)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -61307,21 +59680,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.Container switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Container) - if !ok { + if vc, ok := v.Value.(*fyne.Container); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//visible: arg 1: expected native of type *fyne.Container") + return env.NewError("Go(*fyne.Container)//visible: arg 1: " + "expected native of type *fyne.Container, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Container)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Container)//visible: arg 1: expected native") + return env.NewError("Go(*fyne.Container)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -61329,6 +59702,34 @@ var Builtins = map[string]*env.Builtin{ return res0Obj }, }, + "Go(*fyne.Delta)//components": { + Doc: "fyne.Delta.Components", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val fyne.Delta + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.Delta); ok { + arg0Val = *vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Delta)//components: arg 1: " + "expected native of type *fyne.Delta, but got " + objectDebugString(ps.Idx, v)) + } + default: + ps.FailureFlag = true + return env.NewError("Go(*fyne.Delta)//components: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + res0, res1 := arg0Val.Components() + var res0Obj env.Object + res0Obj = *env.NewDecimal(float64(res0)) + var res1Obj env.Object + res1Obj = *env.NewDecimal(float64(res1)) + return *env.NewBlock(*env.NewTSeries([]env.Object{ + res0Obj, + res1Obj, + })) + }, + }, "Go(*fyne.Delta)//dx!": { Doc: "Set *fyne.Delta DX value", Argsn: 2, @@ -61336,28 +59737,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Delta switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Delta) - if !ok { + if vc, ok := v.Value.(*fyne.Delta); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Delta)//dx!: arg 1: expected native of type *fyne.Delta") + return env.NewError("Go(*fyne.Delta)//dx!: arg 1: " + "expected native of type *fyne.Delta, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Delta)//dx!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Delta)//dx!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Delta)//dx!: arg 1: expected native") + return env.NewError("Go(*fyne.Delta)//dx!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Decimal); ok { - self.DX = float32(v.Value) + var newVal float32 + if vc, ok := arg1.(env.Decimal); ok { + newVal = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Delta)//dx!: arg 2: expected decimal") + return env.NewError("Go(*fyne.Delta)//dx!: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } + self.DX = newVal return arg0 }, }, @@ -61368,21 +59771,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Delta switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Delta) - if !ok { + if vc, ok := v.Value.(*fyne.Delta); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Delta)//dx?: arg 1: expected native of type *fyne.Delta") + return env.NewError("Go(*fyne.Delta)//dx?: arg 1: " + "expected native of type *fyne.Delta, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Delta)//dx?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Delta)//dx?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Delta)//dx?: arg 1: expected native") + return env.NewError("Go(*fyne.Delta)//dx?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewDecimal(float64(self.DX)) @@ -61396,28 +59799,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Delta switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Delta) - if !ok { + if vc, ok := v.Value.(*fyne.Delta); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Delta)//dy!: arg 1: expected native of type *fyne.Delta") + return env.NewError("Go(*fyne.Delta)//dy!: arg 1: " + "expected native of type *fyne.Delta, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Delta)//dy!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Delta)//dy!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Delta)//dy!: arg 1: expected native") + return env.NewError("Go(*fyne.Delta)//dy!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Decimal); ok { - self.DY = float32(v.Value) + var newVal float32 + if vc, ok := arg1.(env.Decimal); ok { + newVal = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Delta)//dy!: arg 2: expected decimal") + return env.NewError("Go(*fyne.Delta)//dy!: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } + self.DY = newVal return arg0 }, }, @@ -61428,27 +59833,50 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Delta switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Delta) - if !ok { + if vc, ok := v.Value.(*fyne.Delta); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Delta)//dy?: arg 1: expected native of type *fyne.Delta") + return env.NewError("Go(*fyne.Delta)//dy?: arg 1: " + "expected native of type *fyne.Delta, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Delta)//dy?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Delta)//dy?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Delta)//dy?: arg 1: expected native") + return env.NewError("Go(*fyne.Delta)//dy?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewDecimal(float64(self.DY)) return resObj }, }, + "Go(*fyne.Delta)//is-zero": { + Doc: "fyne.Delta.IsZero", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val fyne.Delta + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.Delta); ok { + arg0Val = *vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Delta)//is-zero: arg 1: " + "expected native of type *fyne.Delta, but got " + objectDebugString(ps.Idx, v)) + } + default: + ps.FailureFlag = true + return env.NewError("Go(*fyne.Delta)//is-zero: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + res0 := arg0Val.IsZero() + var res0Obj env.Object + res0Obj = *env.NewInteger(boolToInt64(res0)) + return res0Obj + }, + }, "Go(*fyne.DragEvent)//absolute-position!": { Doc: "Set *fyne.DragEvent AbsolutePosition value", Argsn: 2, @@ -61456,34 +59884,42 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.DragEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.DragEvent) - if !ok { + if vc, ok := v.Value.(*fyne.DragEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.DragEvent)//absolute-position!: arg 1: expected native of type *fyne.DragEvent") + return env.NewError("Go(*fyne.DragEvent)//absolute-position!: arg 1: " + "expected native of type *fyne.DragEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.DragEvent)//absolute-position!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.DragEvent)//absolute-position!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.DragEvent)//absolute-position!: arg 1: expected native") + return env.NewError("Go(*fyne.DragEvent)//absolute-position!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal *fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - self.AbsolutePosition, ok = v.Value.(fyne.Position) - if !ok { + if vc, ok := v.Value.(*fyne.Position); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.DragEvent)//absolute-position!: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.DragEvent)//absolute-position!: arg 2: expected native of type fyne.Position") + return env.NewError("Go(*fyne.DragEvent)//absolute-position!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.DragEvent)//absolute-position!: arg 2: expected native") + return env.NewError("Go(*fyne.DragEvent)//absolute-position!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.AbsolutePosition = *newVal return arg0 }, }, @@ -61494,21 +59930,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.DragEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.DragEvent) - if !ok { + if vc, ok := v.Value.(*fyne.DragEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.DragEvent)//absolute-position?: arg 1: expected native of type *fyne.DragEvent") + return env.NewError("Go(*fyne.DragEvent)//absolute-position?: arg 1: " + "expected native of type *fyne.DragEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.DragEvent)//absolute-position?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.DragEvent)//absolute-position?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.DragEvent)//absolute-position?: arg 1: expected native") + return env.NewError("Go(*fyne.DragEvent)//absolute-position?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, &self.AbsolutePosition, "Go(*fyne.Position)") @@ -61522,34 +59958,42 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.DragEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.DragEvent) - if !ok { + if vc, ok := v.Value.(*fyne.DragEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.DragEvent)//dragged!: arg 1: expected native of type *fyne.DragEvent") + return env.NewError("Go(*fyne.DragEvent)//dragged!: arg 1: " + "expected native of type *fyne.DragEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.DragEvent)//dragged!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.DragEvent)//dragged!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.DragEvent)//dragged!: arg 1: expected native") + return env.NewError("Go(*fyne.DragEvent)//dragged!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal *fyne.Delta switch v := arg1.(type) { case env.Native: - var ok bool - self.Dragged, ok = v.Value.(fyne.Delta) - if !ok { + if vc, ok := v.Value.(*fyne.Delta); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.DragEvent)//dragged!: arg 2: expected native of type fyne.Delta") + return env.NewError("Go(*fyne.DragEvent)//dragged!: arg 2: " + "expected native of type *fyne.Delta, but got " + objectDebugString(ps.Idx, v)) } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*fyne.DragEvent)//dragged!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.DragEvent)//dragged!: arg 2: expected native") + return env.NewError("Go(*fyne.DragEvent)//dragged!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Dragged = *newVal return arg0 }, }, @@ -61560,27 +60004,101 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.DragEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.DragEvent) - if !ok { + if vc, ok := v.Value.(*fyne.DragEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.DragEvent)//dragged?: arg 1: expected native of type *fyne.DragEvent") + return env.NewError("Go(*fyne.DragEvent)//dragged?: arg 1: " + "expected native of type *fyne.DragEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.DragEvent)//dragged?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.DragEvent)//dragged?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.DragEvent)//dragged?: arg 1: expected native") + return env.NewError("Go(*fyne.DragEvent)//dragged?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, &self.Dragged, "Go(*fyne.Delta)") return resObj }, }, + "Go(*fyne.DragEvent)//point-event!": { + Doc: "Set *fyne.DragEvent PointEvent value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *fyne.DragEvent + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.DragEvent); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.DragEvent)//point-event!: arg 1: " + "expected native of type *fyne.DragEvent, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*fyne.DragEvent)//point-event!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*fyne.DragEvent)//point-event!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *fyne.PointEvent + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.PointEvent); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.DragEvent)//point-event!: arg 2: " + "expected native of type *fyne.PointEvent, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*fyne.DragEvent)//point-event!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*fyne.DragEvent)//point-event!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.PointEvent = *newVal + return arg0 + }, + }, + "Go(*fyne.DragEvent)//point-event?": { + Doc: "Get *fyne.DragEvent PointEvent value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *fyne.DragEvent + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.DragEvent); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.DragEvent)//point-event?: arg 1: " + "expected native of type *fyne.DragEvent, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*fyne.DragEvent)//point-event?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*fyne.DragEvent)//point-event?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.PointEvent, "Go(*fyne.PointEvent)") + return resObj + }, + }, "Go(*fyne.DragEvent)//position!": { Doc: "Set *fyne.DragEvent Position value", Argsn: 2, @@ -61588,34 +60106,42 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.DragEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.DragEvent) - if !ok { + if vc, ok := v.Value.(*fyne.DragEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.DragEvent)//position!: arg 1: expected native of type *fyne.DragEvent") + return env.NewError("Go(*fyne.DragEvent)//position!: arg 1: " + "expected native of type *fyne.DragEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.DragEvent)//position!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.DragEvent)//position!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.DragEvent)//position!: arg 1: expected native") + return env.NewError("Go(*fyne.DragEvent)//position!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal *fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - self.Position, ok = v.Value.(fyne.Position) - if !ok { + if vc, ok := v.Value.(*fyne.Position); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.DragEvent)//position!: arg 2: expected native of type fyne.Position") + return env.NewError("Go(*fyne.DragEvent)//position!: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*fyne.DragEvent)//position!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.DragEvent)//position!: arg 2: expected native") + return env.NewError("Go(*fyne.DragEvent)//position!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Position = *newVal return arg0 }, }, @@ -61626,21 +60152,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.DragEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.DragEvent) - if !ok { + if vc, ok := v.Value.(*fyne.DragEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.DragEvent)//position?: arg 1: expected native of type *fyne.DragEvent") + return env.NewError("Go(*fyne.DragEvent)//position?: arg 1: " + "expected native of type *fyne.DragEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.DragEvent)//position?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.DragEvent)//position?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.DragEvent)//position?: arg 1: expected native") + return env.NewError("Go(*fyne.DragEvent)//position?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, &self.Position, "Go(*fyne.Position)") @@ -61654,28 +60180,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.HardwareKey switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.HardwareKey) - if !ok { + if vc, ok := v.Value.(*fyne.HardwareKey); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.HardwareKey)//scan-code!: arg 1: expected native of type *fyne.HardwareKey") + return env.NewError("Go(*fyne.HardwareKey)//scan-code!: arg 1: " + "expected native of type *fyne.HardwareKey, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.HardwareKey)//scan-code!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.HardwareKey)//scan-code!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.HardwareKey)//scan-code!: arg 1: expected native") + return env.NewError("Go(*fyne.HardwareKey)//scan-code!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.ScanCode = int(v.Value) + var newVal int + if vc, ok := arg1.(env.Integer); ok { + newVal = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.HardwareKey)//scan-code!: arg 2: expected integer") + return env.NewError("Go(*fyne.HardwareKey)//scan-code!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.ScanCode = newVal return arg0 }, }, @@ -61686,21 +60214,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.HardwareKey switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.HardwareKey) - if !ok { + if vc, ok := v.Value.(*fyne.HardwareKey); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.HardwareKey)//scan-code?: arg 1: expected native of type *fyne.HardwareKey") + return env.NewError("Go(*fyne.HardwareKey)//scan-code?: arg 1: " + "expected native of type *fyne.HardwareKey, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.HardwareKey)//scan-code?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.HardwareKey)//scan-code?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.HardwareKey)//scan-code?: arg 1: expected native") + return env.NewError("Go(*fyne.HardwareKey)//scan-code?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(self.ScanCode)) @@ -61714,22 +60242,23 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.KeyEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.KeyEvent) - if !ok { + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.KeyEvent)//name!: arg 1: expected native of type *fyne.KeyEvent") + return env.NewError("Go(*fyne.KeyEvent)//name!: arg 1: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.KeyEvent)//name!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.KeyEvent)//name!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.KeyEvent)//name!: arg 1: expected native") + return env.NewError("Go(*fyne.KeyEvent)//name!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.KeyName { nat, natOk := arg1.(env.Native) var natValOk bool @@ -61738,18 +60267,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(fyne.KeyName) } if natValOk { - self.Name = natVal + newVal = natVal } else { var u string - if v, ok := arg1.(env.String); ok { - u = string(v.Value) + if vc, ok := arg1.(env.String); ok { + u = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.KeyEvent)//name!: arg 2: expected string") + return env.NewError("Go(*fyne.KeyEvent)//name!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } - self.Name = fyne.KeyName(u) + newVal = fyne.KeyName(u) } } + self.Name = newVal return arg0 }, }, @@ -61760,21 +60290,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.KeyEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.KeyEvent) - if !ok { + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.KeyEvent)//name?: arg 1: expected native of type *fyne.KeyEvent") + return env.NewError("Go(*fyne.KeyEvent)//name?: arg 1: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.KeyEvent)//name?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.KeyEvent)//name?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.KeyEvent)//name?: arg 1: expected native") + return env.NewError("Go(*fyne.KeyEvent)//name?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(string(self.Name)) @@ -61788,34 +60318,42 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.KeyEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.KeyEvent) - if !ok { + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.KeyEvent)//physical!: arg 1: expected native of type *fyne.KeyEvent") + return env.NewError("Go(*fyne.KeyEvent)//physical!: arg 1: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.KeyEvent)//physical!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.KeyEvent)//physical!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.KeyEvent)//physical!: arg 1: expected native") + return env.NewError("Go(*fyne.KeyEvent)//physical!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal *fyne.HardwareKey switch v := arg1.(type) { case env.Native: - var ok bool - self.Physical, ok = v.Value.(fyne.HardwareKey) - if !ok { + if vc, ok := v.Value.(*fyne.HardwareKey); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.KeyEvent)//physical!: arg 2: " + "expected native of type *fyne.HardwareKey, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.KeyEvent)//physical!: arg 2: expected native of type fyne.HardwareKey") + return env.NewError("Go(*fyne.KeyEvent)//physical!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.KeyEvent)//physical!: arg 2: expected native") + return env.NewError("Go(*fyne.KeyEvent)//physical!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Physical = *newVal return arg0 }, }, @@ -61826,21 +60364,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.KeyEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.KeyEvent) - if !ok { + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.KeyEvent)//physical?: arg 1: expected native of type *fyne.KeyEvent") + return env.NewError("Go(*fyne.KeyEvent)//physical?: arg 1: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.KeyEvent)//physical?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.KeyEvent)//physical?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.KeyEvent)//physical?: arg 1: expected native") + return env.NewError("Go(*fyne.KeyEvent)//physical?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, &self.Physical, "Go(*fyne.HardwareKey)") @@ -61854,62 +60392,57 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.MainMenu switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.MainMenu) - if !ok { + if vc, ok := v.Value.(*fyne.MainMenu); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MainMenu)//items!: arg 1: expected native of type *fyne.MainMenu") + return env.NewError("Go(*fyne.MainMenu)//items!: arg 1: " + "expected native of type *fyne.MainMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.MainMenu)//items!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.MainMenu)//items!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.MainMenu)//items!: arg 1: expected native") + return env.NewError("Go(*fyne.MainMenu)//items!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal []*fyne.Menu switch v := arg1.(type) { case env.Block: - self.Items = make([]*fyne.Menu, len(v.Series.S)) + newVal = make([]*fyne.Menu, len(v.Series.S)) for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - self.Items[i], ok = v.Value.(*fyne.Menu) - if !ok { + if vc, ok := v.Value.(*fyne.Menu); ok { + newVal[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MainMenu)//items!: arg 2: block item: expected native of type *fyne.Menu") + return env.NewError("Go(*fyne.MainMenu)//items!: arg 2: " + "block item: " + "expected native of type *fyne.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.MainMenu)//items!: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.MainMenu)//items!: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Items[i] = nil + newVal[i] = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.MainMenu)//items!: arg 2: block item: expected native") + return env.NewError("Go(*fyne.MainMenu)//items!: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - self.Items, ok = v.Value.([]*fyne.Menu) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*fyne.MainMenu)//items!: arg 2: expected native of type []*fyne.Menu") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.MainMenu)//items!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.MainMenu)//items!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Items = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.MainMenu)//items!: arg 2: expected block, native or nil") + return env.NewError("Go(*fyne.MainMenu)//items!: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } + self.Items = newVal return arg0 }, }, @@ -61920,21 +60453,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.MainMenu switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.MainMenu) - if !ok { + if vc, ok := v.Value.(*fyne.MainMenu); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MainMenu)//items?: arg 1: expected native of type *fyne.MainMenu") + return env.NewError("Go(*fyne.MainMenu)//items?: arg 1: " + "expected native of type *fyne.MainMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.MainMenu)//items?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.MainMenu)//items?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.MainMenu)//items?: arg 1: expected native") + return env.NewError("Go(*fyne.MainMenu)//items?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object { @@ -61954,21 +60487,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.MainMenu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.MainMenu) - if !ok { + if vc, ok := v.Value.(*fyne.MainMenu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MainMenu)//refresh: arg 1: expected native of type *fyne.MainMenu") + return env.NewError("Go(*fyne.MainMenu)//refresh: arg 1: " + "expected native of type *fyne.MainMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.MainMenu)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.MainMenu)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.MainMenu)//refresh: arg 1: expected native") + return env.NewError("Go(*fyne.MainMenu)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -61981,62 +60514,57 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Menu switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Menu) - if !ok { + if vc, ok := v.Value.(*fyne.Menu); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Menu)//items!: arg 1: expected native of type *fyne.Menu") + return env.NewError("Go(*fyne.Menu)//items!: arg 1: " + "expected native of type *fyne.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Menu)//items!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Menu)//items!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Menu)//items!: arg 1: expected native") + return env.NewError("Go(*fyne.Menu)//items!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal []*fyne.MenuItem switch v := arg1.(type) { case env.Block: - self.Items = make([]*fyne.MenuItem, len(v.Series.S)) + newVal = make([]*fyne.MenuItem, len(v.Series.S)) for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - self.Items[i], ok = v.Value.(*fyne.MenuItem) - if !ok { + if vc, ok := v.Value.(*fyne.MenuItem); ok { + newVal[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Menu)//items!: arg 2: block item: expected native of type *fyne.MenuItem") + return env.NewError("Go(*fyne.Menu)//items!: arg 2: " + "block item: " + "expected native of type *fyne.MenuItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Menu)//items!: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Menu)//items!: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Items[i] = nil + newVal[i] = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Menu)//items!: arg 2: block item: expected native") + return env.NewError("Go(*fyne.Menu)//items!: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - self.Items, ok = v.Value.([]*fyne.MenuItem) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*fyne.Menu)//items!: arg 2: expected native of type []*fyne.MenuItem") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Menu)//items!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Menu)//items!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Items = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Menu)//items!: arg 2: expected block, native or nil") + return env.NewError("Go(*fyne.Menu)//items!: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } + self.Items = newVal return arg0 }, }, @@ -62047,21 +60575,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Menu switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Menu) - if !ok { + if vc, ok := v.Value.(*fyne.Menu); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Menu)//items?: arg 1: expected native of type *fyne.Menu") + return env.NewError("Go(*fyne.Menu)//items?: arg 1: " + "expected native of type *fyne.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Menu)//items?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Menu)//items?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Menu)//items?: arg 1: expected native") + return env.NewError("Go(*fyne.Menu)//items?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object { @@ -62081,28 +60609,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Menu switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Menu) - if !ok { + if vc, ok := v.Value.(*fyne.Menu); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Menu)//label!: arg 1: expected native of type *fyne.Menu") + return env.NewError("Go(*fyne.Menu)//label!: arg 1: " + "expected native of type *fyne.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Menu)//label!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Menu)//label!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Menu)//label!: arg 1: expected native") + return env.NewError("Go(*fyne.Menu)//label!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.Label = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Menu)//label!: arg 2: expected string") + return env.NewError("Go(*fyne.Menu)//label!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.Label = newVal return arg0 }, }, @@ -62113,21 +60643,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Menu switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Menu) - if !ok { + if vc, ok := v.Value.(*fyne.Menu); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Menu)//label?: arg 1: expected native of type *fyne.Menu") + return env.NewError("Go(*fyne.Menu)//label?: arg 1: " + "expected native of type *fyne.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Menu)//label?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Menu)//label?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Menu)//label?: arg 1: expected native") + return env.NewError("Go(*fyne.Menu)//label?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.Label) @@ -62141,21 +60671,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.Menu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Menu) - if !ok { + if vc, ok := v.Value.(*fyne.Menu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Menu)//refresh: arg 1: expected native of type *fyne.Menu") + return env.NewError("Go(*fyne.Menu)//refresh: arg 1: " + "expected native of type *fyne.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Menu)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Menu)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Menu)//refresh: arg 1: expected native") + return env.NewError("Go(*fyne.Menu)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -62168,29 +60698,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.MenuItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.MenuItem) - if !ok { + if vc, ok := v.Value.(*fyne.MenuItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//action!: arg 1: expected native of type *fyne.MenuItem") + return env.NewError("Go(*fyne.MenuItem)//action!: arg 1: " + "expected native of type *fyne.MenuItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//action!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.MenuItem)//action!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//action!: arg 1: expected native") + return env.NewError("Go(*fyne.MenuItem)//action!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func() switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//action!: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(*fyne.MenuItem)//action!: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.Action = func() { + newVal = func() { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, ps.Ctx) @@ -62198,13 +60729,14 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//action!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.MenuItem)//action!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.Action = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//action!: arg 2: expected function or nil") + return env.NewError("Go(*fyne.MenuItem)//action!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.Action = newVal return arg0 }, }, @@ -62215,24 +60747,27 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.MenuItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.MenuItem) - if !ok { + if vc, ok := v.Value.(*fyne.MenuItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//action?: arg 1: expected native of type *fyne.MenuItem") + return env.NewError("Go(*fyne.MenuItem)//action?: arg 1: " + "expected native of type *fyne.MenuItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//action?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.MenuItem)//action?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//action?: arg 1: expected native") + return env.NewError("Go(*fyne.MenuItem)//action?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.Action, "Go(func())") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + self.Action() + return nil + }, 0, false, false, "Returned func") return resObj }, }, @@ -62243,28 +60778,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.MenuItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.MenuItem) - if !ok { + if vc, ok := v.Value.(*fyne.MenuItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//checked!: arg 1: expected native of type *fyne.MenuItem") + return env.NewError("Go(*fyne.MenuItem)//checked!: arg 1: " + "expected native of type *fyne.MenuItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//checked!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.MenuItem)//checked!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//checked!: arg 1: expected native") + return env.NewError("Go(*fyne.MenuItem)//checked!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Checked = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//checked!: arg 2: expected integer") + return env.NewError("Go(*fyne.MenuItem)//checked!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Checked = newVal return arg0 }, }, @@ -62275,21 +60812,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.MenuItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.MenuItem) - if !ok { + if vc, ok := v.Value.(*fyne.MenuItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//checked?: arg 1: expected native of type *fyne.MenuItem") + return env.NewError("Go(*fyne.MenuItem)//checked?: arg 1: " + "expected native of type *fyne.MenuItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//checked?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.MenuItem)//checked?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//checked?: arg 1: expected native") + return env.NewError("Go(*fyne.MenuItem)//checked?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Checked)) @@ -62303,40 +60840,42 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.MenuItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.MenuItem) - if !ok { + if vc, ok := v.Value.(*fyne.MenuItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//child-menu!: arg 1: expected native of type *fyne.MenuItem") + return env.NewError("Go(*fyne.MenuItem)//child-menu!: arg 1: " + "expected native of type *fyne.MenuItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//child-menu!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.MenuItem)//child-menu!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//child-menu!: arg 1: expected native") + return env.NewError("Go(*fyne.MenuItem)//child-menu!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal *fyne.Menu switch v := arg1.(type) { case env.Native: - var ok bool - self.ChildMenu, ok = v.Value.(*fyne.Menu) - if !ok { + if vc, ok := v.Value.(*fyne.Menu); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//child-menu!: arg 2: expected native of type *fyne.Menu") + return env.NewError("Go(*fyne.MenuItem)//child-menu!: arg 2: " + "expected native of type *fyne.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//child-menu!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.MenuItem)//child-menu!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.ChildMenu = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//child-menu!: arg 2: expected native") + return env.NewError("Go(*fyne.MenuItem)//child-menu!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.ChildMenu = newVal return arg0 }, }, @@ -62347,21 +60886,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.MenuItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.MenuItem) - if !ok { + if vc, ok := v.Value.(*fyne.MenuItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//child-menu?: arg 1: expected native of type *fyne.MenuItem") + return env.NewError("Go(*fyne.MenuItem)//child-menu?: arg 1: " + "expected native of type *fyne.MenuItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//child-menu?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.MenuItem)//child-menu?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//child-menu?: arg 1: expected native") + return env.NewError("Go(*fyne.MenuItem)//child-menu?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, self.ChildMenu, "Go(*fyne.Menu)") @@ -62375,28 +60914,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.MenuItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.MenuItem) - if !ok { + if vc, ok := v.Value.(*fyne.MenuItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//disabled!: arg 1: expected native of type *fyne.MenuItem") + return env.NewError("Go(*fyne.MenuItem)//disabled!: arg 1: " + "expected native of type *fyne.MenuItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//disabled!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.MenuItem)//disabled!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//disabled!: arg 1: expected native") + return env.NewError("Go(*fyne.MenuItem)//disabled!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Disabled = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//disabled!: arg 2: expected integer") + return env.NewError("Go(*fyne.MenuItem)//disabled!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Disabled = newVal return arg0 }, }, @@ -62407,21 +60948,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.MenuItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.MenuItem) - if !ok { + if vc, ok := v.Value.(*fyne.MenuItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//disabled?: arg 1: expected native of type *fyne.MenuItem") + return env.NewError("Go(*fyne.MenuItem)//disabled?: arg 1: " + "expected native of type *fyne.MenuItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//disabled?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.MenuItem)//disabled?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//disabled?: arg 1: expected native") + return env.NewError("Go(*fyne.MenuItem)//disabled?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Disabled)) @@ -62435,47 +60976,49 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.MenuItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.MenuItem) - if !ok { + if vc, ok := v.Value.(*fyne.MenuItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//icon!: arg 1: expected native of type *fyne.MenuItem") + return env.NewError("Go(*fyne.MenuItem)//icon!: arg 1: " + "expected native of type *fyne.MenuItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//icon!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.MenuItem)//icon!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//icon!: arg 1: expected native") + return env.NewError("Go(*fyne.MenuItem)//icon!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.Resource switch v := arg1.(type) { case env.RyeCtx: var err error - self.Icon, err = ctxTo_fyne_Resource(ps, v) + newVal, err = ctxTo_fyne_Resource(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//icon!: arg 2: " + err.Error() + "") + return env.NewError("Go(*fyne.MenuItem)//icon!: arg 2: " + err.Error()) } case env.Native: - var ok bool - self.Icon, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//icon!: arg 2: expected native of type fyne.Resource") + return env.NewError("Go(*fyne.MenuItem)//icon!: arg 2: " + "expected native of type fyne.Resource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//icon!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.MenuItem)//icon!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Icon = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//icon!: arg 2: expected native") + return env.NewError("Go(*fyne.MenuItem)//icon!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Icon = newVal return arg0 }, }, @@ -62486,41 +61029,24 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.MenuItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.MenuItem) - if !ok { + if vc, ok := v.Value.(*fyne.MenuItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//icon?: arg 1: expected native of type *fyne.MenuItem") + return env.NewError("Go(*fyne.MenuItem)//icon?: arg 1: " + "expected native of type *fyne.MenuItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//icon?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.MenuItem)//icon?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//icon?: arg 1: expected native") + return env.NewError("Go(*fyne.MenuItem)//icon?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - { - typ := reflect.TypeOf(self.Icon) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - resObj = *env.NewNative(ps.Idx, self.Icon, typRyeName) - } else { - resObj = *env.NewNative(ps.Idx, self.Icon, "Go(fyne.Resource)") - } - } + resObj = ifaceToNative(ps.Idx, self.Icon, "Go(fyne.Resource)") return resObj }, }, @@ -62531,28 +61057,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.MenuItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.MenuItem) - if !ok { + if vc, ok := v.Value.(*fyne.MenuItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//is-quit!: arg 1: expected native of type *fyne.MenuItem") + return env.NewError("Go(*fyne.MenuItem)//is-quit!: arg 1: " + "expected native of type *fyne.MenuItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//is-quit!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.MenuItem)//is-quit!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//is-quit!: arg 1: expected native") + return env.NewError("Go(*fyne.MenuItem)//is-quit!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.IsQuit = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//is-quit!: arg 2: expected integer") + return env.NewError("Go(*fyne.MenuItem)//is-quit!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.IsQuit = newVal return arg0 }, }, @@ -62563,21 +61091,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.MenuItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.MenuItem) - if !ok { + if vc, ok := v.Value.(*fyne.MenuItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//is-quit?: arg 1: expected native of type *fyne.MenuItem") + return env.NewError("Go(*fyne.MenuItem)//is-quit?: arg 1: " + "expected native of type *fyne.MenuItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//is-quit?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.MenuItem)//is-quit?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//is-quit?: arg 1: expected native") + return env.NewError("Go(*fyne.MenuItem)//is-quit?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.IsQuit)) @@ -62591,28 +61119,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.MenuItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.MenuItem) - if !ok { + if vc, ok := v.Value.(*fyne.MenuItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//is-separator!: arg 1: expected native of type *fyne.MenuItem") + return env.NewError("Go(*fyne.MenuItem)//is-separator!: arg 1: " + "expected native of type *fyne.MenuItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//is-separator!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.MenuItem)//is-separator!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//is-separator!: arg 1: expected native") + return env.NewError("Go(*fyne.MenuItem)//is-separator!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.IsSeparator = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//is-separator!: arg 2: expected integer") + return env.NewError("Go(*fyne.MenuItem)//is-separator!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.IsSeparator = newVal return arg0 }, }, @@ -62623,21 +61153,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.MenuItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.MenuItem) - if !ok { + if vc, ok := v.Value.(*fyne.MenuItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//is-separator?: arg 1: expected native of type *fyne.MenuItem") + return env.NewError("Go(*fyne.MenuItem)//is-separator?: arg 1: " + "expected native of type *fyne.MenuItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//is-separator?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.MenuItem)//is-separator?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//is-separator?: arg 1: expected native") + return env.NewError("Go(*fyne.MenuItem)//is-separator?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.IsSeparator)) @@ -62651,28 +61181,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.MenuItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.MenuItem) - if !ok { + if vc, ok := v.Value.(*fyne.MenuItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//label!: arg 1: expected native of type *fyne.MenuItem") + return env.NewError("Go(*fyne.MenuItem)//label!: arg 1: " + "expected native of type *fyne.MenuItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//label!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.MenuItem)//label!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//label!: arg 1: expected native") + return env.NewError("Go(*fyne.MenuItem)//label!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.Label = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//label!: arg 2: expected string") + return env.NewError("Go(*fyne.MenuItem)//label!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.Label = newVal return arg0 }, }, @@ -62683,21 +61215,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.MenuItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.MenuItem) - if !ok { + if vc, ok := v.Value.(*fyne.MenuItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//label?: arg 1: expected native of type *fyne.MenuItem") + return env.NewError("Go(*fyne.MenuItem)//label?: arg 1: " + "expected native of type *fyne.MenuItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//label?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.MenuItem)//label?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//label?: arg 1: expected native") + return env.NewError("Go(*fyne.MenuItem)//label?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.Label) @@ -62711,47 +61243,49 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.MenuItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.MenuItem) - if !ok { + if vc, ok := v.Value.(*fyne.MenuItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//shortcut!: arg 1: expected native of type *fyne.MenuItem") + return env.NewError("Go(*fyne.MenuItem)//shortcut!: arg 1: " + "expected native of type *fyne.MenuItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//shortcut!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.MenuItem)//shortcut!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//shortcut!: arg 1: expected native") + return env.NewError("Go(*fyne.MenuItem)//shortcut!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.Shortcut switch v := arg1.(type) { case env.RyeCtx: var err error - self.Shortcut, err = ctxTo_fyne_Shortcut(ps, v) + newVal, err = ctxTo_fyne_Shortcut(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//shortcut!: arg 2: " + err.Error() + "") + return env.NewError("Go(*fyne.MenuItem)//shortcut!: arg 2: " + err.Error()) } case env.Native: - var ok bool - self.Shortcut, ok = v.Value.(fyne.Shortcut) - if !ok { + if vc, ok := v.Value.(fyne.Shortcut); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//shortcut!: arg 2: expected native of type fyne.Shortcut") + return env.NewError("Go(*fyne.MenuItem)//shortcut!: arg 2: " + "expected native of type fyne.Shortcut, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//shortcut!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.MenuItem)//shortcut!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Shortcut = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//shortcut!: arg 2: expected native") + return env.NewError("Go(*fyne.MenuItem)//shortcut!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Shortcut = newVal return arg0 }, }, @@ -62762,41 +61296,24 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.MenuItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.MenuItem) - if !ok { + if vc, ok := v.Value.(*fyne.MenuItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//shortcut?: arg 1: expected native of type *fyne.MenuItem") + return env.NewError("Go(*fyne.MenuItem)//shortcut?: arg 1: " + "expected native of type *fyne.MenuItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//shortcut?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.MenuItem)//shortcut?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.MenuItem)//shortcut?: arg 1: expected native") + return env.NewError("Go(*fyne.MenuItem)//shortcut?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - { - typ := reflect.TypeOf(self.Shortcut) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - resObj = *env.NewNative(ps.Idx, self.Shortcut, typRyeName) - } else { - resObj = *env.NewNative(ps.Idx, self.Shortcut, "Go(fyne.Shortcut)") - } - } + resObj = ifaceToNative(ps.Idx, self.Shortcut, "Go(fyne.Shortcut)") return resObj }, }, @@ -62807,28 +61324,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Notification switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Notification) - if !ok { + if vc, ok := v.Value.(*fyne.Notification); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Notification)//content!: arg 1: expected native of type *fyne.Notification") + return env.NewError("Go(*fyne.Notification)//content!: arg 1: " + "expected native of type *fyne.Notification, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Notification)//content!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Notification)//content!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Notification)//content!: arg 1: expected native") + return env.NewError("Go(*fyne.Notification)//content!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.Content = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Notification)//content!: arg 2: expected string") + return env.NewError("Go(*fyne.Notification)//content!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.Content = newVal return arg0 }, }, @@ -62839,21 +61358,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Notification switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Notification) - if !ok { + if vc, ok := v.Value.(*fyne.Notification); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Notification)//content?: arg 1: expected native of type *fyne.Notification") + return env.NewError("Go(*fyne.Notification)//content?: arg 1: " + "expected native of type *fyne.Notification, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Notification)//content?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Notification)//content?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Notification)//content?: arg 1: expected native") + return env.NewError("Go(*fyne.Notification)//content?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.Content) @@ -62867,28 +61386,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Notification switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Notification) - if !ok { + if vc, ok := v.Value.(*fyne.Notification); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Notification)//title!: arg 1: expected native of type *fyne.Notification") + return env.NewError("Go(*fyne.Notification)//title!: arg 1: " + "expected native of type *fyne.Notification, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Notification)//title!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Notification)//title!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Notification)//title!: arg 1: expected native") + return env.NewError("Go(*fyne.Notification)//title!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.Title = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Notification)//title!: arg 2: expected string") + return env.NewError("Go(*fyne.Notification)//title!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.Title = newVal return arg0 }, }, @@ -62899,21 +61420,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Notification switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Notification) - if !ok { + if vc, ok := v.Value.(*fyne.Notification); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Notification)//title?: arg 1: expected native of type *fyne.Notification") + return env.NewError("Go(*fyne.Notification)//title?: arg 1: " + "expected native of type *fyne.Notification, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Notification)//title?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Notification)//title?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Notification)//title?: arg 1: expected native") + return env.NewError("Go(*fyne.Notification)//title?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.Title) @@ -62927,34 +61448,42 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.PointEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.PointEvent) - if !ok { + if vc, ok := v.Value.(*fyne.PointEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.PointEvent)//absolute-position!: arg 1: expected native of type *fyne.PointEvent") + return env.NewError("Go(*fyne.PointEvent)//absolute-position!: arg 1: " + "expected native of type *fyne.PointEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.PointEvent)//absolute-position!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.PointEvent)//absolute-position!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.PointEvent)//absolute-position!: arg 1: expected native") + return env.NewError("Go(*fyne.PointEvent)//absolute-position!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal *fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - self.AbsolutePosition, ok = v.Value.(fyne.Position) - if !ok { + if vc, ok := v.Value.(*fyne.Position); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.PointEvent)//absolute-position!: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.PointEvent)//absolute-position!: arg 2: expected native of type fyne.Position") + return env.NewError("Go(*fyne.PointEvent)//absolute-position!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.PointEvent)//absolute-position!: arg 2: expected native") + return env.NewError("Go(*fyne.PointEvent)//absolute-position!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.AbsolutePosition = *newVal return arg0 }, }, @@ -62965,21 +61494,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.PointEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.PointEvent) - if !ok { + if vc, ok := v.Value.(*fyne.PointEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.PointEvent)//absolute-position?: arg 1: expected native of type *fyne.PointEvent") + return env.NewError("Go(*fyne.PointEvent)//absolute-position?: arg 1: " + "expected native of type *fyne.PointEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.PointEvent)//absolute-position?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.PointEvent)//absolute-position?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.PointEvent)//absolute-position?: arg 1: expected native") + return env.NewError("Go(*fyne.PointEvent)//absolute-position?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, &self.AbsolutePosition, "Go(*fyne.Position)") @@ -62993,34 +61522,42 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.PointEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.PointEvent) - if !ok { + if vc, ok := v.Value.(*fyne.PointEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.PointEvent)//position!: arg 1: expected native of type *fyne.PointEvent") + return env.NewError("Go(*fyne.PointEvent)//position!: arg 1: " + "expected native of type *fyne.PointEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.PointEvent)//position!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.PointEvent)//position!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.PointEvent)//position!: arg 1: expected native") + return env.NewError("Go(*fyne.PointEvent)//position!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal *fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - self.Position, ok = v.Value.(fyne.Position) - if !ok { + if vc, ok := v.Value.(*fyne.Position); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.PointEvent)//position!: arg 2: expected native of type fyne.Position") + return env.NewError("Go(*fyne.PointEvent)//position!: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*fyne.PointEvent)//position!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.PointEvent)//position!: arg 2: expected native") + return env.NewError("Go(*fyne.PointEvent)//position!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Position = *newVal return arg0 }, }, @@ -63031,27 +61568,250 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.PointEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.PointEvent) - if !ok { + if vc, ok := v.Value.(*fyne.PointEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.PointEvent)//position?: arg 1: expected native of type *fyne.PointEvent") + return env.NewError("Go(*fyne.PointEvent)//position?: arg 1: " + "expected native of type *fyne.PointEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.PointEvent)//position?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.PointEvent)//position?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.PointEvent)//position?: arg 1: expected native") + return env.NewError("Go(*fyne.PointEvent)//position?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, &self.Position, "Go(*fyne.Position)") return resObj }, }, + "Go(*fyne.Position)//add": { + Doc: "fyne.Position.Add", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val fyne.Position + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.Position); ok { + arg0Val = *vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Position)//add: arg 1: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) + } + default: + ps.FailureFlag = true + return env.NewError("Go(*fyne.Position)//add: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var arg1Val fyne.Vector2 + switch v := arg1.(type) { + case env.RyeCtx: + var err error + arg1Val, err = ctxTo_fyne_Vector2(ps, v) + if err != nil { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Position)//add: arg 2: " + err.Error()) + } + case env.Native: + if vc, ok := v.Value.(fyne.Vector2); ok { + arg1Val = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Position)//add: arg 2: " + "expected native of type fyne.Vector2, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Position)//add: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg1Val = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*fyne.Position)//add: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + res0 := arg0Val.Add(arg1Val) + var res0Obj env.Object + res0Obj = *env.NewNative(ps.Idx, &res0, "Go(*fyne.Position)") + return res0Obj + }, + }, + "Go(*fyne.Position)//add-xy": { + Doc: "fyne.Position.AddXY", + Argsn: 3, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val fyne.Position + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.Position); ok { + arg0Val = *vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Position)//add-xy: arg 1: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) + } + default: + ps.FailureFlag = true + return env.NewError("Go(*fyne.Position)//add-xy: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var arg1Val float32 + if vc, ok := arg1.(env.Decimal); ok { + arg1Val = float32(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Position)//add-xy: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) + } + var arg2Val float32 + if vc, ok := arg2.(env.Decimal); ok { + arg2Val = float32(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Position)//add-xy: arg 3: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg2)) + } + res0 := arg0Val.AddXY(arg1Val, arg2Val) + var res0Obj env.Object + res0Obj = *env.NewNative(ps.Idx, &res0, "Go(*fyne.Position)") + return res0Obj + }, + }, + "Go(*fyne.Position)//components": { + Doc: "fyne.Position.Components", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val fyne.Position + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.Position); ok { + arg0Val = *vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Position)//components: arg 1: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) + } + default: + ps.FailureFlag = true + return env.NewError("Go(*fyne.Position)//components: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + res0, res1 := arg0Val.Components() + var res0Obj env.Object + res0Obj = *env.NewDecimal(float64(res0)) + var res1Obj env.Object + res1Obj = *env.NewDecimal(float64(res1)) + return *env.NewBlock(*env.NewTSeries([]env.Object{ + res0Obj, + res1Obj, + })) + }, + }, + "Go(*fyne.Position)//is-zero": { + Doc: "fyne.Position.IsZero", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val fyne.Position + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.Position); ok { + arg0Val = *vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Position)//is-zero: arg 1: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) + } + default: + ps.FailureFlag = true + return env.NewError("Go(*fyne.Position)//is-zero: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + res0 := arg0Val.IsZero() + var res0Obj env.Object + res0Obj = *env.NewInteger(boolToInt64(res0)) + return res0Obj + }, + }, + "Go(*fyne.Position)//subtract": { + Doc: "fyne.Position.Subtract", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val fyne.Position + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.Position); ok { + arg0Val = *vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Position)//subtract: arg 1: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) + } + default: + ps.FailureFlag = true + return env.NewError("Go(*fyne.Position)//subtract: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var arg1Val fyne.Vector2 + switch v := arg1.(type) { + case env.RyeCtx: + var err error + arg1Val, err = ctxTo_fyne_Vector2(ps, v) + if err != nil { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Position)//subtract: arg 2: " + err.Error()) + } + case env.Native: + if vc, ok := v.Value.(fyne.Vector2); ok { + arg1Val = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Position)//subtract: arg 2: " + "expected native of type fyne.Vector2, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Position)//subtract: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg1Val = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*fyne.Position)//subtract: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + res0 := arg0Val.Subtract(arg1Val) + var res0Obj env.Object + res0Obj = *env.NewNative(ps.Idx, &res0, "Go(*fyne.Position)") + return res0Obj + }, + }, + "Go(*fyne.Position)//subtract-xy": { + Doc: "fyne.Position.SubtractXY", + Argsn: 3, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val fyne.Position + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.Position); ok { + arg0Val = *vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Position)//subtract-xy: arg 1: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) + } + default: + ps.FailureFlag = true + return env.NewError("Go(*fyne.Position)//subtract-xy: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var arg1Val float32 + if vc, ok := arg1.(env.Decimal); ok { + arg1Val = float32(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Position)//subtract-xy: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) + } + var arg2Val float32 + if vc, ok := arg2.(env.Decimal); ok { + arg2Val = float32(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Position)//subtract-xy: arg 3: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg2)) + } + res0 := arg0Val.SubtractXY(arg1Val, arg2Val) + var res0Obj env.Object + res0Obj = *env.NewNative(ps.Idx, &res0, "Go(*fyne.Position)") + return res0Obj + }, + }, "Go(*fyne.Position)//x!": { Doc: "Set *fyne.Position X value", Argsn: 2, @@ -63059,28 +61819,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Position switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Position) - if !ok { + if vc, ok := v.Value.(*fyne.Position); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Position)//x!: arg 1: expected native of type *fyne.Position") + return env.NewError("Go(*fyne.Position)//x!: arg 1: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Position)//x!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Position)//x!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Position)//x!: arg 1: expected native") + return env.NewError("Go(*fyne.Position)//x!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Decimal); ok { - self.X = float32(v.Value) + var newVal float32 + if vc, ok := arg1.(env.Decimal); ok { + newVal = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Position)//x!: arg 2: expected decimal") + return env.NewError("Go(*fyne.Position)//x!: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } + self.X = newVal return arg0 }, }, @@ -63091,21 +61853,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Position switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Position) - if !ok { + if vc, ok := v.Value.(*fyne.Position); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Position)//x?: arg 1: expected native of type *fyne.Position") + return env.NewError("Go(*fyne.Position)//x?: arg 1: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Position)//x?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Position)//x?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Position)//x?: arg 1: expected native") + return env.NewError("Go(*fyne.Position)//x?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewDecimal(float64(self.X)) @@ -63119,28 +61881,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Position switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Position) - if !ok { + if vc, ok := v.Value.(*fyne.Position); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Position)//y!: arg 1: expected native of type *fyne.Position") + return env.NewError("Go(*fyne.Position)//y!: arg 1: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Position)//y!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Position)//y!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Position)//y!: arg 1: expected native") + return env.NewError("Go(*fyne.Position)//y!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Decimal); ok { - self.Y = float32(v.Value) + var newVal float32 + if vc, ok := arg1.(env.Decimal); ok { + newVal = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Position)//y!: arg 2: expected decimal") + return env.NewError("Go(*fyne.Position)//y!: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } + self.Y = newVal return arg0 }, }, @@ -63151,21 +61915,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Position switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Position) - if !ok { + if vc, ok := v.Value.(*fyne.Position); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Position)//y?: arg 1: expected native of type *fyne.Position") + return env.NewError("Go(*fyne.Position)//y?: arg 1: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Position)//y?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Position)//y?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Position)//y?: arg 1: expected native") + return env.NewError("Go(*fyne.Position)//y?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewDecimal(float64(self.Y)) @@ -63179,34 +61943,42 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.ScrollEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.ScrollEvent) - if !ok { + if vc, ok := v.Value.(*fyne.ScrollEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ScrollEvent)//absolute-position!: arg 1: expected native of type *fyne.ScrollEvent") + return env.NewError("Go(*fyne.ScrollEvent)//absolute-position!: arg 1: " + "expected native of type *fyne.ScrollEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ScrollEvent)//absolute-position!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ScrollEvent)//absolute-position!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ScrollEvent)//absolute-position!: arg 1: expected native") + return env.NewError("Go(*fyne.ScrollEvent)//absolute-position!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal *fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - self.AbsolutePosition, ok = v.Value.(fyne.Position) - if !ok { + if vc, ok := v.Value.(*fyne.Position); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.ScrollEvent)//absolute-position!: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ScrollEvent)//absolute-position!: arg 2: expected native of type fyne.Position") + return env.NewError("Go(*fyne.ScrollEvent)//absolute-position!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ScrollEvent)//absolute-position!: arg 2: expected native") + return env.NewError("Go(*fyne.ScrollEvent)//absolute-position!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.AbsolutePosition = *newVal return arg0 }, }, @@ -63217,27 +61989,101 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.ScrollEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.ScrollEvent) - if !ok { + if vc, ok := v.Value.(*fyne.ScrollEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ScrollEvent)//absolute-position?: arg 1: expected native of type *fyne.ScrollEvent") + return env.NewError("Go(*fyne.ScrollEvent)//absolute-position?: arg 1: " + "expected native of type *fyne.ScrollEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ScrollEvent)//absolute-position?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ScrollEvent)//absolute-position?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ScrollEvent)//absolute-position?: arg 1: expected native") + return env.NewError("Go(*fyne.ScrollEvent)//absolute-position?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, &self.AbsolutePosition, "Go(*fyne.Position)") return resObj }, }, + "Go(*fyne.ScrollEvent)//point-event!": { + Doc: "Set *fyne.ScrollEvent PointEvent value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *fyne.ScrollEvent + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.ScrollEvent); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.ScrollEvent)//point-event!: arg 1: " + "expected native of type *fyne.ScrollEvent, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*fyne.ScrollEvent)//point-event!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*fyne.ScrollEvent)//point-event!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *fyne.PointEvent + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.PointEvent); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.ScrollEvent)//point-event!: arg 2: " + "expected native of type *fyne.PointEvent, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*fyne.ScrollEvent)//point-event!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*fyne.ScrollEvent)//point-event!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.PointEvent = *newVal + return arg0 + }, + }, + "Go(*fyne.ScrollEvent)//point-event?": { + Doc: "Get *fyne.ScrollEvent PointEvent value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *fyne.ScrollEvent + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.ScrollEvent); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.ScrollEvent)//point-event?: arg 1: " + "expected native of type *fyne.ScrollEvent, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*fyne.ScrollEvent)//point-event?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*fyne.ScrollEvent)//point-event?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.PointEvent, "Go(*fyne.PointEvent)") + return resObj + }, + }, "Go(*fyne.ScrollEvent)//position!": { Doc: "Set *fyne.ScrollEvent Position value", Argsn: 2, @@ -63245,34 +62091,42 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.ScrollEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.ScrollEvent) - if !ok { + if vc, ok := v.Value.(*fyne.ScrollEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ScrollEvent)//position!: arg 1: expected native of type *fyne.ScrollEvent") + return env.NewError("Go(*fyne.ScrollEvent)//position!: arg 1: " + "expected native of type *fyne.ScrollEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ScrollEvent)//position!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ScrollEvent)//position!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ScrollEvent)//position!: arg 1: expected native") + return env.NewError("Go(*fyne.ScrollEvent)//position!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal *fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - self.Position, ok = v.Value.(fyne.Position) - if !ok { + if vc, ok := v.Value.(*fyne.Position); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ScrollEvent)//position!: arg 2: expected native of type fyne.Position") + return env.NewError("Go(*fyne.ScrollEvent)//position!: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*fyne.ScrollEvent)//position!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ScrollEvent)//position!: arg 2: expected native") + return env.NewError("Go(*fyne.ScrollEvent)//position!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Position = *newVal return arg0 }, }, @@ -63283,21 +62137,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.ScrollEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.ScrollEvent) - if !ok { + if vc, ok := v.Value.(*fyne.ScrollEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ScrollEvent)//position?: arg 1: expected native of type *fyne.ScrollEvent") + return env.NewError("Go(*fyne.ScrollEvent)//position?: arg 1: " + "expected native of type *fyne.ScrollEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ScrollEvent)//position?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ScrollEvent)//position?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ScrollEvent)//position?: arg 1: expected native") + return env.NewError("Go(*fyne.ScrollEvent)//position?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, &self.Position, "Go(*fyne.Position)") @@ -63311,34 +62165,42 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.ScrollEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.ScrollEvent) - if !ok { + if vc, ok := v.Value.(*fyne.ScrollEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ScrollEvent)//scrolled!: arg 1: expected native of type *fyne.ScrollEvent") + return env.NewError("Go(*fyne.ScrollEvent)//scrolled!: arg 1: " + "expected native of type *fyne.ScrollEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ScrollEvent)//scrolled!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ScrollEvent)//scrolled!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ScrollEvent)//scrolled!: arg 1: expected native") + return env.NewError("Go(*fyne.ScrollEvent)//scrolled!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal *fyne.Delta switch v := arg1.(type) { case env.Native: - var ok bool - self.Scrolled, ok = v.Value.(fyne.Delta) - if !ok { + if vc, ok := v.Value.(*fyne.Delta); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.ScrollEvent)//scrolled!: arg 2: " + "expected native of type *fyne.Delta, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ScrollEvent)//scrolled!: arg 2: expected native of type fyne.Delta") + return env.NewError("Go(*fyne.ScrollEvent)//scrolled!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ScrollEvent)//scrolled!: arg 2: expected native") + return env.NewError("Go(*fyne.ScrollEvent)//scrolled!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Scrolled = *newVal return arg0 }, }, @@ -63349,21 +62211,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.ScrollEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.ScrollEvent) - if !ok { + if vc, ok := v.Value.(*fyne.ScrollEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ScrollEvent)//scrolled?: arg 1: expected native of type *fyne.ScrollEvent") + return env.NewError("Go(*fyne.ScrollEvent)//scrolled?: arg 1: " + "expected native of type *fyne.ScrollEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ScrollEvent)//scrolled?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ScrollEvent)//scrolled?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ScrollEvent)//scrolled?: arg 1: expected native") + return env.NewError("Go(*fyne.ScrollEvent)//scrolled?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, &self.Scrolled, "Go(*fyne.Delta)") @@ -63377,47 +62239,49 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.ShortcutCopy switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.ShortcutCopy) - if !ok { + if vc, ok := v.Value.(*fyne.ShortcutCopy); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCopy)//clipboard!: arg 1: expected native of type *fyne.ShortcutCopy") + return env.NewError("Go(*fyne.ShortcutCopy)//clipboard!: arg 1: " + "expected native of type *fyne.ShortcutCopy, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCopy)//clipboard!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ShortcutCopy)//clipboard!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCopy)//clipboard!: arg 1: expected native") + return env.NewError("Go(*fyne.ShortcutCopy)//clipboard!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.Clipboard switch v := arg1.(type) { case env.RyeCtx: var err error - self.Clipboard, err = ctxTo_fyne_Clipboard(ps, v) + newVal, err = ctxTo_fyne_Clipboard(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCopy)//clipboard!: arg 2: " + err.Error() + "") + return env.NewError("Go(*fyne.ShortcutCopy)//clipboard!: arg 2: " + err.Error()) } case env.Native: - var ok bool - self.Clipboard, ok = v.Value.(fyne.Clipboard) - if !ok { + if vc, ok := v.Value.(fyne.Clipboard); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCopy)//clipboard!: arg 2: expected native of type fyne.Clipboard") + return env.NewError("Go(*fyne.ShortcutCopy)//clipboard!: arg 2: " + "expected native of type fyne.Clipboard, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCopy)//clipboard!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ShortcutCopy)//clipboard!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Clipboard = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCopy)//clipboard!: arg 2: expected native") + return env.NewError("Go(*fyne.ShortcutCopy)//clipboard!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Clipboard = newVal return arg0 }, }, @@ -63428,41 +62292,24 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.ShortcutCopy switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.ShortcutCopy) - if !ok { + if vc, ok := v.Value.(*fyne.ShortcutCopy); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCopy)//clipboard?: arg 1: expected native of type *fyne.ShortcutCopy") + return env.NewError("Go(*fyne.ShortcutCopy)//clipboard?: arg 1: " + "expected native of type *fyne.ShortcutCopy, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCopy)//clipboard?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ShortcutCopy)//clipboard?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCopy)//clipboard?: arg 1: expected native") + return env.NewError("Go(*fyne.ShortcutCopy)//clipboard?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - { - typ := reflect.TypeOf(self.Clipboard) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - resObj = *env.NewNative(ps.Idx, self.Clipboard, typRyeName) - } else { - resObj = *env.NewNative(ps.Idx, self.Clipboard, "Go(fyne.Clipboard)") - } - } + resObj = ifaceToNative(ps.Idx, self.Clipboard, "Go(fyne.Clipboard)") return resObj }, }, @@ -63473,21 +62320,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.ShortcutCopy switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.ShortcutCopy) - if !ok { + if vc, ok := v.Value.(*fyne.ShortcutCopy); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCopy)//key: arg 1: expected native of type *fyne.ShortcutCopy") + return env.NewError("Go(*fyne.ShortcutCopy)//key: arg 1: " + "expected native of type *fyne.ShortcutCopy, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCopy)//key: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ShortcutCopy)//key: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCopy)//key: arg 1: expected native") + return env.NewError("Go(*fyne.ShortcutCopy)//key: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Key() var res0Obj env.Object @@ -63502,21 +62349,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.ShortcutCopy switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.ShortcutCopy) - if !ok { + if vc, ok := v.Value.(*fyne.ShortcutCopy); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCopy)//mod: arg 1: expected native of type *fyne.ShortcutCopy") + return env.NewError("Go(*fyne.ShortcutCopy)//mod: arg 1: " + "expected native of type *fyne.ShortcutCopy, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCopy)//mod: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ShortcutCopy)//mod: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCopy)//mod: arg 1: expected native") + return env.NewError("Go(*fyne.ShortcutCopy)//mod: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Mod() var res0Obj env.Object @@ -63531,21 +62378,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.ShortcutCopy switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.ShortcutCopy) - if !ok { + if vc, ok := v.Value.(*fyne.ShortcutCopy); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCopy)//shortcut-name: arg 1: expected native of type *fyne.ShortcutCopy") + return env.NewError("Go(*fyne.ShortcutCopy)//shortcut-name: arg 1: " + "expected native of type *fyne.ShortcutCopy, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCopy)//shortcut-name: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ShortcutCopy)//shortcut-name: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCopy)//shortcut-name: arg 1: expected native") + return env.NewError("Go(*fyne.ShortcutCopy)//shortcut-name: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.ShortcutName() var res0Obj env.Object @@ -63560,47 +62407,49 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.ShortcutCut switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.ShortcutCut) - if !ok { + if vc, ok := v.Value.(*fyne.ShortcutCut); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCut)//clipboard!: arg 1: expected native of type *fyne.ShortcutCut") + return env.NewError("Go(*fyne.ShortcutCut)//clipboard!: arg 1: " + "expected native of type *fyne.ShortcutCut, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCut)//clipboard!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ShortcutCut)//clipboard!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCut)//clipboard!: arg 1: expected native") + return env.NewError("Go(*fyne.ShortcutCut)//clipboard!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.Clipboard switch v := arg1.(type) { case env.RyeCtx: var err error - self.Clipboard, err = ctxTo_fyne_Clipboard(ps, v) + newVal, err = ctxTo_fyne_Clipboard(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCut)//clipboard!: arg 2: " + err.Error() + "") + return env.NewError("Go(*fyne.ShortcutCut)//clipboard!: arg 2: " + err.Error()) } case env.Native: - var ok bool - self.Clipboard, ok = v.Value.(fyne.Clipboard) - if !ok { + if vc, ok := v.Value.(fyne.Clipboard); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCut)//clipboard!: arg 2: expected native of type fyne.Clipboard") + return env.NewError("Go(*fyne.ShortcutCut)//clipboard!: arg 2: " + "expected native of type fyne.Clipboard, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCut)//clipboard!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ShortcutCut)//clipboard!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Clipboard = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCut)//clipboard!: arg 2: expected native") + return env.NewError("Go(*fyne.ShortcutCut)//clipboard!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Clipboard = newVal return arg0 }, }, @@ -63611,41 +62460,24 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.ShortcutCut switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.ShortcutCut) - if !ok { + if vc, ok := v.Value.(*fyne.ShortcutCut); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCut)//clipboard?: arg 1: expected native of type *fyne.ShortcutCut") + return env.NewError("Go(*fyne.ShortcutCut)//clipboard?: arg 1: " + "expected native of type *fyne.ShortcutCut, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCut)//clipboard?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ShortcutCut)//clipboard?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCut)//clipboard?: arg 1: expected native") + return env.NewError("Go(*fyne.ShortcutCut)//clipboard?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - { - typ := reflect.TypeOf(self.Clipboard) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - resObj = *env.NewNative(ps.Idx, self.Clipboard, typRyeName) - } else { - resObj = *env.NewNative(ps.Idx, self.Clipboard, "Go(fyne.Clipboard)") - } - } + resObj = ifaceToNative(ps.Idx, self.Clipboard, "Go(fyne.Clipboard)") return resObj }, }, @@ -63656,21 +62488,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.ShortcutCut switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.ShortcutCut) - if !ok { + if vc, ok := v.Value.(*fyne.ShortcutCut); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCut)//key: arg 1: expected native of type *fyne.ShortcutCut") + return env.NewError("Go(*fyne.ShortcutCut)//key: arg 1: " + "expected native of type *fyne.ShortcutCut, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCut)//key: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ShortcutCut)//key: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCut)//key: arg 1: expected native") + return env.NewError("Go(*fyne.ShortcutCut)//key: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Key() var res0Obj env.Object @@ -63685,21 +62517,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.ShortcutCut switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.ShortcutCut) - if !ok { + if vc, ok := v.Value.(*fyne.ShortcutCut); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCut)//mod: arg 1: expected native of type *fyne.ShortcutCut") + return env.NewError("Go(*fyne.ShortcutCut)//mod: arg 1: " + "expected native of type *fyne.ShortcutCut, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCut)//mod: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ShortcutCut)//mod: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCut)//mod: arg 1: expected native") + return env.NewError("Go(*fyne.ShortcutCut)//mod: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Mod() var res0Obj env.Object @@ -63714,21 +62546,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.ShortcutCut switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.ShortcutCut) - if !ok { + if vc, ok := v.Value.(*fyne.ShortcutCut); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCut)//shortcut-name: arg 1: expected native of type *fyne.ShortcutCut") + return env.NewError("Go(*fyne.ShortcutCut)//shortcut-name: arg 1: " + "expected native of type *fyne.ShortcutCut, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCut)//shortcut-name: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ShortcutCut)//shortcut-name: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutCut)//shortcut-name: arg 1: expected native") + return env.NewError("Go(*fyne.ShortcutCut)//shortcut-name: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.ShortcutName() var res0Obj env.Object @@ -63743,21 +62575,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.ShortcutHandler switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.ShortcutHandler) - if !ok { + if vc, ok := v.Value.(*fyne.ShortcutHandler); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutHandler)//add-shortcut: arg 1: expected native of type *fyne.ShortcutHandler") + return env.NewError("Go(*fyne.ShortcutHandler)//add-shortcut: arg 1: " + "expected native of type *fyne.ShortcutHandler, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutHandler)//add-shortcut: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ShortcutHandler)//add-shortcut: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutHandler)//add-shortcut: arg 1: expected native") + return env.NewError("Go(*fyne.ShortcutHandler)//add-shortcut: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Shortcut switch v := arg1.(type) { @@ -63766,65 +62598,48 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Shortcut(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutHandler)//add-shortcut: arg 2: " + err.Error() + "") + return env.NewError("Go(*fyne.ShortcutHandler)//add-shortcut: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Shortcut) - if !ok { + if vc, ok := v.Value.(fyne.Shortcut); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutHandler)//add-shortcut: arg 2: expected native of type fyne.Shortcut") + return env.NewError("Go(*fyne.ShortcutHandler)//add-shortcut: arg 2: " + "expected native of type fyne.Shortcut, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutHandler)//add-shortcut: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ShortcutHandler)//add-shortcut: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutHandler)//add-shortcut: arg 2: expected native") + return env.NewError("Go(*fyne.ShortcutHandler)//add-shortcut: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg2Val func(fyne.Shortcut) switch fn := arg2.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutHandler)//add-shortcut: arg 3: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*fyne.ShortcutHandler)//add-shortcut: arg 3: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg2Val = func(arg0 fyne.Shortcut) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.Shortcut)") - } - } + arg2Val = func(farg0 fyne.Shortcut) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.Shortcut)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutHandler)//add-shortcut: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ShortcutHandler)//add-shortcut: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutHandler)//add-shortcut: arg 3: expected function or nil") + return env.NewError("Go(*fyne.ShortcutHandler)//add-shortcut: arg 3: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } arg0Val.AddShortcut(arg1Val, arg2Val) return arg0 @@ -63837,21 +62652,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.ShortcutHandler switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.ShortcutHandler) - if !ok { + if vc, ok := v.Value.(*fyne.ShortcutHandler); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutHandler)//remove-shortcut: arg 1: expected native of type *fyne.ShortcutHandler") + return env.NewError("Go(*fyne.ShortcutHandler)//remove-shortcut: arg 1: " + "expected native of type *fyne.ShortcutHandler, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutHandler)//remove-shortcut: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ShortcutHandler)//remove-shortcut: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutHandler)//remove-shortcut: arg 1: expected native") + return env.NewError("Go(*fyne.ShortcutHandler)//remove-shortcut: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Shortcut switch v := arg1.(type) { @@ -63860,24 +62675,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Shortcut(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutHandler)//remove-shortcut: arg 2: " + err.Error() + "") + return env.NewError("Go(*fyne.ShortcutHandler)//remove-shortcut: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Shortcut) - if !ok { + if vc, ok := v.Value.(fyne.Shortcut); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutHandler)//remove-shortcut: arg 2: expected native of type fyne.Shortcut") + return env.NewError("Go(*fyne.ShortcutHandler)//remove-shortcut: arg 2: " + "expected native of type fyne.Shortcut, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutHandler)//remove-shortcut: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ShortcutHandler)//remove-shortcut: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutHandler)//remove-shortcut: arg 2: expected native") + return env.NewError("Go(*fyne.ShortcutHandler)//remove-shortcut: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveShortcut(arg1Val) return arg0 @@ -63890,21 +62705,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.ShortcutHandler switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.ShortcutHandler) - if !ok { + if vc, ok := v.Value.(*fyne.ShortcutHandler); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutHandler)//typed-shortcut: arg 1: expected native of type *fyne.ShortcutHandler") + return env.NewError("Go(*fyne.ShortcutHandler)//typed-shortcut: arg 1: " + "expected native of type *fyne.ShortcutHandler, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutHandler)//typed-shortcut: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ShortcutHandler)//typed-shortcut: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutHandler)//typed-shortcut: arg 1: expected native") + return env.NewError("Go(*fyne.ShortcutHandler)//typed-shortcut: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Shortcut switch v := arg1.(type) { @@ -63913,24 +62728,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Shortcut(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutHandler)//typed-shortcut: arg 2: " + err.Error() + "") + return env.NewError("Go(*fyne.ShortcutHandler)//typed-shortcut: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Shortcut) - if !ok { + if vc, ok := v.Value.(fyne.Shortcut); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutHandler)//typed-shortcut: arg 2: expected native of type fyne.Shortcut") + return env.NewError("Go(*fyne.ShortcutHandler)//typed-shortcut: arg 2: " + "expected native of type fyne.Shortcut, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutHandler)//typed-shortcut: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ShortcutHandler)//typed-shortcut: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutHandler)//typed-shortcut: arg 2: expected native") + return env.NewError("Go(*fyne.ShortcutHandler)//typed-shortcut: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedShortcut(arg1Val) return arg0 @@ -63943,47 +62758,49 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.ShortcutPaste switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.ShortcutPaste) - if !ok { + if vc, ok := v.Value.(*fyne.ShortcutPaste); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutPaste)//clipboard!: arg 1: expected native of type *fyne.ShortcutPaste") + return env.NewError("Go(*fyne.ShortcutPaste)//clipboard!: arg 1: " + "expected native of type *fyne.ShortcutPaste, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutPaste)//clipboard!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ShortcutPaste)//clipboard!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutPaste)//clipboard!: arg 1: expected native") + return env.NewError("Go(*fyne.ShortcutPaste)//clipboard!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.Clipboard switch v := arg1.(type) { case env.RyeCtx: var err error - self.Clipboard, err = ctxTo_fyne_Clipboard(ps, v) + newVal, err = ctxTo_fyne_Clipboard(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutPaste)//clipboard!: arg 2: " + err.Error() + "") + return env.NewError("Go(*fyne.ShortcutPaste)//clipboard!: arg 2: " + err.Error()) } case env.Native: - var ok bool - self.Clipboard, ok = v.Value.(fyne.Clipboard) - if !ok { + if vc, ok := v.Value.(fyne.Clipboard); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutPaste)//clipboard!: arg 2: expected native of type fyne.Clipboard") + return env.NewError("Go(*fyne.ShortcutPaste)//clipboard!: arg 2: " + "expected native of type fyne.Clipboard, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutPaste)//clipboard!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ShortcutPaste)//clipboard!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Clipboard = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutPaste)//clipboard!: arg 2: expected native") + return env.NewError("Go(*fyne.ShortcutPaste)//clipboard!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Clipboard = newVal return arg0 }, }, @@ -63994,41 +62811,24 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.ShortcutPaste switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.ShortcutPaste) - if !ok { + if vc, ok := v.Value.(*fyne.ShortcutPaste); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutPaste)//clipboard?: arg 1: expected native of type *fyne.ShortcutPaste") + return env.NewError("Go(*fyne.ShortcutPaste)//clipboard?: arg 1: " + "expected native of type *fyne.ShortcutPaste, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutPaste)//clipboard?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ShortcutPaste)//clipboard?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutPaste)//clipboard?: arg 1: expected native") + return env.NewError("Go(*fyne.ShortcutPaste)//clipboard?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - { - typ := reflect.TypeOf(self.Clipboard) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - resObj = *env.NewNative(ps.Idx, self.Clipboard, typRyeName) - } else { - resObj = *env.NewNative(ps.Idx, self.Clipboard, "Go(fyne.Clipboard)") - } - } + resObj = ifaceToNative(ps.Idx, self.Clipboard, "Go(fyne.Clipboard)") return resObj }, }, @@ -64039,21 +62839,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.ShortcutPaste switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.ShortcutPaste) - if !ok { + if vc, ok := v.Value.(*fyne.ShortcutPaste); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutPaste)//key: arg 1: expected native of type *fyne.ShortcutPaste") + return env.NewError("Go(*fyne.ShortcutPaste)//key: arg 1: " + "expected native of type *fyne.ShortcutPaste, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutPaste)//key: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ShortcutPaste)//key: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutPaste)//key: arg 1: expected native") + return env.NewError("Go(*fyne.ShortcutPaste)//key: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Key() var res0Obj env.Object @@ -64068,21 +62868,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.ShortcutPaste switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.ShortcutPaste) - if !ok { + if vc, ok := v.Value.(*fyne.ShortcutPaste); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutPaste)//mod: arg 1: expected native of type *fyne.ShortcutPaste") + return env.NewError("Go(*fyne.ShortcutPaste)//mod: arg 1: " + "expected native of type *fyne.ShortcutPaste, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutPaste)//mod: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ShortcutPaste)//mod: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutPaste)//mod: arg 1: expected native") + return env.NewError("Go(*fyne.ShortcutPaste)//mod: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Mod() var res0Obj env.Object @@ -64097,21 +62897,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.ShortcutPaste switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.ShortcutPaste) - if !ok { + if vc, ok := v.Value.(*fyne.ShortcutPaste); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutPaste)//shortcut-name: arg 1: expected native of type *fyne.ShortcutPaste") + return env.NewError("Go(*fyne.ShortcutPaste)//shortcut-name: arg 1: " + "expected native of type *fyne.ShortcutPaste, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutPaste)//shortcut-name: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ShortcutPaste)//shortcut-name: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutPaste)//shortcut-name: arg 1: expected native") + return env.NewError("Go(*fyne.ShortcutPaste)//shortcut-name: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.ShortcutName() var res0Obj env.Object @@ -64126,21 +62926,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.ShortcutSelectAll switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.ShortcutSelectAll) - if !ok { + if vc, ok := v.Value.(*fyne.ShortcutSelectAll); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutSelectAll)//key: arg 1: expected native of type *fyne.ShortcutSelectAll") + return env.NewError("Go(*fyne.ShortcutSelectAll)//key: arg 1: " + "expected native of type *fyne.ShortcutSelectAll, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutSelectAll)//key: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ShortcutSelectAll)//key: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutSelectAll)//key: arg 1: expected native") + return env.NewError("Go(*fyne.ShortcutSelectAll)//key: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Key() var res0Obj env.Object @@ -64155,21 +62955,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.ShortcutSelectAll switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.ShortcutSelectAll) - if !ok { + if vc, ok := v.Value.(*fyne.ShortcutSelectAll); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutSelectAll)//mod: arg 1: expected native of type *fyne.ShortcutSelectAll") + return env.NewError("Go(*fyne.ShortcutSelectAll)//mod: arg 1: " + "expected native of type *fyne.ShortcutSelectAll, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutSelectAll)//mod: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ShortcutSelectAll)//mod: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutSelectAll)//mod: arg 1: expected native") + return env.NewError("Go(*fyne.ShortcutSelectAll)//mod: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Mod() var res0Obj env.Object @@ -64184,21 +62984,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.ShortcutSelectAll switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.ShortcutSelectAll) - if !ok { + if vc, ok := v.Value.(*fyne.ShortcutSelectAll); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutSelectAll)//shortcut-name: arg 1: expected native of type *fyne.ShortcutSelectAll") + return env.NewError("Go(*fyne.ShortcutSelectAll)//shortcut-name: arg 1: " + "expected native of type *fyne.ShortcutSelectAll, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutSelectAll)//shortcut-name: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.ShortcutSelectAll)//shortcut-name: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.ShortcutSelectAll)//shortcut-name: arg 1: expected native") + return env.NewError("Go(*fyne.ShortcutSelectAll)//shortcut-name: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.ShortcutName() var res0Obj env.Object @@ -64206,6 +63006,120 @@ var Builtins = map[string]*env.Builtin{ return res0Obj }, }, + "Go(*fyne.Size)//add": { + Doc: "fyne.Size.Add", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val fyne.Size + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.Size); ok { + arg0Val = *vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//add: arg 1: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) + } + default: + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//add: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var arg1Val fyne.Vector2 + switch v := arg1.(type) { + case env.RyeCtx: + var err error + arg1Val, err = ctxTo_fyne_Vector2(ps, v) + if err != nil { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//add: arg 2: " + err.Error()) + } + case env.Native: + if vc, ok := v.Value.(fyne.Vector2); ok { + arg1Val = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//add: arg 2: " + "expected native of type fyne.Vector2, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//add: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg1Val = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//add: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + res0 := arg0Val.Add(arg1Val) + var res0Obj env.Object + res0Obj = *env.NewNative(ps.Idx, &res0, "Go(*fyne.Size)") + return res0Obj + }, + }, + "Go(*fyne.Size)//add-width-height": { + Doc: "fyne.Size.AddWidthHeight", + Argsn: 3, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val fyne.Size + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.Size); ok { + arg0Val = *vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//add-width-height: arg 1: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) + } + default: + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//add-width-height: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var arg1Val float32 + if vc, ok := arg1.(env.Decimal); ok { + arg1Val = float32(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//add-width-height: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) + } + var arg2Val float32 + if vc, ok := arg2.(env.Decimal); ok { + arg2Val = float32(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//add-width-height: arg 3: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg2)) + } + res0 := arg0Val.AddWidthHeight(arg1Val, arg2Val) + var res0Obj env.Object + res0Obj = *env.NewNative(ps.Idx, &res0, "Go(*fyne.Size)") + return res0Obj + }, + }, + "Go(*fyne.Size)//components": { + Doc: "fyne.Size.Components", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val fyne.Size + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.Size); ok { + arg0Val = *vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//components: arg 1: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) + } + default: + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//components: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + res0, res1 := arg0Val.Components() + var res0Obj env.Object + res0Obj = *env.NewDecimal(float64(res0)) + var res1Obj env.Object + res1Obj = *env.NewDecimal(float64(res1)) + return *env.NewBlock(*env.NewTSeries([]env.Object{ + res0Obj, + res1Obj, + })) + }, + }, "Go(*fyne.Size)//height!": { Doc: "Set *fyne.Size Height value", Argsn: 2, @@ -64213,28 +63127,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Size switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Size) - if !ok { + if vc, ok := v.Value.(*fyne.Size); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Size)//height!: arg 1: expected native of type *fyne.Size") + return env.NewError("Go(*fyne.Size)//height!: arg 1: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Size)//height!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Size)//height!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Size)//height!: arg 1: expected native") + return env.NewError("Go(*fyne.Size)//height!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Decimal); ok { - self.Height = float32(v.Value) + var newVal float32 + if vc, ok := arg1.(env.Decimal); ok { + newVal = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Size)//height!: arg 2: expected decimal") + return env.NewError("Go(*fyne.Size)//height!: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } + self.Height = newVal return arg0 }, }, @@ -64245,27 +63161,234 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Size switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Size) - if !ok { + if vc, ok := v.Value.(*fyne.Size); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Size)//height?: arg 1: expected native of type *fyne.Size") + return env.NewError("Go(*fyne.Size)//height?: arg 1: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Size)//height?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Size)//height?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Size)//height?: arg 1: expected native") + return env.NewError("Go(*fyne.Size)//height?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewDecimal(float64(self.Height)) return resObj }, }, + "Go(*fyne.Size)//is-zero": { + Doc: "fyne.Size.IsZero", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val fyne.Size + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.Size); ok { + arg0Val = *vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//is-zero: arg 1: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) + } + default: + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//is-zero: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + res0 := arg0Val.IsZero() + var res0Obj env.Object + res0Obj = *env.NewInteger(boolToInt64(res0)) + return res0Obj + }, + }, + "Go(*fyne.Size)//max": { + Doc: "fyne.Size.Max", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val fyne.Size + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.Size); ok { + arg0Val = *vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//max: arg 1: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) + } + default: + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//max: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var arg1Val fyne.Vector2 + switch v := arg1.(type) { + case env.RyeCtx: + var err error + arg1Val, err = ctxTo_fyne_Vector2(ps, v) + if err != nil { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//max: arg 2: " + err.Error()) + } + case env.Native: + if vc, ok := v.Value.(fyne.Vector2); ok { + arg1Val = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//max: arg 2: " + "expected native of type fyne.Vector2, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//max: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg1Val = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//max: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + res0 := arg0Val.Max(arg1Val) + var res0Obj env.Object + res0Obj = *env.NewNative(ps.Idx, &res0, "Go(*fyne.Size)") + return res0Obj + }, + }, + "Go(*fyne.Size)//min": { + Doc: "fyne.Size.Min", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val fyne.Size + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.Size); ok { + arg0Val = *vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//min: arg 1: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) + } + default: + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//min: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var arg1Val fyne.Vector2 + switch v := arg1.(type) { + case env.RyeCtx: + var err error + arg1Val, err = ctxTo_fyne_Vector2(ps, v) + if err != nil { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//min: arg 2: " + err.Error()) + } + case env.Native: + if vc, ok := v.Value.(fyne.Vector2); ok { + arg1Val = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//min: arg 2: " + "expected native of type fyne.Vector2, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//min: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg1Val = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//min: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + res0 := arg0Val.Min(arg1Val) + var res0Obj env.Object + res0Obj = *env.NewNative(ps.Idx, &res0, "Go(*fyne.Size)") + return res0Obj + }, + }, + "Go(*fyne.Size)//subtract": { + Doc: "fyne.Size.Subtract", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val fyne.Size + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.Size); ok { + arg0Val = *vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//subtract: arg 1: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) + } + default: + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//subtract: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var arg1Val fyne.Vector2 + switch v := arg1.(type) { + case env.RyeCtx: + var err error + arg1Val, err = ctxTo_fyne_Vector2(ps, v) + if err != nil { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//subtract: arg 2: " + err.Error()) + } + case env.Native: + if vc, ok := v.Value.(fyne.Vector2); ok { + arg1Val = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//subtract: arg 2: " + "expected native of type fyne.Vector2, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//subtract: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg1Val = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//subtract: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + res0 := arg0Val.Subtract(arg1Val) + var res0Obj env.Object + res0Obj = *env.NewNative(ps.Idx, &res0, "Go(*fyne.Size)") + return res0Obj + }, + }, + "Go(*fyne.Size)//subtract-width-height": { + Doc: "fyne.Size.SubtractWidthHeight", + Argsn: 3, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val fyne.Size + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.Size); ok { + arg0Val = *vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//subtract-width-height: arg 1: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) + } + default: + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//subtract-width-height: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var arg1Val float32 + if vc, ok := arg1.(env.Decimal); ok { + arg1Val = float32(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//subtract-width-height: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) + } + var arg2Val float32 + if vc, ok := arg2.(env.Decimal); ok { + arg2Val = float32(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*fyne.Size)//subtract-width-height: arg 3: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg2)) + } + res0 := arg0Val.SubtractWidthHeight(arg1Val, arg2Val) + var res0Obj env.Object + res0Obj = *env.NewNative(ps.Idx, &res0, "Go(*fyne.Size)") + return res0Obj + }, + }, "Go(*fyne.Size)//width!": { Doc: "Set *fyne.Size Width value", Argsn: 2, @@ -64273,28 +63396,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Size switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Size) - if !ok { + if vc, ok := v.Value.(*fyne.Size); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Size)//width!: arg 1: expected native of type *fyne.Size") + return env.NewError("Go(*fyne.Size)//width!: arg 1: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Size)//width!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Size)//width!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Size)//width!: arg 1: expected native") + return env.NewError("Go(*fyne.Size)//width!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Decimal); ok { - self.Width = float32(v.Value) + var newVal float32 + if vc, ok := arg1.(env.Decimal); ok { + newVal = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Size)//width!: arg 2: expected decimal") + return env.NewError("Go(*fyne.Size)//width!: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } + self.Width = newVal return arg0 }, }, @@ -64305,21 +63430,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.Size switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.Size) - if !ok { + if vc, ok := v.Value.(*fyne.Size); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.Size)//width?: arg 1: expected native of type *fyne.Size") + return env.NewError("Go(*fyne.Size)//width?: arg 1: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.Size)//width?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.Size)//width?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.Size)//width?: arg 1: expected native") + return env.NewError("Go(*fyne.Size)//width?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewDecimal(float64(self.Width)) @@ -64333,21 +63458,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.StaticResource switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.StaticResource) - if !ok { + if vc, ok := v.Value.(*fyne.StaticResource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.StaticResource)//content: arg 1: expected native of type *fyne.StaticResource") + return env.NewError("Go(*fyne.StaticResource)//content: arg 1: " + "expected native of type *fyne.StaticResource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.StaticResource)//content: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.StaticResource)//content: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.StaticResource)//content: arg 1: expected native") + return env.NewError("Go(*fyne.StaticResource)//content: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Content() var res0Obj env.Object @@ -64368,21 +63493,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.StaticResource switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.StaticResource) - if !ok { + if vc, ok := v.Value.(*fyne.StaticResource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.StaticResource)//go-string: arg 1: expected native of type *fyne.StaticResource") + return env.NewError("Go(*fyne.StaticResource)//go-string: arg 1: " + "expected native of type *fyne.StaticResource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.StaticResource)//go-string: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.StaticResource)//go-string: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.StaticResource)//go-string: arg 1: expected native") + return env.NewError("Go(*fyne.StaticResource)//go-string: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.GoString() var res0Obj env.Object @@ -64397,21 +63522,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.StaticResource switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.StaticResource) - if !ok { + if vc, ok := v.Value.(*fyne.StaticResource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.StaticResource)//name: arg 1: expected native of type *fyne.StaticResource") + return env.NewError("Go(*fyne.StaticResource)//name: arg 1: " + "expected native of type *fyne.StaticResource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.StaticResource)//name: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.StaticResource)//name: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.StaticResource)//name: arg 1: expected native") + return env.NewError("Go(*fyne.StaticResource)//name: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Name() var res0Obj env.Object @@ -64426,56 +63551,51 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.StaticResource switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.StaticResource) - if !ok { + if vc, ok := v.Value.(*fyne.StaticResource); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.StaticResource)//static-content!: arg 1: expected native of type *fyne.StaticResource") + return env.NewError("Go(*fyne.StaticResource)//static-content!: arg 1: " + "expected native of type *fyne.StaticResource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.StaticResource)//static-content!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.StaticResource)//static-content!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.StaticResource)//static-content!: arg 1: expected native") + return env.NewError("Go(*fyne.StaticResource)//static-content!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal []byte switch v := arg1.(type) { case env.Block: - self.StaticContent = make([]byte, len(v.Series.S)) + newVal = make([]byte, len(v.Series.S)) for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - self.StaticContent[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + newVal[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.StaticResource)//static-content!: arg 2: block item: expected native of type byte") + return env.NewError("Go(*fyne.StaticResource)//static-content!: arg 2: " + "block item: " + "expected native of type byte, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*fyne.StaticResource)//static-content!: arg 2: block item: expected native") + return env.NewError("Go(*fyne.StaticResource)//static-content!: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - self.StaticContent, ok = v.Value.([]byte) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*fyne.StaticResource)//static-content!: arg 2: expected native of type []byte") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.StaticResource)//static-content!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.StaticResource)//static-content!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.StaticContent = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.StaticResource)//static-content!: arg 2: expected block, native or nil") + return env.NewError("Go(*fyne.StaticResource)//static-content!: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } + self.StaticContent = newVal return arg0 }, }, @@ -64486,21 +63606,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.StaticResource switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.StaticResource) - if !ok { + if vc, ok := v.Value.(*fyne.StaticResource); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.StaticResource)//static-content?: arg 1: expected native of type *fyne.StaticResource") + return env.NewError("Go(*fyne.StaticResource)//static-content?: arg 1: " + "expected native of type *fyne.StaticResource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.StaticResource)//static-content?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.StaticResource)//static-content?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.StaticResource)//static-content?: arg 1: expected native") + return env.NewError("Go(*fyne.StaticResource)//static-content?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object { @@ -64520,28 +63640,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.StaticResource switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.StaticResource) - if !ok { + if vc, ok := v.Value.(*fyne.StaticResource); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.StaticResource)//static-name!: arg 1: expected native of type *fyne.StaticResource") + return env.NewError("Go(*fyne.StaticResource)//static-name!: arg 1: " + "expected native of type *fyne.StaticResource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.StaticResource)//static-name!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.StaticResource)//static-name!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.StaticResource)//static-name!: arg 1: expected native") + return env.NewError("Go(*fyne.StaticResource)//static-name!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.StaticName = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.StaticResource)//static-name!: arg 2: expected string") + return env.NewError("Go(*fyne.StaticResource)//static-name!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.StaticName = newVal return arg0 }, }, @@ -64552,21 +63674,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.StaticResource switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.StaticResource) - if !ok { + if vc, ok := v.Value.(*fyne.StaticResource); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.StaticResource)//static-name?: arg 1: expected native of type *fyne.StaticResource") + return env.NewError("Go(*fyne.StaticResource)//static-name?: arg 1: " + "expected native of type *fyne.StaticResource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.StaticResource)//static-name?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.StaticResource)//static-name?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.StaticResource)//static-name?: arg 1: expected native") + return env.NewError("Go(*fyne.StaticResource)//static-name?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.StaticName) @@ -64580,28 +63702,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.TextStyle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.TextStyle) - if !ok { + if vc, ok := v.Value.(*fyne.TextStyle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//bold!: arg 1: expected native of type *fyne.TextStyle") + return env.NewError("Go(*fyne.TextStyle)//bold!: arg 1: " + "expected native of type *fyne.TextStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//bold!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.TextStyle)//bold!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//bold!: arg 1: expected native") + return env.NewError("Go(*fyne.TextStyle)//bold!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Bold = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//bold!: arg 2: expected integer") + return env.NewError("Go(*fyne.TextStyle)//bold!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Bold = newVal return arg0 }, }, @@ -64612,21 +63736,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.TextStyle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.TextStyle) - if !ok { + if vc, ok := v.Value.(*fyne.TextStyle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//bold?: arg 1: expected native of type *fyne.TextStyle") + return env.NewError("Go(*fyne.TextStyle)//bold?: arg 1: " + "expected native of type *fyne.TextStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//bold?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.TextStyle)//bold?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//bold?: arg 1: expected native") + return env.NewError("Go(*fyne.TextStyle)//bold?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Bold)) @@ -64640,28 +63764,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.TextStyle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.TextStyle) - if !ok { + if vc, ok := v.Value.(*fyne.TextStyle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//italic!: arg 1: expected native of type *fyne.TextStyle") + return env.NewError("Go(*fyne.TextStyle)//italic!: arg 1: " + "expected native of type *fyne.TextStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//italic!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.TextStyle)//italic!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//italic!: arg 1: expected native") + return env.NewError("Go(*fyne.TextStyle)//italic!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Italic = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//italic!: arg 2: expected integer") + return env.NewError("Go(*fyne.TextStyle)//italic!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Italic = newVal return arg0 }, }, @@ -64672,21 +63798,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.TextStyle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.TextStyle) - if !ok { + if vc, ok := v.Value.(*fyne.TextStyle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//italic?: arg 1: expected native of type *fyne.TextStyle") + return env.NewError("Go(*fyne.TextStyle)//italic?: arg 1: " + "expected native of type *fyne.TextStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//italic?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.TextStyle)//italic?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//italic?: arg 1: expected native") + return env.NewError("Go(*fyne.TextStyle)//italic?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Italic)) @@ -64700,28 +63826,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.TextStyle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.TextStyle) - if !ok { + if vc, ok := v.Value.(*fyne.TextStyle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//monospace!: arg 1: expected native of type *fyne.TextStyle") + return env.NewError("Go(*fyne.TextStyle)//monospace!: arg 1: " + "expected native of type *fyne.TextStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//monospace!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.TextStyle)//monospace!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//monospace!: arg 1: expected native") + return env.NewError("Go(*fyne.TextStyle)//monospace!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Monospace = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//monospace!: arg 2: expected integer") + return env.NewError("Go(*fyne.TextStyle)//monospace!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Monospace = newVal return arg0 }, }, @@ -64732,21 +63860,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.TextStyle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.TextStyle) - if !ok { + if vc, ok := v.Value.(*fyne.TextStyle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//monospace?: arg 1: expected native of type *fyne.TextStyle") + return env.NewError("Go(*fyne.TextStyle)//monospace?: arg 1: " + "expected native of type *fyne.TextStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//monospace?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.TextStyle)//monospace?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//monospace?: arg 1: expected native") + return env.NewError("Go(*fyne.TextStyle)//monospace?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Monospace)) @@ -64760,28 +63888,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.TextStyle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.TextStyle) - if !ok { + if vc, ok := v.Value.(*fyne.TextStyle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//symbol!: arg 1: expected native of type *fyne.TextStyle") + return env.NewError("Go(*fyne.TextStyle)//symbol!: arg 1: " + "expected native of type *fyne.TextStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//symbol!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.TextStyle)//symbol!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//symbol!: arg 1: expected native") + return env.NewError("Go(*fyne.TextStyle)//symbol!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Symbol = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//symbol!: arg 2: expected integer") + return env.NewError("Go(*fyne.TextStyle)//symbol!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Symbol = newVal return arg0 }, }, @@ -64792,21 +63922,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.TextStyle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.TextStyle) - if !ok { + if vc, ok := v.Value.(*fyne.TextStyle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//symbol?: arg 1: expected native of type *fyne.TextStyle") + return env.NewError("Go(*fyne.TextStyle)//symbol?: arg 1: " + "expected native of type *fyne.TextStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//symbol?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.TextStyle)//symbol?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//symbol?: arg 1: expected native") + return env.NewError("Go(*fyne.TextStyle)//symbol?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Symbol)) @@ -64820,28 +63950,30 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.TextStyle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.TextStyle) - if !ok { + if vc, ok := v.Value.(*fyne.TextStyle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//tab-width!: arg 1: expected native of type *fyne.TextStyle") + return env.NewError("Go(*fyne.TextStyle)//tab-width!: arg 1: " + "expected native of type *fyne.TextStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//tab-width!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.TextStyle)//tab-width!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//tab-width!: arg 1: expected native") + return env.NewError("Go(*fyne.TextStyle)//tab-width!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.TabWidth = int(v.Value) + var newVal int + if vc, ok := arg1.(env.Integer); ok { + newVal = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//tab-width!: arg 2: expected integer") + return env.NewError("Go(*fyne.TextStyle)//tab-width!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.TabWidth = newVal return arg0 }, }, @@ -64852,21 +63984,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne.TextStyle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne.TextStyle) - if !ok { + if vc, ok := v.Value.(*fyne.TextStyle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//tab-width?: arg 1: expected native of type *fyne.TextStyle") + return env.NewError("Go(*fyne.TextStyle)//tab-width?: arg 1: " + "expected native of type *fyne.TextStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//tab-width?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne.TextStyle)//tab-width?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne.TextStyle)//tab-width?: arg 1: expected native") + return env.NewError("Go(*fyne.TextStyle)//tab-width?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(self.TabWidth)) @@ -64880,34 +64012,36 @@ var Builtins = map[string]*env.Builtin{ var self *fyne_driver.AndroidContext switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne_driver.AndroidContext) - if !ok { + if vc, ok := v.Value.(*fyne_driver.AndroidContext); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne_driver.AndroidContext)//ctx!: arg 1: expected native of type *fyne_driver.AndroidContext") + return env.NewError("Go(*fyne_driver.AndroidContext)//ctx!: arg 1: " + "expected native of type *fyne_driver.AndroidContext, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne_driver.AndroidContext)//ctx!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne_driver.AndroidContext)//ctx!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne_driver.AndroidContext)//ctx!: arg 1: expected native") + return env.NewError("Go(*fyne_driver.AndroidContext)//ctx!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal uintptr switch v := arg1.(type) { case env.Native: - var ok bool - self.Ctx, ok = v.Value.(uintptr) - if !ok { + if vc, ok := v.Value.(uintptr); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne_driver.AndroidContext)//ctx!: arg 2: expected native of type uintptr") + return env.NewError("Go(*fyne_driver.AndroidContext)//ctx!: arg 2: " + "expected native of type uintptr, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*fyne_driver.AndroidContext)//ctx!: arg 2: expected native") + return env.NewError("Go(*fyne_driver.AndroidContext)//ctx!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Ctx = newVal return arg0 }, }, @@ -64918,21 +64052,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne_driver.AndroidContext switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne_driver.AndroidContext) - if !ok { + if vc, ok := v.Value.(*fyne_driver.AndroidContext); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne_driver.AndroidContext)//ctx?: arg 1: expected native of type *fyne_driver.AndroidContext") + return env.NewError("Go(*fyne_driver.AndroidContext)//ctx?: arg 1: " + "expected native of type *fyne_driver.AndroidContext, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne_driver.AndroidContext)//ctx?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne_driver.AndroidContext)//ctx?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne_driver.AndroidContext)//ctx?: arg 1: expected native") + return env.NewError("Go(*fyne_driver.AndroidContext)//ctx?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, self.Ctx, "Go(uintptr)") @@ -64946,34 +64080,36 @@ var Builtins = map[string]*env.Builtin{ var self *fyne_driver.AndroidContext switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne_driver.AndroidContext) - if !ok { + if vc, ok := v.Value.(*fyne_driver.AndroidContext); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne_driver.AndroidContext)//env!: arg 1: expected native of type *fyne_driver.AndroidContext") + return env.NewError("Go(*fyne_driver.AndroidContext)//env!: arg 1: " + "expected native of type *fyne_driver.AndroidContext, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne_driver.AndroidContext)//env!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne_driver.AndroidContext)//env!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne_driver.AndroidContext)//env!: arg 1: expected native") + return env.NewError("Go(*fyne_driver.AndroidContext)//env!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal uintptr switch v := arg1.(type) { case env.Native: - var ok bool - self.Env, ok = v.Value.(uintptr) - if !ok { + if vc, ok := v.Value.(uintptr); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne_driver.AndroidContext)//env!: arg 2: expected native of type uintptr") + return env.NewError("Go(*fyne_driver.AndroidContext)//env!: arg 2: " + "expected native of type uintptr, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*fyne_driver.AndroidContext)//env!: arg 2: expected native") + return env.NewError("Go(*fyne_driver.AndroidContext)//env!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Env = newVal return arg0 }, }, @@ -64984,21 +64120,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne_driver.AndroidContext switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne_driver.AndroidContext) - if !ok { + if vc, ok := v.Value.(*fyne_driver.AndroidContext); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne_driver.AndroidContext)//env?: arg 1: expected native of type *fyne_driver.AndroidContext") + return env.NewError("Go(*fyne_driver.AndroidContext)//env?: arg 1: " + "expected native of type *fyne_driver.AndroidContext, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne_driver.AndroidContext)//env?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne_driver.AndroidContext)//env?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne_driver.AndroidContext)//env?: arg 1: expected native") + return env.NewError("Go(*fyne_driver.AndroidContext)//env?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, self.Env, "Go(uintptr)") @@ -65012,34 +64148,36 @@ var Builtins = map[string]*env.Builtin{ var self *fyne_driver.AndroidContext switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne_driver.AndroidContext) - if !ok { + if vc, ok := v.Value.(*fyne_driver.AndroidContext); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne_driver.AndroidContext)//vm!: arg 1: expected native of type *fyne_driver.AndroidContext") + return env.NewError("Go(*fyne_driver.AndroidContext)//vm!: arg 1: " + "expected native of type *fyne_driver.AndroidContext, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne_driver.AndroidContext)//vm!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne_driver.AndroidContext)//vm!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne_driver.AndroidContext)//vm!: arg 1: expected native") + return env.NewError("Go(*fyne_driver.AndroidContext)//vm!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal uintptr switch v := arg1.(type) { case env.Native: - var ok bool - self.VM, ok = v.Value.(uintptr) - if !ok { + if vc, ok := v.Value.(uintptr); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne_driver.AndroidContext)//vm!: arg 2: expected native of type uintptr") + return env.NewError("Go(*fyne_driver.AndroidContext)//vm!: arg 2: " + "expected native of type uintptr, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*fyne_driver.AndroidContext)//vm!: arg 2: expected native") + return env.NewError("Go(*fyne_driver.AndroidContext)//vm!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.VM = newVal return arg0 }, }, @@ -65050,21 +64188,21 @@ var Builtins = map[string]*env.Builtin{ var self *fyne_driver.AndroidContext switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*fyne_driver.AndroidContext) - if !ok { + if vc, ok := v.Value.(*fyne_driver.AndroidContext); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*fyne_driver.AndroidContext)//vm?: arg 1: expected native of type *fyne_driver.AndroidContext") + return env.NewError("Go(*fyne_driver.AndroidContext)//vm?: arg 1: " + "expected native of type *fyne_driver.AndroidContext, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*fyne_driver.AndroidContext)//vm?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*fyne_driver.AndroidContext)//vm?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*fyne_driver.AndroidContext)//vm?: arg 1: expected native") + return env.NewError("Go(*fyne_driver.AndroidContext)//vm?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, self.VM, "Go(uintptr)") @@ -65078,21 +64216,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *layout.Spacer switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*layout.Spacer) - if !ok { + if vc, ok := v.Value.(*layout.Spacer); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//expand-horizontal: arg 1: expected native of type *layout.Spacer") + return env.NewError("Go(*layout.Spacer)//expand-horizontal: arg 1: " + "expected native of type *layout.Spacer, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//expand-horizontal: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*layout.Spacer)//expand-horizontal: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//expand-horizontal: arg 1: expected native") + return env.NewError("Go(*layout.Spacer)//expand-horizontal: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.ExpandHorizontal() var res0Obj env.Object @@ -65107,21 +64245,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *layout.Spacer switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*layout.Spacer) - if !ok { + if vc, ok := v.Value.(*layout.Spacer); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//expand-vertical: arg 1: expected native of type *layout.Spacer") + return env.NewError("Go(*layout.Spacer)//expand-vertical: arg 1: " + "expected native of type *layout.Spacer, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//expand-vertical: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*layout.Spacer)//expand-vertical: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//expand-vertical: arg 1: expected native") + return env.NewError("Go(*layout.Spacer)//expand-vertical: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.ExpandVertical() var res0Obj env.Object @@ -65136,28 +64274,30 @@ var Builtins = map[string]*env.Builtin{ var self *layout.Spacer switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*layout.Spacer) - if !ok { + if vc, ok := v.Value.(*layout.Spacer); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//fix-horizontal!: arg 1: expected native of type *layout.Spacer") + return env.NewError("Go(*layout.Spacer)//fix-horizontal!: arg 1: " + "expected native of type *layout.Spacer, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//fix-horizontal!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*layout.Spacer)//fix-horizontal!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//fix-horizontal!: arg 1: expected native") + return env.NewError("Go(*layout.Spacer)//fix-horizontal!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.FixHorizontal = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//fix-horizontal!: arg 2: expected integer") + return env.NewError("Go(*layout.Spacer)//fix-horizontal!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.FixHorizontal = newVal return arg0 }, }, @@ -65168,21 +64308,21 @@ var Builtins = map[string]*env.Builtin{ var self *layout.Spacer switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*layout.Spacer) - if !ok { + if vc, ok := v.Value.(*layout.Spacer); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//fix-horizontal?: arg 1: expected native of type *layout.Spacer") + return env.NewError("Go(*layout.Spacer)//fix-horizontal?: arg 1: " + "expected native of type *layout.Spacer, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//fix-horizontal?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*layout.Spacer)//fix-horizontal?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//fix-horizontal?: arg 1: expected native") + return env.NewError("Go(*layout.Spacer)//fix-horizontal?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.FixHorizontal)) @@ -65196,28 +64336,30 @@ var Builtins = map[string]*env.Builtin{ var self *layout.Spacer switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*layout.Spacer) - if !ok { + if vc, ok := v.Value.(*layout.Spacer); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//fix-vertical!: arg 1: expected native of type *layout.Spacer") + return env.NewError("Go(*layout.Spacer)//fix-vertical!: arg 1: " + "expected native of type *layout.Spacer, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//fix-vertical!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*layout.Spacer)//fix-vertical!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//fix-vertical!: arg 1: expected native") + return env.NewError("Go(*layout.Spacer)//fix-vertical!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.FixVertical = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//fix-vertical!: arg 2: expected integer") + return env.NewError("Go(*layout.Spacer)//fix-vertical!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.FixVertical = newVal return arg0 }, }, @@ -65228,21 +64370,21 @@ var Builtins = map[string]*env.Builtin{ var self *layout.Spacer switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*layout.Spacer) - if !ok { + if vc, ok := v.Value.(*layout.Spacer); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//fix-vertical?: arg 1: expected native of type *layout.Spacer") + return env.NewError("Go(*layout.Spacer)//fix-vertical?: arg 1: " + "expected native of type *layout.Spacer, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//fix-vertical?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*layout.Spacer)//fix-vertical?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//fix-vertical?: arg 1: expected native") + return env.NewError("Go(*layout.Spacer)//fix-vertical?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.FixVertical)) @@ -65256,21 +64398,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *layout.Spacer switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*layout.Spacer) - if !ok { + if vc, ok := v.Value.(*layout.Spacer); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//hide: arg 1: expected native of type *layout.Spacer") + return env.NewError("Go(*layout.Spacer)//hide: arg 1: " + "expected native of type *layout.Spacer, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*layout.Spacer)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//hide: arg 1: expected native") + return env.NewError("Go(*layout.Spacer)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -65283,21 +64425,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *layout.Spacer switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*layout.Spacer) - if !ok { + if vc, ok := v.Value.(*layout.Spacer); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//min-size: arg 1: expected native of type *layout.Spacer") + return env.NewError("Go(*layout.Spacer)//min-size: arg 1: " + "expected native of type *layout.Spacer, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*layout.Spacer)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//min-size: arg 1: expected native") + return env.NewError("Go(*layout.Spacer)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -65312,42 +64454,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *layout.Spacer switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*layout.Spacer) - if !ok { + if vc, ok := v.Value.(*layout.Spacer); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//move: arg 1: expected native of type *layout.Spacer") + return env.NewError("Go(*layout.Spacer)//move: arg 1: " + "expected native of type *layout.Spacer, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*layout.Spacer)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//move: arg 1: expected native") + return env.NewError("Go(*layout.Spacer)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*layout.Spacer)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//move: arg 2: expected native") + return env.NewError("Go(*layout.Spacer)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -65358,21 +64494,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *layout.Spacer switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*layout.Spacer) - if !ok { + if vc, ok := v.Value.(*layout.Spacer); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//position: arg 1: expected native of type *layout.Spacer") + return env.NewError("Go(*layout.Spacer)//position: arg 1: " + "expected native of type *layout.Spacer, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*layout.Spacer)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//position: arg 1: expected native") + return env.NewError("Go(*layout.Spacer)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -65387,21 +64523,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *layout.Spacer switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*layout.Spacer) - if !ok { + if vc, ok := v.Value.(*layout.Spacer); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//refresh: arg 1: expected native of type *layout.Spacer") + return env.NewError("Go(*layout.Spacer)//refresh: arg 1: " + "expected native of type *layout.Spacer, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*layout.Spacer)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//refresh: arg 1: expected native") + return env.NewError("Go(*layout.Spacer)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -65414,42 +64550,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *layout.Spacer switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*layout.Spacer) - if !ok { + if vc, ok := v.Value.(*layout.Spacer); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//resize: arg 1: expected native of type *layout.Spacer") + return env.NewError("Go(*layout.Spacer)//resize: arg 1: " + "expected native of type *layout.Spacer, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*layout.Spacer)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//resize: arg 1: expected native") + return env.NewError("Go(*layout.Spacer)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*layout.Spacer)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//resize: arg 2: expected native") + return env.NewError("Go(*layout.Spacer)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -65460,21 +64590,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *layout.Spacer switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*layout.Spacer) - if !ok { + if vc, ok := v.Value.(*layout.Spacer); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//show: arg 1: expected native of type *layout.Spacer") + return env.NewError("Go(*layout.Spacer)//show: arg 1: " + "expected native of type *layout.Spacer, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*layout.Spacer)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//show: arg 1: expected native") + return env.NewError("Go(*layout.Spacer)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -65487,21 +64617,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *layout.Spacer switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*layout.Spacer) - if !ok { + if vc, ok := v.Value.(*layout.Spacer); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//size: arg 1: expected native of type *layout.Spacer") + return env.NewError("Go(*layout.Spacer)//size: arg 1: " + "expected native of type *layout.Spacer, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*layout.Spacer)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//size: arg 1: expected native") + return env.NewError("Go(*layout.Spacer)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -65516,21 +64646,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *layout.Spacer switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*layout.Spacer) - if !ok { + if vc, ok := v.Value.(*layout.Spacer); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//visible: arg 1: expected native of type *layout.Spacer") + return env.NewError("Go(*layout.Spacer)//visible: arg 1: " + "expected native of type *layout.Spacer, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*layout.Spacer)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*layout.Spacer)//visible: arg 1: expected native") + return env.NewError("Go(*layout.Spacer)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -65545,34 +64675,42 @@ var Builtins = map[string]*env.Builtin{ var self *mobile.TouchEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*mobile.TouchEvent) - if !ok { + if vc, ok := v.Value.(*mobile.TouchEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*mobile.TouchEvent)//absolute-position!: arg 1: expected native of type *mobile.TouchEvent") + return env.NewError("Go(*mobile.TouchEvent)//absolute-position!: arg 1: " + "expected native of type *mobile.TouchEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*mobile.TouchEvent)//absolute-position!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*mobile.TouchEvent)//absolute-position!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*mobile.TouchEvent)//absolute-position!: arg 1: expected native") + return env.NewError("Go(*mobile.TouchEvent)//absolute-position!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal *fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - self.AbsolutePosition, ok = v.Value.(fyne.Position) - if !ok { + if vc, ok := v.Value.(*fyne.Position); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*mobile.TouchEvent)//absolute-position!: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*mobile.TouchEvent)//absolute-position!: arg 2: expected native of type fyne.Position") + return env.NewError("Go(*mobile.TouchEvent)//absolute-position!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*mobile.TouchEvent)//absolute-position!: arg 2: expected native") + return env.NewError("Go(*mobile.TouchEvent)//absolute-position!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.AbsolutePosition = *newVal return arg0 }, }, @@ -65583,27 +64721,101 @@ var Builtins = map[string]*env.Builtin{ var self *mobile.TouchEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*mobile.TouchEvent) - if !ok { + if vc, ok := v.Value.(*mobile.TouchEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*mobile.TouchEvent)//absolute-position?: arg 1: expected native of type *mobile.TouchEvent") + return env.NewError("Go(*mobile.TouchEvent)//absolute-position?: arg 1: " + "expected native of type *mobile.TouchEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*mobile.TouchEvent)//absolute-position?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*mobile.TouchEvent)//absolute-position?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*mobile.TouchEvent)//absolute-position?: arg 1: expected native") + return env.NewError("Go(*mobile.TouchEvent)//absolute-position?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, &self.AbsolutePosition, "Go(*fyne.Position)") return resObj }, }, + "Go(*mobile.TouchEvent)//point-event!": { + Doc: "Set *mobile.TouchEvent PointEvent value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *mobile.TouchEvent + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*mobile.TouchEvent); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*mobile.TouchEvent)//point-event!: arg 1: " + "expected native of type *mobile.TouchEvent, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*mobile.TouchEvent)//point-event!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*mobile.TouchEvent)//point-event!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *fyne.PointEvent + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.PointEvent); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*mobile.TouchEvent)//point-event!: arg 2: " + "expected native of type *fyne.PointEvent, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*mobile.TouchEvent)//point-event!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*mobile.TouchEvent)//point-event!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.PointEvent = *newVal + return arg0 + }, + }, + "Go(*mobile.TouchEvent)//point-event?": { + Doc: "Get *mobile.TouchEvent PointEvent value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *mobile.TouchEvent + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*mobile.TouchEvent); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*mobile.TouchEvent)//point-event?: arg 1: " + "expected native of type *mobile.TouchEvent, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*mobile.TouchEvent)//point-event?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*mobile.TouchEvent)//point-event?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.PointEvent, "Go(*fyne.PointEvent)") + return resObj + }, + }, "Go(*mobile.TouchEvent)//position!": { Doc: "Set *mobile.TouchEvent Position value", Argsn: 2, @@ -65611,34 +64823,42 @@ var Builtins = map[string]*env.Builtin{ var self *mobile.TouchEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*mobile.TouchEvent) - if !ok { + if vc, ok := v.Value.(*mobile.TouchEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*mobile.TouchEvent)//position!: arg 1: expected native of type *mobile.TouchEvent") + return env.NewError("Go(*mobile.TouchEvent)//position!: arg 1: " + "expected native of type *mobile.TouchEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*mobile.TouchEvent)//position!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*mobile.TouchEvent)//position!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*mobile.TouchEvent)//position!: arg 1: expected native") + return env.NewError("Go(*mobile.TouchEvent)//position!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal *fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - self.Position, ok = v.Value.(fyne.Position) - if !ok { + if vc, ok := v.Value.(*fyne.Position); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*mobile.TouchEvent)//position!: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*mobile.TouchEvent)//position!: arg 2: expected native of type fyne.Position") + return env.NewError("Go(*mobile.TouchEvent)//position!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*mobile.TouchEvent)//position!: arg 2: expected native") + return env.NewError("Go(*mobile.TouchEvent)//position!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Position = *newVal return arg0 }, }, @@ -65649,21 +64869,21 @@ var Builtins = map[string]*env.Builtin{ var self *mobile.TouchEvent switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*mobile.TouchEvent) - if !ok { + if vc, ok := v.Value.(*mobile.TouchEvent); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*mobile.TouchEvent)//position?: arg 1: expected native of type *mobile.TouchEvent") + return env.NewError("Go(*mobile.TouchEvent)//position?: arg 1: " + "expected native of type *mobile.TouchEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*mobile.TouchEvent)//position?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*mobile.TouchEvent)//position?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*mobile.TouchEvent)//position?: arg 1: expected native") + return env.NewError("Go(*mobile.TouchEvent)//position?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, &self.Position, "Go(*fyne.Position)") @@ -65677,50 +64897,45 @@ var Builtins = map[string]*env.Builtin{ var self *storage.ExtensionFileFilter switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*storage.ExtensionFileFilter) - if !ok { + if vc, ok := v.Value.(*storage.ExtensionFileFilter); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*storage.ExtensionFileFilter)//extensions!: arg 1: expected native of type *storage.ExtensionFileFilter") + return env.NewError("Go(*storage.ExtensionFileFilter)//extensions!: arg 1: " + "expected native of type *storage.ExtensionFileFilter, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*storage.ExtensionFileFilter)//extensions!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*storage.ExtensionFileFilter)//extensions!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*storage.ExtensionFileFilter)//extensions!: arg 1: expected native") + return env.NewError("Go(*storage.ExtensionFileFilter)//extensions!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal []string switch v := arg1.(type) { case env.Block: - self.Extensions = make([]string, len(v.Series.S)) + newVal = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - self.Extensions[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + newVal[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*storage.ExtensionFileFilter)//extensions!: arg 2: block item: expected string") + return env.NewError("Go(*storage.ExtensionFileFilter)//extensions!: arg 2: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - self.Extensions, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*storage.ExtensionFileFilter)//extensions!: arg 2: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*storage.ExtensionFileFilter)//extensions!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*storage.ExtensionFileFilter)//extensions!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Extensions = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*storage.ExtensionFileFilter)//extensions!: arg 2: expected block, native or nil") + return env.NewError("Go(*storage.ExtensionFileFilter)//extensions!: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } + self.Extensions = newVal return arg0 }, }, @@ -65731,21 +64946,21 @@ var Builtins = map[string]*env.Builtin{ var self *storage.ExtensionFileFilter switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*storage.ExtensionFileFilter) - if !ok { + if vc, ok := v.Value.(*storage.ExtensionFileFilter); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*storage.ExtensionFileFilter)//extensions?: arg 1: expected native of type *storage.ExtensionFileFilter") + return env.NewError("Go(*storage.ExtensionFileFilter)//extensions?: arg 1: " + "expected native of type *storage.ExtensionFileFilter, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*storage.ExtensionFileFilter)//extensions?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*storage.ExtensionFileFilter)//extensions?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*storage.ExtensionFileFilter)//extensions?: arg 1: expected native") + return env.NewError("Go(*storage.ExtensionFileFilter)//extensions?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object { @@ -65765,21 +64980,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *storage.ExtensionFileFilter switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*storage.ExtensionFileFilter) - if !ok { + if vc, ok := v.Value.(*storage.ExtensionFileFilter); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*storage.ExtensionFileFilter)//matches: arg 1: expected native of type *storage.ExtensionFileFilter") + return env.NewError("Go(*storage.ExtensionFileFilter)//matches: arg 1: " + "expected native of type *storage.ExtensionFileFilter, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*storage.ExtensionFileFilter)//matches: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*storage.ExtensionFileFilter)//matches: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*storage.ExtensionFileFilter)//matches: arg 1: expected native") + return env.NewError("Go(*storage.ExtensionFileFilter)//matches: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -65788,24 +65003,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*storage.ExtensionFileFilter)//matches: arg 2: " + err.Error() + "") + return env.NewError("Go(*storage.ExtensionFileFilter)//matches: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*storage.ExtensionFileFilter)//matches: arg 2: expected native of type fyne.URI") + return env.NewError("Go(*storage.ExtensionFileFilter)//matches: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*storage.ExtensionFileFilter)//matches: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*storage.ExtensionFileFilter)//matches: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*storage.ExtensionFileFilter)//matches: arg 2: expected native") + return env.NewError("Go(*storage.ExtensionFileFilter)//matches: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Matches(arg1Val) var res0Obj env.Object @@ -65820,21 +65035,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *storage.MimeTypeFileFilter switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*storage.MimeTypeFileFilter) - if !ok { + if vc, ok := v.Value.(*storage.MimeTypeFileFilter); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*storage.MimeTypeFileFilter)//matches: arg 1: expected native of type *storage.MimeTypeFileFilter") + return env.NewError("Go(*storage.MimeTypeFileFilter)//matches: arg 1: " + "expected native of type *storage.MimeTypeFileFilter, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*storage.MimeTypeFileFilter)//matches: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*storage.MimeTypeFileFilter)//matches: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*storage.MimeTypeFileFilter)//matches: arg 1: expected native") + return env.NewError("Go(*storage.MimeTypeFileFilter)//matches: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -65843,24 +65058,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*storage.MimeTypeFileFilter)//matches: arg 2: " + err.Error() + "") + return env.NewError("Go(*storage.MimeTypeFileFilter)//matches: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*storage.MimeTypeFileFilter)//matches: arg 2: expected native of type fyne.URI") + return env.NewError("Go(*storage.MimeTypeFileFilter)//matches: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*storage.MimeTypeFileFilter)//matches: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*storage.MimeTypeFileFilter)//matches: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*storage.MimeTypeFileFilter)//matches: arg 2: expected native") + return env.NewError("Go(*storage.MimeTypeFileFilter)//matches: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Matches(arg1Val) var res0Obj env.Object @@ -65875,50 +65090,45 @@ var Builtins = map[string]*env.Builtin{ var self *storage.MimeTypeFileFilter switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*storage.MimeTypeFileFilter) - if !ok { + if vc, ok := v.Value.(*storage.MimeTypeFileFilter); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*storage.MimeTypeFileFilter)//mime-types!: arg 1: expected native of type *storage.MimeTypeFileFilter") + return env.NewError("Go(*storage.MimeTypeFileFilter)//mime-types!: arg 1: " + "expected native of type *storage.MimeTypeFileFilter, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*storage.MimeTypeFileFilter)//mime-types!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*storage.MimeTypeFileFilter)//mime-types!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*storage.MimeTypeFileFilter)//mime-types!: arg 1: expected native") + return env.NewError("Go(*storage.MimeTypeFileFilter)//mime-types!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal []string switch v := arg1.(type) { case env.Block: - self.MimeTypes = make([]string, len(v.Series.S)) + newVal = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - self.MimeTypes[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + newVal[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*storage.MimeTypeFileFilter)//mime-types!: arg 2: block item: expected string") + return env.NewError("Go(*storage.MimeTypeFileFilter)//mime-types!: arg 2: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - self.MimeTypes, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*storage.MimeTypeFileFilter)//mime-types!: arg 2: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*storage.MimeTypeFileFilter)//mime-types!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*storage.MimeTypeFileFilter)//mime-types!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.MimeTypes = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*storage.MimeTypeFileFilter)//mime-types!: arg 2: expected block, native or nil") + return env.NewError("Go(*storage.MimeTypeFileFilter)//mime-types!: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } + self.MimeTypes = newVal return arg0 }, }, @@ -65929,21 +65139,21 @@ var Builtins = map[string]*env.Builtin{ var self *storage.MimeTypeFileFilter switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*storage.MimeTypeFileFilter) - if !ok { + if vc, ok := v.Value.(*storage.MimeTypeFileFilter); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*storage.MimeTypeFileFilter)//mime-types?: arg 1: expected native of type *storage.MimeTypeFileFilter") + return env.NewError("Go(*storage.MimeTypeFileFilter)//mime-types?: arg 1: " + "expected native of type *storage.MimeTypeFileFilter, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*storage.MimeTypeFileFilter)//mime-types?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*storage.MimeTypeFileFilter)//mime-types?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*storage.MimeTypeFileFilter)//mime-types?: arg 1: expected native") + return env.NewError("Go(*storage.MimeTypeFileFilter)//mime-types?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object { @@ -65963,21 +65173,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *theme.DisabledResource switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*theme.DisabledResource) - if !ok { + if vc, ok := v.Value.(*theme.DisabledResource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*theme.DisabledResource)//content: arg 1: expected native of type *theme.DisabledResource") + return env.NewError("Go(*theme.DisabledResource)//content: arg 1: " + "expected native of type *theme.DisabledResource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*theme.DisabledResource)//content: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*theme.DisabledResource)//content: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*theme.DisabledResource)//content: arg 1: expected native") + return env.NewError("Go(*theme.DisabledResource)//content: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Content() var res0Obj env.Object @@ -65998,21 +65208,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *theme.DisabledResource switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*theme.DisabledResource) - if !ok { + if vc, ok := v.Value.(*theme.DisabledResource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*theme.DisabledResource)//name: arg 1: expected native of type *theme.DisabledResource") + return env.NewError("Go(*theme.DisabledResource)//name: arg 1: " + "expected native of type *theme.DisabledResource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*theme.DisabledResource)//name: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*theme.DisabledResource)//name: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*theme.DisabledResource)//name: arg 1: expected native") + return env.NewError("Go(*theme.DisabledResource)//name: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Name() var res0Obj env.Object @@ -66027,21 +65237,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *theme.ErrorThemedResource switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*theme.ErrorThemedResource) - if !ok { + if vc, ok := v.Value.(*theme.ErrorThemedResource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*theme.ErrorThemedResource)//content: arg 1: expected native of type *theme.ErrorThemedResource") + return env.NewError("Go(*theme.ErrorThemedResource)//content: arg 1: " + "expected native of type *theme.ErrorThemedResource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*theme.ErrorThemedResource)//content: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*theme.ErrorThemedResource)//content: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*theme.ErrorThemedResource)//content: arg 1: expected native") + return env.NewError("Go(*theme.ErrorThemedResource)//content: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Content() var res0Obj env.Object @@ -66062,21 +65272,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *theme.ErrorThemedResource switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*theme.ErrorThemedResource) - if !ok { + if vc, ok := v.Value.(*theme.ErrorThemedResource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*theme.ErrorThemedResource)//name: arg 1: expected native of type *theme.ErrorThemedResource") + return env.NewError("Go(*theme.ErrorThemedResource)//name: arg 1: " + "expected native of type *theme.ErrorThemedResource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*theme.ErrorThemedResource)//name: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*theme.ErrorThemedResource)//name: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*theme.ErrorThemedResource)//name: arg 1: expected native") + return env.NewError("Go(*theme.ErrorThemedResource)//name: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Name() var res0Obj env.Object @@ -66091,42 +65301,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *theme.ErrorThemedResource switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*theme.ErrorThemedResource) - if !ok { + if vc, ok := v.Value.(*theme.ErrorThemedResource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*theme.ErrorThemedResource)//original: arg 1: expected native of type *theme.ErrorThemedResource") + return env.NewError("Go(*theme.ErrorThemedResource)//original: arg 1: " + "expected native of type *theme.ErrorThemedResource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*theme.ErrorThemedResource)//original: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*theme.ErrorThemedResource)//original: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*theme.ErrorThemedResource)//original: arg 1: expected native") + return env.NewError("Go(*theme.ErrorThemedResource)//original: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Original() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -66137,21 +65330,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *theme.InvertedThemedResource switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*theme.InvertedThemedResource) - if !ok { + if vc, ok := v.Value.(*theme.InvertedThemedResource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*theme.InvertedThemedResource)//content: arg 1: expected native of type *theme.InvertedThemedResource") + return env.NewError("Go(*theme.InvertedThemedResource)//content: arg 1: " + "expected native of type *theme.InvertedThemedResource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*theme.InvertedThemedResource)//content: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*theme.InvertedThemedResource)//content: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*theme.InvertedThemedResource)//content: arg 1: expected native") + return env.NewError("Go(*theme.InvertedThemedResource)//content: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Content() var res0Obj env.Object @@ -66172,21 +65365,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *theme.InvertedThemedResource switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*theme.InvertedThemedResource) - if !ok { + if vc, ok := v.Value.(*theme.InvertedThemedResource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*theme.InvertedThemedResource)//name: arg 1: expected native of type *theme.InvertedThemedResource") + return env.NewError("Go(*theme.InvertedThemedResource)//name: arg 1: " + "expected native of type *theme.InvertedThemedResource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*theme.InvertedThemedResource)//name: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*theme.InvertedThemedResource)//name: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*theme.InvertedThemedResource)//name: arg 1: expected native") + return env.NewError("Go(*theme.InvertedThemedResource)//name: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Name() var res0Obj env.Object @@ -66201,42 +65394,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *theme.InvertedThemedResource switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*theme.InvertedThemedResource) - if !ok { + if vc, ok := v.Value.(*theme.InvertedThemedResource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*theme.InvertedThemedResource)//original: arg 1: expected native of type *theme.InvertedThemedResource") + return env.NewError("Go(*theme.InvertedThemedResource)//original: arg 1: " + "expected native of type *theme.InvertedThemedResource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*theme.InvertedThemedResource)//original: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*theme.InvertedThemedResource)//original: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*theme.InvertedThemedResource)//original: arg 1: expected native") + return env.NewError("Go(*theme.InvertedThemedResource)//original: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Original() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -66247,21 +65423,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *theme.PrimaryThemedResource switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*theme.PrimaryThemedResource) - if !ok { + if vc, ok := v.Value.(*theme.PrimaryThemedResource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*theme.PrimaryThemedResource)//content: arg 1: expected native of type *theme.PrimaryThemedResource") + return env.NewError("Go(*theme.PrimaryThemedResource)//content: arg 1: " + "expected native of type *theme.PrimaryThemedResource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*theme.PrimaryThemedResource)//content: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*theme.PrimaryThemedResource)//content: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*theme.PrimaryThemedResource)//content: arg 1: expected native") + return env.NewError("Go(*theme.PrimaryThemedResource)//content: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Content() var res0Obj env.Object @@ -66282,21 +65458,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *theme.PrimaryThemedResource switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*theme.PrimaryThemedResource) - if !ok { + if vc, ok := v.Value.(*theme.PrimaryThemedResource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*theme.PrimaryThemedResource)//name: arg 1: expected native of type *theme.PrimaryThemedResource") + return env.NewError("Go(*theme.PrimaryThemedResource)//name: arg 1: " + "expected native of type *theme.PrimaryThemedResource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*theme.PrimaryThemedResource)//name: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*theme.PrimaryThemedResource)//name: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*theme.PrimaryThemedResource)//name: arg 1: expected native") + return env.NewError("Go(*theme.PrimaryThemedResource)//name: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Name() var res0Obj env.Object @@ -66311,42 +65487,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *theme.PrimaryThemedResource switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*theme.PrimaryThemedResource) - if !ok { + if vc, ok := v.Value.(*theme.PrimaryThemedResource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*theme.PrimaryThemedResource)//original: arg 1: expected native of type *theme.PrimaryThemedResource") + return env.NewError("Go(*theme.PrimaryThemedResource)//original: arg 1: " + "expected native of type *theme.PrimaryThemedResource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*theme.PrimaryThemedResource)//original: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*theme.PrimaryThemedResource)//original: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*theme.PrimaryThemedResource)//original: arg 1: expected native") + return env.NewError("Go(*theme.PrimaryThemedResource)//original: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Original() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -66357,22 +65516,23 @@ var Builtins = map[string]*env.Builtin{ var self *theme.ThemedResource switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*theme.ThemedResource) - if !ok { + if vc, ok := v.Value.(*theme.ThemedResource); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*theme.ThemedResource)//color-name!: arg 1: expected native of type *theme.ThemedResource") + return env.NewError("Go(*theme.ThemedResource)//color-name!: arg 1: " + "expected native of type *theme.ThemedResource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*theme.ThemedResource)//color-name!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*theme.ThemedResource)//color-name!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*theme.ThemedResource)//color-name!: arg 1: expected native") + return env.NewError("Go(*theme.ThemedResource)//color-name!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.ThemeColorName { nat, natOk := arg1.(env.Native) var natValOk bool @@ -66381,18 +65541,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(fyne.ThemeColorName) } if natValOk { - self.ColorName = natVal + newVal = natVal } else { var u string - if v, ok := arg1.(env.String); ok { - u = string(v.Value) + if vc, ok := arg1.(env.String); ok { + u = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*theme.ThemedResource)//color-name!: arg 2: expected string") + return env.NewError("Go(*theme.ThemedResource)//color-name!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } - self.ColorName = fyne.ThemeColorName(u) + newVal = fyne.ThemeColorName(u) } } + self.ColorName = newVal return arg0 }, }, @@ -66403,21 +65564,21 @@ var Builtins = map[string]*env.Builtin{ var self *theme.ThemedResource switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*theme.ThemedResource) - if !ok { + if vc, ok := v.Value.(*theme.ThemedResource); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*theme.ThemedResource)//color-name?: arg 1: expected native of type *theme.ThemedResource") + return env.NewError("Go(*theme.ThemedResource)//color-name?: arg 1: " + "expected native of type *theme.ThemedResource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*theme.ThemedResource)//color-name?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*theme.ThemedResource)//color-name?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*theme.ThemedResource)//color-name?: arg 1: expected native") + return env.NewError("Go(*theme.ThemedResource)//color-name?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(string(self.ColorName)) @@ -66431,21 +65592,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *theme.ThemedResource switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*theme.ThemedResource) - if !ok { + if vc, ok := v.Value.(*theme.ThemedResource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*theme.ThemedResource)//content: arg 1: expected native of type *theme.ThemedResource") + return env.NewError("Go(*theme.ThemedResource)//content: arg 1: " + "expected native of type *theme.ThemedResource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*theme.ThemedResource)//content: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*theme.ThemedResource)//content: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*theme.ThemedResource)//content: arg 1: expected native") + return env.NewError("Go(*theme.ThemedResource)//content: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Content() var res0Obj env.Object @@ -66466,21 +65627,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *theme.ThemedResource switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*theme.ThemedResource) - if !ok { + if vc, ok := v.Value.(*theme.ThemedResource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*theme.ThemedResource)//error: arg 1: expected native of type *theme.ThemedResource") + return env.NewError("Go(*theme.ThemedResource)//error: arg 1: " + "expected native of type *theme.ThemedResource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*theme.ThemedResource)//error: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*theme.ThemedResource)//error: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*theme.ThemedResource)//error: arg 1: expected native") + return env.NewError("Go(*theme.ThemedResource)//error: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Error() var res0Obj env.Object @@ -66495,21 +65656,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *theme.ThemedResource switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*theme.ThemedResource) - if !ok { + if vc, ok := v.Value.(*theme.ThemedResource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*theme.ThemedResource)//name: arg 1: expected native of type *theme.ThemedResource") + return env.NewError("Go(*theme.ThemedResource)//name: arg 1: " + "expected native of type *theme.ThemedResource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*theme.ThemedResource)//name: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*theme.ThemedResource)//name: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*theme.ThemedResource)//name: arg 1: expected native") + return env.NewError("Go(*theme.ThemedResource)//name: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Name() var res0Obj env.Object @@ -66524,45 +65685,119 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Accordion switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Accordion) - if !ok { + if vc, ok := v.Value.(*widget.Accordion); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//append: arg 1: expected native of type *widget.Accordion") + return env.NewError("Go(*widget.Accordion)//append: arg 1: " + "expected native of type *widget.Accordion, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//append: arg 1: expected native") + return env.NewError("Go(*widget.Accordion)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *widget.AccordionItem switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*widget.AccordionItem) - if !ok { + if vc, ok := v.Value.(*widget.AccordionItem); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//append: arg 2: expected native of type *widget.AccordionItem") + return env.NewError("Go(*widget.Accordion)//append: arg 2: " + "expected native of type *widget.AccordionItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//append: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//append: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//append: arg 2: expected native") + return env.NewError("Go(*widget.Accordion)//append: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Append(arg1Val) return arg0 }, }, + "Go(*widget.Accordion)//base-widget!": { + Doc: "Set *widget.Accordion BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Accordion + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Accordion); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Accordion)//base-widget!: arg 1: " + "expected native of type *widget.Accordion, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Accordion)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Accordion)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Accordion)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Accordion)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Accordion)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*widget.Accordion)//base-widget?": { + Doc: "Get *widget.Accordion BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Accordion + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Accordion); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Accordion)//base-widget?: arg 1: " + "expected native of type *widget.Accordion, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Accordion)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Accordion)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj + }, + }, "Go(*widget.Accordion)//close": { Doc: "(*widget.Accordion).Close", Argsn: 2, @@ -66570,28 +65805,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Accordion switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Accordion) - if !ok { + if vc, ok := v.Value.(*widget.Accordion); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//close: arg 1: expected native of type *widget.Accordion") + return env.NewError("Go(*widget.Accordion)//close: arg 1: " + "expected native of type *widget.Accordion, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//close: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//close: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//close: arg 1: expected native") + return env.NewError("Go(*widget.Accordion)//close: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//close: arg 2: expected integer") + return env.NewError("Go(*widget.Accordion)//close: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.Close(arg1Val) return arg0 @@ -66604,21 +65839,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Accordion switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Accordion) - if !ok { + if vc, ok := v.Value.(*widget.Accordion); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//close-all: arg 1: expected native of type *widget.Accordion") + return env.NewError("Go(*widget.Accordion)//close-all: arg 1: " + "expected native of type *widget.Accordion, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//close-all: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//close-all: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//close-all: arg 1: expected native") + return env.NewError("Go(*widget.Accordion)//close-all: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.CloseAll() return arg0 @@ -66631,42 +65866,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Accordion switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Accordion) - if !ok { + if vc, ok := v.Value.(*widget.Accordion); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//create-renderer: arg 1: expected native of type *widget.Accordion") + return env.NewError("Go(*widget.Accordion)//create-renderer: arg 1: " + "expected native of type *widget.Accordion, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//create-renderer: arg 1: expected native") + return env.NewError("Go(*widget.Accordion)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -66677,21 +65895,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Accordion switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Accordion) - if !ok { + if vc, ok := v.Value.(*widget.Accordion); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//extend-base-widget: arg 1: expected native of type *widget.Accordion") + return env.NewError("Go(*widget.Accordion)//extend-base-widget: arg 1: " + "expected native of type *widget.Accordion, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.Accordion)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -66700,24 +65918,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Accordion)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.Accordion)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.Accordion)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -66730,28 +65948,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Accordion switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Accordion) - if !ok { + if vc, ok := v.Value.(*widget.Accordion); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//hidden!: arg 1: expected native of type *widget.Accordion") + return env.NewError("Go(*widget.Accordion)//hidden!: arg 1: " + "expected native of type *widget.Accordion, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.Accordion)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.Accordion)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -66762,21 +65982,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Accordion switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Accordion) - if !ok { + if vc, ok := v.Value.(*widget.Accordion); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//hidden?: arg 1: expected native of type *widget.Accordion") + return env.NewError("Go(*widget.Accordion)//hidden?: arg 1: " + "expected native of type *widget.Accordion, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.Accordion)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -66790,21 +66010,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Accordion switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Accordion) - if !ok { + if vc, ok := v.Value.(*widget.Accordion); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//hide: arg 1: expected native of type *widget.Accordion") + return env.NewError("Go(*widget.Accordion)//hide: arg 1: " + "expected native of type *widget.Accordion, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//hide: arg 1: expected native") + return env.NewError("Go(*widget.Accordion)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -66817,62 +66037,57 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Accordion switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Accordion) - if !ok { + if vc, ok := v.Value.(*widget.Accordion); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//items!: arg 1: expected native of type *widget.Accordion") + return env.NewError("Go(*widget.Accordion)//items!: arg 1: " + "expected native of type *widget.Accordion, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//items!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//items!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//items!: arg 1: expected native") + return env.NewError("Go(*widget.Accordion)//items!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal []*widget.AccordionItem switch v := arg1.(type) { case env.Block: - self.Items = make([]*widget.AccordionItem, len(v.Series.S)) + newVal = make([]*widget.AccordionItem, len(v.Series.S)) for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - self.Items[i], ok = v.Value.(*widget.AccordionItem) - if !ok { + if vc, ok := v.Value.(*widget.AccordionItem); ok { + newVal[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//items!: arg 2: block item: expected native of type *widget.AccordionItem") + return env.NewError("Go(*widget.Accordion)//items!: arg 2: " + "block item: " + "expected native of type *widget.AccordionItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//items!: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//items!: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Items[i] = nil + newVal[i] = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//items!: arg 2: block item: expected native") + return env.NewError("Go(*widget.Accordion)//items!: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - self.Items, ok = v.Value.([]*widget.AccordionItem) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//items!: arg 2: expected native of type []*widget.AccordionItem") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//items!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//items!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Items = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//items!: arg 2: expected block, native or nil") + return env.NewError("Go(*widget.Accordion)//items!: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } + self.Items = newVal return arg0 }, }, @@ -66883,21 +66098,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Accordion switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Accordion) - if !ok { + if vc, ok := v.Value.(*widget.Accordion); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//items?: arg 1: expected native of type *widget.Accordion") + return env.NewError("Go(*widget.Accordion)//items?: arg 1: " + "expected native of type *widget.Accordion, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//items?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//items?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//items?: arg 1: expected native") + return env.NewError("Go(*widget.Accordion)//items?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object { @@ -66917,21 +66132,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Accordion switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Accordion) - if !ok { + if vc, ok := v.Value.(*widget.Accordion); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//min-size: arg 1: expected native of type *widget.Accordion") + return env.NewError("Go(*widget.Accordion)//min-size: arg 1: " + "expected native of type *widget.Accordion, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.Accordion)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -66946,42 +66161,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Accordion switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Accordion) - if !ok { + if vc, ok := v.Value.(*widget.Accordion); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//move: arg 1: expected native of type *widget.Accordion") + return env.NewError("Go(*widget.Accordion)//move: arg 1: " + "expected native of type *widget.Accordion, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//move: arg 1: expected native") + return env.NewError("Go(*widget.Accordion)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//move: arg 2: expected native") + return env.NewError("Go(*widget.Accordion)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -66992,28 +66201,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Accordion switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Accordion) - if !ok { + if vc, ok := v.Value.(*widget.Accordion); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//multi-open!: arg 1: expected native of type *widget.Accordion") + return env.NewError("Go(*widget.Accordion)//multi-open!: arg 1: " + "expected native of type *widget.Accordion, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//multi-open!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//multi-open!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//multi-open!: arg 1: expected native") + return env.NewError("Go(*widget.Accordion)//multi-open!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.MultiOpen = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//multi-open!: arg 2: expected integer") + return env.NewError("Go(*widget.Accordion)//multi-open!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.MultiOpen = newVal return arg0 }, }, @@ -67024,21 +66235,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Accordion switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Accordion) - if !ok { + if vc, ok := v.Value.(*widget.Accordion); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//multi-open?: arg 1: expected native of type *widget.Accordion") + return env.NewError("Go(*widget.Accordion)//multi-open?: arg 1: " + "expected native of type *widget.Accordion, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//multi-open?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//multi-open?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//multi-open?: arg 1: expected native") + return env.NewError("Go(*widget.Accordion)//multi-open?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.MultiOpen)) @@ -67052,28 +66263,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Accordion switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Accordion) - if !ok { + if vc, ok := v.Value.(*widget.Accordion); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//open: arg 1: expected native of type *widget.Accordion") + return env.NewError("Go(*widget.Accordion)//open: arg 1: " + "expected native of type *widget.Accordion, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//open: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//open: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//open: arg 1: expected native") + return env.NewError("Go(*widget.Accordion)//open: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//open: arg 2: expected integer") + return env.NewError("Go(*widget.Accordion)//open: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.Open(arg1Val) return arg0 @@ -67086,21 +66297,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Accordion switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Accordion) - if !ok { + if vc, ok := v.Value.(*widget.Accordion); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//open-all: arg 1: expected native of type *widget.Accordion") + return env.NewError("Go(*widget.Accordion)//open-all: arg 1: " + "expected native of type *widget.Accordion, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//open-all: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//open-all: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//open-all: arg 1: expected native") + return env.NewError("Go(*widget.Accordion)//open-all: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.OpenAll() return arg0 @@ -67113,21 +66324,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Accordion switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Accordion) - if !ok { + if vc, ok := v.Value.(*widget.Accordion); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//position: arg 1: expected native of type *widget.Accordion") + return env.NewError("Go(*widget.Accordion)//position: arg 1: " + "expected native of type *widget.Accordion, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//position: arg 1: expected native") + return env.NewError("Go(*widget.Accordion)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -67142,21 +66353,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Accordion switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Accordion) - if !ok { + if vc, ok := v.Value.(*widget.Accordion); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//refresh: arg 1: expected native of type *widget.Accordion") + return env.NewError("Go(*widget.Accordion)//refresh: arg 1: " + "expected native of type *widget.Accordion, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.Accordion)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -67169,40 +66380,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Accordion switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Accordion) - if !ok { + if vc, ok := v.Value.(*widget.Accordion); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//remove: arg 1: expected native of type *widget.Accordion") + return env.NewError("Go(*widget.Accordion)//remove: arg 1: " + "expected native of type *widget.Accordion, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//remove: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//remove: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//remove: arg 1: expected native") + return env.NewError("Go(*widget.Accordion)//remove: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *widget.AccordionItem switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*widget.AccordionItem) - if !ok { + if vc, ok := v.Value.(*widget.AccordionItem); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//remove: arg 2: expected native of type *widget.AccordionItem") + return env.NewError("Go(*widget.Accordion)//remove: arg 2: " + "expected native of type *widget.AccordionItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//remove: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//remove: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//remove: arg 2: expected native") + return env.NewError("Go(*widget.Accordion)//remove: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Remove(arg1Val) return arg0 @@ -67215,28 +66426,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Accordion switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Accordion) - if !ok { + if vc, ok := v.Value.(*widget.Accordion); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//remove-index: arg 1: expected native of type *widget.Accordion") + return env.NewError("Go(*widget.Accordion)//remove-index: arg 1: " + "expected native of type *widget.Accordion, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//remove-index: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//remove-index: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//remove-index: arg 1: expected native") + return env.NewError("Go(*widget.Accordion)//remove-index: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//remove-index: arg 2: expected integer") + return env.NewError("Go(*widget.Accordion)//remove-index: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.RemoveIndex(arg1Val) return arg0 @@ -67249,42 +66460,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Accordion switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Accordion) - if !ok { + if vc, ok := v.Value.(*widget.Accordion); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//resize: arg 1: expected native of type *widget.Accordion") + return env.NewError("Go(*widget.Accordion)//resize: arg 1: " + "expected native of type *widget.Accordion, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//resize: arg 1: expected native") + return env.NewError("Go(*widget.Accordion)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//resize: arg 2: expected native") + return env.NewError("Go(*widget.Accordion)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -67295,21 +66500,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Accordion switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Accordion) - if !ok { + if vc, ok := v.Value.(*widget.Accordion); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//show: arg 1: expected native of type *widget.Accordion") + return env.NewError("Go(*widget.Accordion)//show: arg 1: " + "expected native of type *widget.Accordion, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//show: arg 1: expected native") + return env.NewError("Go(*widget.Accordion)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -67322,21 +66527,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Accordion switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Accordion) - if !ok { + if vc, ok := v.Value.(*widget.Accordion); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//size: arg 1: expected native of type *widget.Accordion") + return env.NewError("Go(*widget.Accordion)//size: arg 1: " + "expected native of type *widget.Accordion, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//size: arg 1: expected native") + return env.NewError("Go(*widget.Accordion)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -67351,21 +66556,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Accordion switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Accordion) - if !ok { + if vc, ok := v.Value.(*widget.Accordion); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//visible: arg 1: expected native of type *widget.Accordion") + return env.NewError("Go(*widget.Accordion)//visible: arg 1: " + "expected native of type *widget.Accordion, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Accordion)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Accordion)//visible: arg 1: expected native") + return env.NewError("Go(*widget.Accordion)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -67380,47 +66585,49 @@ var Builtins = map[string]*env.Builtin{ var self *widget.AccordionItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.AccordionItem) - if !ok { + if vc, ok := v.Value.(*widget.AccordionItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.AccordionItem)//detail!: arg 1: expected native of type *widget.AccordionItem") + return env.NewError("Go(*widget.AccordionItem)//detail!: arg 1: " + "expected native of type *widget.AccordionItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.AccordionItem)//detail!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.AccordionItem)//detail!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.AccordionItem)//detail!: arg 1: expected native") + return env.NewError("Go(*widget.AccordionItem)//detail!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.CanvasObject switch v := arg1.(type) { case env.RyeCtx: var err error - self.Detail, err = ctxTo_fyne_CanvasObject(ps, v) + newVal, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.AccordionItem)//detail!: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.AccordionItem)//detail!: arg 2: " + err.Error()) } case env.Native: - var ok bool - self.Detail, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.AccordionItem)//detail!: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("Go(*widget.AccordionItem)//detail!: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.AccordionItem)//detail!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.AccordionItem)//detail!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Detail = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.AccordionItem)//detail!: arg 2: expected native") + return env.NewError("Go(*widget.AccordionItem)//detail!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Detail = newVal return arg0 }, }, @@ -67431,41 +66638,24 @@ var Builtins = map[string]*env.Builtin{ var self *widget.AccordionItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.AccordionItem) - if !ok { + if vc, ok := v.Value.(*widget.AccordionItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.AccordionItem)//detail?: arg 1: expected native of type *widget.AccordionItem") + return env.NewError("Go(*widget.AccordionItem)//detail?: arg 1: " + "expected native of type *widget.AccordionItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.AccordionItem)//detail?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.AccordionItem)//detail?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.AccordionItem)//detail?: arg 1: expected native") + return env.NewError("Go(*widget.AccordionItem)//detail?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - { - typ := reflect.TypeOf(self.Detail) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - resObj = *env.NewNative(ps.Idx, self.Detail, typRyeName) - } else { - resObj = *env.NewNative(ps.Idx, self.Detail, "Go(fyne.CanvasObject)") - } - } + resObj = ifaceToNative(ps.Idx, self.Detail, "Go(fyne.CanvasObject)") return resObj }, }, @@ -67476,28 +66666,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.AccordionItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.AccordionItem) - if !ok { + if vc, ok := v.Value.(*widget.AccordionItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.AccordionItem)//open!: arg 1: expected native of type *widget.AccordionItem") + return env.NewError("Go(*widget.AccordionItem)//open!: arg 1: " + "expected native of type *widget.AccordionItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.AccordionItem)//open!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.AccordionItem)//open!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.AccordionItem)//open!: arg 1: expected native") + return env.NewError("Go(*widget.AccordionItem)//open!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Open = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.AccordionItem)//open!: arg 2: expected integer") + return env.NewError("Go(*widget.AccordionItem)//open!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Open = newVal return arg0 }, }, @@ -67508,21 +66700,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.AccordionItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.AccordionItem) - if !ok { + if vc, ok := v.Value.(*widget.AccordionItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.AccordionItem)//open?: arg 1: expected native of type *widget.AccordionItem") + return env.NewError("Go(*widget.AccordionItem)//open?: arg 1: " + "expected native of type *widget.AccordionItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.AccordionItem)//open?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.AccordionItem)//open?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.AccordionItem)//open?: arg 1: expected native") + return env.NewError("Go(*widget.AccordionItem)//open?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Open)) @@ -67536,28 +66728,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.AccordionItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.AccordionItem) - if !ok { + if vc, ok := v.Value.(*widget.AccordionItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.AccordionItem)//title!: arg 1: expected native of type *widget.AccordionItem") + return env.NewError("Go(*widget.AccordionItem)//title!: arg 1: " + "expected native of type *widget.AccordionItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.AccordionItem)//title!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.AccordionItem)//title!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.AccordionItem)//title!: arg 1: expected native") + return env.NewError("Go(*widget.AccordionItem)//title!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.Title = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.AccordionItem)//title!: arg 2: expected string") + return env.NewError("Go(*widget.AccordionItem)//title!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.Title = newVal return arg0 }, }, @@ -67568,21 +66762,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.AccordionItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.AccordionItem) - if !ok { + if vc, ok := v.Value.(*widget.AccordionItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.AccordionItem)//title?: arg 1: expected native of type *widget.AccordionItem") + return env.NewError("Go(*widget.AccordionItem)//title?: arg 1: " + "expected native of type *widget.AccordionItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.AccordionItem)//title?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.AccordionItem)//title?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.AccordionItem)//title?: arg 1: expected native") + return env.NewError("Go(*widget.AccordionItem)//title?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.Title) @@ -67596,21 +66790,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.BaseWidget switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.BaseWidget) - if !ok { + if vc, ok := v.Value.(*widget.BaseWidget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//extend-base-widget: arg 1: expected native of type *widget.BaseWidget") + return env.NewError("Go(*widget.BaseWidget)//extend-base-widget: arg 1: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.BaseWidget)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.BaseWidget)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -67619,24 +66813,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.BaseWidget)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.BaseWidget)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.BaseWidget)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.BaseWidget)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -67649,28 +66843,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.BaseWidget switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.BaseWidget) - if !ok { + if vc, ok := v.Value.(*widget.BaseWidget); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//hidden!: arg 1: expected native of type *widget.BaseWidget") + return env.NewError("Go(*widget.BaseWidget)//hidden!: arg 1: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.BaseWidget)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.BaseWidget)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.BaseWidget)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -67681,21 +66877,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.BaseWidget switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.BaseWidget) - if !ok { + if vc, ok := v.Value.(*widget.BaseWidget); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//hidden?: arg 1: expected native of type *widget.BaseWidget") + return env.NewError("Go(*widget.BaseWidget)//hidden?: arg 1: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.BaseWidget)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.BaseWidget)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -67709,21 +66905,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.BaseWidget switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.BaseWidget) - if !ok { + if vc, ok := v.Value.(*widget.BaseWidget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//hide: arg 1: expected native of type *widget.BaseWidget") + return env.NewError("Go(*widget.BaseWidget)//hide: arg 1: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.BaseWidget)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//hide: arg 1: expected native") + return env.NewError("Go(*widget.BaseWidget)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -67736,21 +66932,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.BaseWidget switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.BaseWidget) - if !ok { + if vc, ok := v.Value.(*widget.BaseWidget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//min-size: arg 1: expected native of type *widget.BaseWidget") + return env.NewError("Go(*widget.BaseWidget)//min-size: arg 1: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.BaseWidget)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.BaseWidget)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -67765,42 +66961,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.BaseWidget switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.BaseWidget) - if !ok { + if vc, ok := v.Value.(*widget.BaseWidget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//move: arg 1: expected native of type *widget.BaseWidget") + return env.NewError("Go(*widget.BaseWidget)//move: arg 1: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.BaseWidget)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//move: arg 1: expected native") + return env.NewError("Go(*widget.BaseWidget)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.BaseWidget)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//move: arg 2: expected native") + return env.NewError("Go(*widget.BaseWidget)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -67811,21 +67001,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.BaseWidget switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.BaseWidget) - if !ok { + if vc, ok := v.Value.(*widget.BaseWidget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//position: arg 1: expected native of type *widget.BaseWidget") + return env.NewError("Go(*widget.BaseWidget)//position: arg 1: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.BaseWidget)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//position: arg 1: expected native") + return env.NewError("Go(*widget.BaseWidget)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -67840,21 +67030,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.BaseWidget switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.BaseWidget) - if !ok { + if vc, ok := v.Value.(*widget.BaseWidget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//refresh: arg 1: expected native of type *widget.BaseWidget") + return env.NewError("Go(*widget.BaseWidget)//refresh: arg 1: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.BaseWidget)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.BaseWidget)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -67867,42 +67057,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.BaseWidget switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.BaseWidget) - if !ok { + if vc, ok := v.Value.(*widget.BaseWidget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//resize: arg 1: expected native of type *widget.BaseWidget") + return env.NewError("Go(*widget.BaseWidget)//resize: arg 1: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.BaseWidget)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//resize: arg 1: expected native") + return env.NewError("Go(*widget.BaseWidget)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.BaseWidget)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//resize: arg 2: expected native") + return env.NewError("Go(*widget.BaseWidget)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -67913,21 +67097,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.BaseWidget switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.BaseWidget) - if !ok { + if vc, ok := v.Value.(*widget.BaseWidget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//show: arg 1: expected native of type *widget.BaseWidget") + return env.NewError("Go(*widget.BaseWidget)//show: arg 1: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.BaseWidget)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//show: arg 1: expected native") + return env.NewError("Go(*widget.BaseWidget)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -67940,21 +67124,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.BaseWidget switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.BaseWidget) - if !ok { + if vc, ok := v.Value.(*widget.BaseWidget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//size: arg 1: expected native of type *widget.BaseWidget") + return env.NewError("Go(*widget.BaseWidget)//size: arg 1: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.BaseWidget)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//size: arg 1: expected native") + return env.NewError("Go(*widget.BaseWidget)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -67969,21 +67153,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.BaseWidget switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.BaseWidget) - if !ok { + if vc, ok := v.Value.(*widget.BaseWidget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//visible: arg 1: expected native of type *widget.BaseWidget") + return env.NewError("Go(*widget.BaseWidget)//visible: arg 1: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.BaseWidget)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.BaseWidget)//visible: arg 1: expected native") + return env.NewError("Go(*widget.BaseWidget)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -67998,22 +67182,23 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//alignment!: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//alignment!: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//alignment!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//alignment!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//alignment!: arg 1: expected native") + return env.NewError("Go(*widget.Button)//alignment!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal widget.ButtonAlign { nat, natOk := arg1.(env.Native) var natValOk bool @@ -68022,18 +67207,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(widget.ButtonAlign) } if natValOk { - self.Alignment = natVal + newVal = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//alignment!: arg 2: expected integer") + return env.NewError("Go(*widget.Button)//alignment!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } - self.Alignment = widget.ButtonAlign(u) + newVal = widget.ButtonAlign(u) } } + self.Alignment = newVal return arg0 }, }, @@ -68044,27 +67230,101 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//alignment?: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//alignment?: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//alignment?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//alignment?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//alignment?: arg 1: expected native") + return env.NewError("Go(*widget.Button)//alignment?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(int(self.Alignment))) return resObj }, }, + "Go(*widget.Button)//base-widget!": { + Doc: "Set *widget.Button BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Button + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Button); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Button)//base-widget!: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Button)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Button)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Button)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Button)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Button)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*widget.Button)//base-widget?": { + Doc: "Get *widget.Button BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Button + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Button); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Button)//base-widget?: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Button)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Button)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj + }, + }, "Go(*widget.Button)//create-renderer": { Doc: "(*widget.Button).CreateRenderer", Argsn: 1, @@ -68072,42 +67332,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//create-renderer: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//create-renderer: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//create-renderer: arg 1: expected native") + return env.NewError("Go(*widget.Button)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -68118,42 +67361,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//cursor: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//cursor: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//cursor: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//cursor: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//cursor: arg 1: expected native") + return env.NewError("Go(*widget.Button)//cursor: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Cursor() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(desktop.Cursor)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(desktop.Cursor)") return res0Obj }, }, @@ -68164,26 +67390,100 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//disable: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//disable: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//disable: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//disable: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//disable: arg 1: expected native") + return env.NewError("Go(*widget.Button)//disable: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Disable() return arg0 }, }, + "Go(*widget.Button)//disableable-widget!": { + Doc: "Set *widget.Button DisableableWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Button + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Button); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Button)//disableable-widget!: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Button)//disableable-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Button)//disableable-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.DisableableWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.DisableableWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Button)//disableable-widget!: arg 2: " + "expected native of type *widget.DisableableWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Button)//disableable-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Button)//disableable-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.DisableableWidget = *newVal + return arg0 + }, + }, + "Go(*widget.Button)//disableable-widget?": { + Doc: "Get *widget.Button DisableableWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Button + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Button); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Button)//disableable-widget?: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Button)//disableable-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Button)//disableable-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.DisableableWidget, "Go(*widget.DisableableWidget)") + return resObj + }, + }, "Go(*widget.Button)//disabled": { Doc: "(*widget.Button).Disabled", Argsn: 1, @@ -68191,21 +67491,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//disabled: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//disabled: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//disabled: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//disabled: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//disabled: arg 1: expected native") + return env.NewError("Go(*widget.Button)//disabled: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Disabled() var res0Obj env.Object @@ -68220,21 +67520,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//enable: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//enable: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//enable: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//enable: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//enable: arg 1: expected native") + return env.NewError("Go(*widget.Button)//enable: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Enable() return arg0 @@ -68247,21 +67547,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//extend-base-widget: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//extend-base-widget: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.Button)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -68270,24 +67570,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Button)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.Button)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.Button)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -68300,21 +67600,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//focus-gained: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//focus-gained: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//focus-gained: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//focus-gained: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//focus-gained: arg 1: expected native") + return env.NewError("Go(*widget.Button)//focus-gained: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusGained() return arg0 @@ -68327,21 +67627,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//focus-lost: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//focus-lost: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//focus-lost: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//focus-lost: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//focus-lost: arg 1: expected native") + return env.NewError("Go(*widget.Button)//focus-lost: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusLost() return arg0 @@ -68354,28 +67654,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//hidden!: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//hidden!: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.Button)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.Button)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -68386,21 +67688,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//hidden?: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//hidden?: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.Button)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -68414,21 +67716,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//hide: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//hide: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//hide: arg 1: expected native") + return env.NewError("Go(*widget.Button)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -68441,47 +67743,49 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//icon!: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//icon!: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//icon!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//icon!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//icon!: arg 1: expected native") + return env.NewError("Go(*widget.Button)//icon!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.Resource switch v := arg1.(type) { case env.RyeCtx: var err error - self.Icon, err = ctxTo_fyne_Resource(ps, v) + newVal, err = ctxTo_fyne_Resource(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//icon!: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Button)//icon!: arg 2: " + err.Error()) } case env.Native: - var ok bool - self.Icon, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//icon!: arg 2: expected native of type fyne.Resource") + return env.NewError("Go(*widget.Button)//icon!: arg 2: " + "expected native of type fyne.Resource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//icon!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//icon!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Icon = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//icon!: arg 2: expected native") + return env.NewError("Go(*widget.Button)//icon!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Icon = newVal return arg0 }, }, @@ -68492,22 +67796,23 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//icon-placement!: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//icon-placement!: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//icon-placement!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//icon-placement!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//icon-placement!: arg 1: expected native") + return env.NewError("Go(*widget.Button)//icon-placement!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal widget.ButtonIconPlacement { nat, natOk := arg1.(env.Native) var natValOk bool @@ -68516,18 +67821,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(widget.ButtonIconPlacement) } if natValOk { - self.IconPlacement = natVal + newVal = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//icon-placement!: arg 2: expected integer") + return env.NewError("Go(*widget.Button)//icon-placement!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } - self.IconPlacement = widget.ButtonIconPlacement(u) + newVal = widget.ButtonIconPlacement(u) } } + self.IconPlacement = newVal return arg0 }, }, @@ -68538,21 +67844,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//icon-placement?: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//icon-placement?: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//icon-placement?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//icon-placement?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//icon-placement?: arg 1: expected native") + return env.NewError("Go(*widget.Button)//icon-placement?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(int(self.IconPlacement))) @@ -68566,41 +67872,24 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//icon?: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//icon?: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//icon?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//icon?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//icon?: arg 1: expected native") + return env.NewError("Go(*widget.Button)//icon?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - { - typ := reflect.TypeOf(self.Icon) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - resObj = *env.NewNative(ps.Idx, self.Icon, typRyeName) - } else { - resObj = *env.NewNative(ps.Idx, self.Icon, "Go(fyne.Resource)") - } - } + resObj = ifaceToNative(ps.Idx, self.Icon, "Go(fyne.Resource)") return resObj }, }, @@ -68611,22 +67900,23 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//importance!: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//importance!: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//importance!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//importance!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//importance!: arg 1: expected native") + return env.NewError("Go(*widget.Button)//importance!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal widget.Importance { nat, natOk := arg1.(env.Native) var natValOk bool @@ -68635,18 +67925,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(widget.Importance) } if natValOk { - self.Importance = natVal + newVal = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//importance!: arg 2: expected integer") + return env.NewError("Go(*widget.Button)//importance!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } - self.Importance = widget.Importance(u) + newVal = widget.Importance(u) } } + self.Importance = newVal return arg0 }, }, @@ -68657,21 +67948,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//importance?: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//importance?: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//importance?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//importance?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//importance?: arg 1: expected native") + return env.NewError("Go(*widget.Button)//importance?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(int(self.Importance))) @@ -68685,21 +67976,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//min-size: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//min-size: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.Button)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -68714,40 +68005,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//mouse-in: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//mouse-in: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//mouse-in: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//mouse-in: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//mouse-in: arg 1: expected native") + return env.NewError("Go(*widget.Button)//mouse-in: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *desktop.MouseEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//mouse-in: arg 2: expected native of type *desktop.MouseEvent") + return env.NewError("Go(*widget.Button)//mouse-in: arg 2: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//mouse-in: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//mouse-in: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//mouse-in: arg 2: expected native") + return env.NewError("Go(*widget.Button)//mouse-in: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.MouseIn(arg1Val) return arg0 @@ -68760,40 +68051,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//mouse-moved: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//mouse-moved: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//mouse-moved: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//mouse-moved: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//mouse-moved: arg 1: expected native") + return env.NewError("Go(*widget.Button)//mouse-moved: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *desktop.MouseEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//mouse-moved: arg 2: expected native of type *desktop.MouseEvent") + return env.NewError("Go(*widget.Button)//mouse-moved: arg 2: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//mouse-moved: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//mouse-moved: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//mouse-moved: arg 2: expected native") + return env.NewError("Go(*widget.Button)//mouse-moved: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.MouseMoved(arg1Val) return arg0 @@ -68806,21 +68097,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//mouse-out: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//mouse-out: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//mouse-out: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//mouse-out: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//mouse-out: arg 1: expected native") + return env.NewError("Go(*widget.Button)//mouse-out: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.MouseOut() return arg0 @@ -68833,42 +68124,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//move: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//move: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//move: arg 1: expected native") + return env.NewError("Go(*widget.Button)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//move: arg 2: expected native") + return env.NewError("Go(*widget.Button)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -68879,29 +68164,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//on-tapped!: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//on-tapped!: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//on-tapped!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//on-tapped!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//on-tapped!: arg 1: expected native") + return env.NewError("Go(*widget.Button)//on-tapped!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func() switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//on-tapped!: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(*widget.Button)//on-tapped!: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnTapped = func() { + newVal = func() { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, ps.Ctx) @@ -68909,13 +68195,14 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//on-tapped!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//on-tapped!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnTapped = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//on-tapped!: arg 2: expected function or nil") + return env.NewError("Go(*widget.Button)//on-tapped!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnTapped = newVal return arg0 }, }, @@ -68926,24 +68213,27 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//on-tapped?: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//on-tapped?: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//on-tapped?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//on-tapped?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//on-tapped?: arg 1: expected native") + return env.NewError("Go(*widget.Button)//on-tapped?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnTapped, "Go(func())") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + self.OnTapped() + return nil + }, 0, false, false, "Returned func") return resObj }, }, @@ -68954,21 +68244,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//position: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//position: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//position: arg 1: expected native") + return env.NewError("Go(*widget.Button)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -68983,21 +68273,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//refresh: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//refresh: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.Button)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -69010,42 +68300,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//resize: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//resize: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//resize: arg 1: expected native") + return env.NewError("Go(*widget.Button)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//resize: arg 2: expected native") + return env.NewError("Go(*widget.Button)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -69056,21 +68340,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//set-icon: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//set-icon: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//set-icon: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//set-icon: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//set-icon: arg 1: expected native") + return env.NewError("Go(*widget.Button)//set-icon: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Resource switch v := arg1.(type) { @@ -69079,24 +68363,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Resource(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//set-icon: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Button)//set-icon: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//set-icon: arg 2: expected native of type fyne.Resource") + return env.NewError("Go(*widget.Button)//set-icon: arg 2: " + "expected native of type fyne.Resource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//set-icon: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//set-icon: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//set-icon: arg 2: expected native") + return env.NewError("Go(*widget.Button)//set-icon: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetIcon(arg1Val) return arg0 @@ -69109,28 +68393,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//set-text: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//set-text: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//set-text: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//set-text: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//set-text: arg 1: expected native") + return env.NewError("Go(*widget.Button)//set-text: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//set-text: arg 2: expected string") + return env.NewError("Go(*widget.Button)//set-text: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetText(arg1Val) return arg0 @@ -69143,21 +68427,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//show: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//show: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//show: arg 1: expected native") + return env.NewError("Go(*widget.Button)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -69170,21 +68454,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//size: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//size: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//size: arg 1: expected native") + return env.NewError("Go(*widget.Button)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -69199,40 +68483,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//tapped: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//tapped: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//tapped: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//tapped: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//tapped: arg 1: expected native") + return env.NewError("Go(*widget.Button)//tapped: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.PointEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.PointEvent) - if !ok { + if vc, ok := v.Value.(*fyne.PointEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//tapped: arg 2: expected native of type *fyne.PointEvent") + return env.NewError("Go(*widget.Button)//tapped: arg 2: " + "expected native of type *fyne.PointEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//tapped: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//tapped: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//tapped: arg 2: expected native") + return env.NewError("Go(*widget.Button)//tapped: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Tapped(arg1Val) return arg0 @@ -69245,28 +68529,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//text!: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//text!: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//text!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//text!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//text!: arg 1: expected native") + return env.NewError("Go(*widget.Button)//text!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.Text = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//text!: arg 2: expected string") + return env.NewError("Go(*widget.Button)//text!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.Text = newVal return arg0 }, }, @@ -69277,21 +68563,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//text?: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//text?: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//text?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//text?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//text?: arg 1: expected native") + return env.NewError("Go(*widget.Button)//text?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.Text) @@ -69305,40 +68591,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//typed-key: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//typed-key: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//typed-key: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//typed-key: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//typed-key: arg 1: expected native") + return env.NewError("Go(*widget.Button)//typed-key: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.KeyEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.KeyEvent) - if !ok { + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//typed-key: arg 2: expected native of type *fyne.KeyEvent") + return env.NewError("Go(*widget.Button)//typed-key: arg 2: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//typed-key: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//typed-key: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//typed-key: arg 2: expected native") + return env.NewError("Go(*widget.Button)//typed-key: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedKey(arg1Val) return arg0 @@ -69351,34 +68637,34 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//typed-rune: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//typed-rune: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//typed-rune: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//typed-rune: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//typed-rune: arg 1: expected native") + return env.NewError("Go(*widget.Button)//typed-rune: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val rune switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//typed-rune: arg 2: expected native of type rune") + return env.NewError("Go(*widget.Button)//typed-rune: arg 2: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//typed-rune: arg 2: expected native") + return env.NewError("Go(*widget.Button)//typed-rune: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedRune(arg1Val) return arg0 @@ -69391,21 +68677,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Button switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Button) - if !ok { + if vc, ok := v.Value.(*widget.Button); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//visible: arg 1: expected native of type *widget.Button") + return env.NewError("Go(*widget.Button)//visible: arg 1: " + "expected native of type *widget.Button, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Button)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Button)//visible: arg 1: expected native") + return env.NewError("Go(*widget.Button)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -69413,6 +68699,80 @@ var Builtins = map[string]*env.Builtin{ return res0Obj }, }, + "Go(*widget.Card)//base-widget!": { + Doc: "Set *widget.Card BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Card + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Card); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Card)//base-widget!: arg 1: " + "expected native of type *widget.Card, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Card)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Card)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Card)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Card)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Card)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*widget.Card)//base-widget?": { + Doc: "Get *widget.Card BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Card + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Card); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Card)//base-widget?: arg 1: " + "expected native of type *widget.Card, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Card)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Card)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj + }, + }, "Go(*widget.Card)//content!": { Doc: "Set *widget.Card Content value", Argsn: 2, @@ -69420,47 +68780,49 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Card switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Card) - if !ok { + if vc, ok := v.Value.(*widget.Card); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//content!: arg 1: expected native of type *widget.Card") + return env.NewError("Go(*widget.Card)//content!: arg 1: " + "expected native of type *widget.Card, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//content!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//content!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//content!: arg 1: expected native") + return env.NewError("Go(*widget.Card)//content!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.CanvasObject switch v := arg1.(type) { case env.RyeCtx: var err error - self.Content, err = ctxTo_fyne_CanvasObject(ps, v) + newVal, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//content!: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Card)//content!: arg 2: " + err.Error()) } case env.Native: - var ok bool - self.Content, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//content!: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("Go(*widget.Card)//content!: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//content!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//content!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Content = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//content!: arg 2: expected native") + return env.NewError("Go(*widget.Card)//content!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Content = newVal return arg0 }, }, @@ -69471,41 +68833,24 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Card switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Card) - if !ok { + if vc, ok := v.Value.(*widget.Card); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//content?: arg 1: expected native of type *widget.Card") + return env.NewError("Go(*widget.Card)//content?: arg 1: " + "expected native of type *widget.Card, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//content?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//content?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//content?: arg 1: expected native") + return env.NewError("Go(*widget.Card)//content?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - { - typ := reflect.TypeOf(self.Content) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - resObj = *env.NewNative(ps.Idx, self.Content, typRyeName) - } else { - resObj = *env.NewNative(ps.Idx, self.Content, "Go(fyne.CanvasObject)") - } - } + resObj = ifaceToNative(ps.Idx, self.Content, "Go(fyne.CanvasObject)") return resObj }, }, @@ -69516,42 +68861,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Card switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Card) - if !ok { + if vc, ok := v.Value.(*widget.Card); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//create-renderer: arg 1: expected native of type *widget.Card") + return env.NewError("Go(*widget.Card)//create-renderer: arg 1: " + "expected native of type *widget.Card, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//create-renderer: arg 1: expected native") + return env.NewError("Go(*widget.Card)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -69562,21 +68890,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Card switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Card) - if !ok { + if vc, ok := v.Value.(*widget.Card); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//extend-base-widget: arg 1: expected native of type *widget.Card") + return env.NewError("Go(*widget.Card)//extend-base-widget: arg 1: " + "expected native of type *widget.Card, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.Card)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -69585,24 +68913,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Card)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.Card)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.Card)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -69615,28 +68943,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Card switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Card) - if !ok { + if vc, ok := v.Value.(*widget.Card); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//hidden!: arg 1: expected native of type *widget.Card") + return env.NewError("Go(*widget.Card)//hidden!: arg 1: " + "expected native of type *widget.Card, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.Card)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.Card)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -69647,21 +68977,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Card switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Card) - if !ok { + if vc, ok := v.Value.(*widget.Card); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//hidden?: arg 1: expected native of type *widget.Card") + return env.NewError("Go(*widget.Card)//hidden?: arg 1: " + "expected native of type *widget.Card, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.Card)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -69675,21 +69005,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Card switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Card) - if !ok { + if vc, ok := v.Value.(*widget.Card); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//hide: arg 1: expected native of type *widget.Card") + return env.NewError("Go(*widget.Card)//hide: arg 1: " + "expected native of type *widget.Card, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//hide: arg 1: expected native") + return env.NewError("Go(*widget.Card)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -69702,40 +69032,42 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Card switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Card) - if !ok { + if vc, ok := v.Value.(*widget.Card); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//image!: arg 1: expected native of type *widget.Card") + return env.NewError("Go(*widget.Card)//image!: arg 1: " + "expected native of type *widget.Card, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//image!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//image!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//image!: arg 1: expected native") + return env.NewError("Go(*widget.Card)//image!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal *canvas.Image switch v := arg1.(type) { case env.Native: - var ok bool - self.Image, ok = v.Value.(*canvas.Image) - if !ok { + if vc, ok := v.Value.(*canvas.Image); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//image!: arg 2: expected native of type *canvas.Image") + return env.NewError("Go(*widget.Card)//image!: arg 2: " + "expected native of type *canvas.Image, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//image!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//image!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Image = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//image!: arg 2: expected native") + return env.NewError("Go(*widget.Card)//image!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Image = newVal return arg0 }, }, @@ -69746,21 +69078,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Card switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Card) - if !ok { + if vc, ok := v.Value.(*widget.Card); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//image?: arg 1: expected native of type *widget.Card") + return env.NewError("Go(*widget.Card)//image?: arg 1: " + "expected native of type *widget.Card, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//image?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//image?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//image?: arg 1: expected native") + return env.NewError("Go(*widget.Card)//image?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, self.Image, "Go(*canvas.Image)") @@ -69774,21 +69106,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Card switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Card) - if !ok { + if vc, ok := v.Value.(*widget.Card); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//min-size: arg 1: expected native of type *widget.Card") + return env.NewError("Go(*widget.Card)//min-size: arg 1: " + "expected native of type *widget.Card, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.Card)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -69803,42 +69135,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Card switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Card) - if !ok { + if vc, ok := v.Value.(*widget.Card); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//move: arg 1: expected native of type *widget.Card") + return env.NewError("Go(*widget.Card)//move: arg 1: " + "expected native of type *widget.Card, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//move: arg 1: expected native") + return env.NewError("Go(*widget.Card)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//move: arg 2: expected native") + return env.NewError("Go(*widget.Card)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -69849,21 +69175,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Card switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Card) - if !ok { + if vc, ok := v.Value.(*widget.Card); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//position: arg 1: expected native of type *widget.Card") + return env.NewError("Go(*widget.Card)//position: arg 1: " + "expected native of type *widget.Card, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//position: arg 1: expected native") + return env.NewError("Go(*widget.Card)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -69878,21 +69204,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Card switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Card) - if !ok { + if vc, ok := v.Value.(*widget.Card); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//refresh: arg 1: expected native of type *widget.Card") + return env.NewError("Go(*widget.Card)//refresh: arg 1: " + "expected native of type *widget.Card, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.Card)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -69905,42 +69231,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Card switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Card) - if !ok { + if vc, ok := v.Value.(*widget.Card); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//resize: arg 1: expected native of type *widget.Card") + return env.NewError("Go(*widget.Card)//resize: arg 1: " + "expected native of type *widget.Card, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//resize: arg 1: expected native") + return env.NewError("Go(*widget.Card)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//resize: arg 2: expected native") + return env.NewError("Go(*widget.Card)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -69951,21 +69271,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Card switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Card) - if !ok { + if vc, ok := v.Value.(*widget.Card); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//set-content: arg 1: expected native of type *widget.Card") + return env.NewError("Go(*widget.Card)//set-content: arg 1: " + "expected native of type *widget.Card, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//set-content: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//set-content: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//set-content: arg 1: expected native") + return env.NewError("Go(*widget.Card)//set-content: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.CanvasObject switch v := arg1.(type) { @@ -69974,24 +69294,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//set-content: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Card)//set-content: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//set-content: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("Go(*widget.Card)//set-content: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//set-content: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//set-content: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//set-content: arg 2: expected native") + return env.NewError("Go(*widget.Card)//set-content: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetContent(arg1Val) return arg0 @@ -70004,40 +69324,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Card switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Card) - if !ok { + if vc, ok := v.Value.(*widget.Card); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//set-image: arg 1: expected native of type *widget.Card") + return env.NewError("Go(*widget.Card)//set-image: arg 1: " + "expected native of type *widget.Card, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//set-image: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//set-image: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//set-image: arg 1: expected native") + return env.NewError("Go(*widget.Card)//set-image: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *canvas.Image switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*canvas.Image) - if !ok { + if vc, ok := v.Value.(*canvas.Image); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//set-image: arg 2: expected native of type *canvas.Image") + return env.NewError("Go(*widget.Card)//set-image: arg 2: " + "expected native of type *canvas.Image, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//set-image: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//set-image: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//set-image: arg 2: expected native") + return env.NewError("Go(*widget.Card)//set-image: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetImage(arg1Val) return arg0 @@ -70050,28 +69370,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Card switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Card) - if !ok { + if vc, ok := v.Value.(*widget.Card); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//set-sub-title: arg 1: expected native of type *widget.Card") + return env.NewError("Go(*widget.Card)//set-sub-title: arg 1: " + "expected native of type *widget.Card, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//set-sub-title: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//set-sub-title: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//set-sub-title: arg 1: expected native") + return env.NewError("Go(*widget.Card)//set-sub-title: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//set-sub-title: arg 2: expected string") + return env.NewError("Go(*widget.Card)//set-sub-title: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetSubTitle(arg1Val) return arg0 @@ -70084,28 +69404,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Card switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Card) - if !ok { + if vc, ok := v.Value.(*widget.Card); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//set-title: arg 1: expected native of type *widget.Card") + return env.NewError("Go(*widget.Card)//set-title: arg 1: " + "expected native of type *widget.Card, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//set-title: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//set-title: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//set-title: arg 1: expected native") + return env.NewError("Go(*widget.Card)//set-title: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//set-title: arg 2: expected string") + return env.NewError("Go(*widget.Card)//set-title: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetTitle(arg1Val) return arg0 @@ -70118,21 +69438,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Card switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Card) - if !ok { + if vc, ok := v.Value.(*widget.Card); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//show: arg 1: expected native of type *widget.Card") + return env.NewError("Go(*widget.Card)//show: arg 1: " + "expected native of type *widget.Card, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//show: arg 1: expected native") + return env.NewError("Go(*widget.Card)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -70145,21 +69465,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Card switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Card) - if !ok { + if vc, ok := v.Value.(*widget.Card); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//size: arg 1: expected native of type *widget.Card") + return env.NewError("Go(*widget.Card)//size: arg 1: " + "expected native of type *widget.Card, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//size: arg 1: expected native") + return env.NewError("Go(*widget.Card)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -70174,28 +69494,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Card switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Card) - if !ok { + if vc, ok := v.Value.(*widget.Card); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//subtitle!: arg 1: expected native of type *widget.Card") + return env.NewError("Go(*widget.Card)//subtitle!: arg 1: " + "expected native of type *widget.Card, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//subtitle!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//subtitle!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//subtitle!: arg 1: expected native") + return env.NewError("Go(*widget.Card)//subtitle!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.Subtitle = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//subtitle!: arg 2: expected string") + return env.NewError("Go(*widget.Card)//subtitle!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.Subtitle = newVal return arg0 }, }, @@ -70206,21 +69528,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Card switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Card) - if !ok { + if vc, ok := v.Value.(*widget.Card); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//subtitle?: arg 1: expected native of type *widget.Card") + return env.NewError("Go(*widget.Card)//subtitle?: arg 1: " + "expected native of type *widget.Card, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//subtitle?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//subtitle?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//subtitle?: arg 1: expected native") + return env.NewError("Go(*widget.Card)//subtitle?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.Subtitle) @@ -70234,28 +69556,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Card switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Card) - if !ok { + if vc, ok := v.Value.(*widget.Card); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//title!: arg 1: expected native of type *widget.Card") + return env.NewError("Go(*widget.Card)//title!: arg 1: " + "expected native of type *widget.Card, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//title!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//title!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//title!: arg 1: expected native") + return env.NewError("Go(*widget.Card)//title!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.Title = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//title!: arg 2: expected string") + return env.NewError("Go(*widget.Card)//title!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.Title = newVal return arg0 }, }, @@ -70266,21 +69590,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Card switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Card) - if !ok { + if vc, ok := v.Value.(*widget.Card); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//title?: arg 1: expected native of type *widget.Card") + return env.NewError("Go(*widget.Card)//title?: arg 1: " + "expected native of type *widget.Card, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//title?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//title?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//title?: arg 1: expected native") + return env.NewError("Go(*widget.Card)//title?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.Title) @@ -70294,21 +69618,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Card switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Card) - if !ok { + if vc, ok := v.Value.(*widget.Card); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//visible: arg 1: expected native of type *widget.Card") + return env.NewError("Go(*widget.Card)//visible: arg 1: " + "expected native of type *widget.Card, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Card)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Card)//visible: arg 1: expected native") + return env.NewError("Go(*widget.Card)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -70316,6 +69640,80 @@ var Builtins = map[string]*env.Builtin{ return res0Obj }, }, + "Go(*widget.Check)//base-widget!": { + Doc: "Set *widget.Check BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Check + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Check); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Check)//base-widget!: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Check)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Check)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Check)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Check)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Check)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*widget.Check)//base-widget?": { + Doc: "Get *widget.Check BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Check + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Check); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Check)//base-widget?: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Check)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Check)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj + }, + }, "Go(*widget.Check)//bind": { Doc: "(*widget.Check).Bind", Argsn: 2, @@ -70323,21 +69721,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//bind: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//bind: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//bind: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//bind: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//bind: arg 1: expected native") + return env.NewError("Go(*widget.Check)//bind: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.Bool switch v := arg1.(type) { @@ -70346,24 +69744,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_Bool(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//bind: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Check)//bind: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.Bool) - if !ok { + if vc, ok := v.Value.(binding.Bool); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//bind: arg 2: expected native of type binding.Bool") + return env.NewError("Go(*widget.Check)//bind: arg 2: " + "expected native of type binding.Bool, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//bind: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//bind: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//bind: arg 2: expected native") + return env.NewError("Go(*widget.Check)//bind: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Bind(arg1Val) return arg0 @@ -70376,28 +69774,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//checked!: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//checked!: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//checked!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//checked!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//checked!: arg 1: expected native") + return env.NewError("Go(*widget.Check)//checked!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Checked = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//checked!: arg 2: expected integer") + return env.NewError("Go(*widget.Check)//checked!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Checked = newVal return arg0 }, }, @@ -70408,21 +69808,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//checked?: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//checked?: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//checked?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//checked?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//checked?: arg 1: expected native") + return env.NewError("Go(*widget.Check)//checked?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Checked)) @@ -70436,42 +69836,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//create-renderer: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//create-renderer: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//create-renderer: arg 1: expected native") + return env.NewError("Go(*widget.Check)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -70482,26 +69865,100 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//disable: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//disable: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//disable: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//disable: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//disable: arg 1: expected native") + return env.NewError("Go(*widget.Check)//disable: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Disable() return arg0 }, }, + "Go(*widget.Check)//disableable-widget!": { + Doc: "Set *widget.Check DisableableWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Check + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Check); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Check)//disableable-widget!: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Check)//disableable-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Check)//disableable-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.DisableableWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.DisableableWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Check)//disableable-widget!: arg 2: " + "expected native of type *widget.DisableableWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Check)//disableable-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Check)//disableable-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.DisableableWidget = *newVal + return arg0 + }, + }, + "Go(*widget.Check)//disableable-widget?": { + Doc: "Get *widget.Check DisableableWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Check + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Check); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Check)//disableable-widget?: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Check)//disableable-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Check)//disableable-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.DisableableWidget, "Go(*widget.DisableableWidget)") + return resObj + }, + }, "Go(*widget.Check)//disabled": { Doc: "(*widget.Check).Disabled", Argsn: 1, @@ -70509,21 +69966,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//disabled: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//disabled: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//disabled: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//disabled: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//disabled: arg 1: expected native") + return env.NewError("Go(*widget.Check)//disabled: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Disabled() var res0Obj env.Object @@ -70538,21 +69995,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//enable: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//enable: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//enable: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//enable: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//enable: arg 1: expected native") + return env.NewError("Go(*widget.Check)//enable: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Enable() return arg0 @@ -70565,21 +70022,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//extend-base-widget: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//extend-base-widget: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.Check)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -70588,24 +70045,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Check)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.Check)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.Check)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -70618,21 +70075,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//focus-gained: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//focus-gained: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//focus-gained: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//focus-gained: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//focus-gained: arg 1: expected native") + return env.NewError("Go(*widget.Check)//focus-gained: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusGained() return arg0 @@ -70645,21 +70102,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//focus-lost: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//focus-lost: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//focus-lost: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//focus-lost: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//focus-lost: arg 1: expected native") + return env.NewError("Go(*widget.Check)//focus-lost: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusLost() return arg0 @@ -70672,28 +70129,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//hidden!: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//hidden!: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.Check)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.Check)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -70704,21 +70163,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//hidden?: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//hidden?: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.Check)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -70732,21 +70191,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//hide: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//hide: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//hide: arg 1: expected native") + return env.NewError("Go(*widget.Check)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -70759,21 +70218,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//min-size: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//min-size: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.Check)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -70788,40 +70247,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//mouse-in: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//mouse-in: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//mouse-in: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//mouse-in: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//mouse-in: arg 1: expected native") + return env.NewError("Go(*widget.Check)//mouse-in: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *desktop.MouseEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//mouse-in: arg 2: expected native of type *desktop.MouseEvent") + return env.NewError("Go(*widget.Check)//mouse-in: arg 2: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//mouse-in: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//mouse-in: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//mouse-in: arg 2: expected native") + return env.NewError("Go(*widget.Check)//mouse-in: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.MouseIn(arg1Val) return arg0 @@ -70834,40 +70293,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//mouse-moved: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//mouse-moved: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//mouse-moved: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//mouse-moved: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//mouse-moved: arg 1: expected native") + return env.NewError("Go(*widget.Check)//mouse-moved: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *desktop.MouseEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//mouse-moved: arg 2: expected native of type *desktop.MouseEvent") + return env.NewError("Go(*widget.Check)//mouse-moved: arg 2: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//mouse-moved: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//mouse-moved: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//mouse-moved: arg 2: expected native") + return env.NewError("Go(*widget.Check)//mouse-moved: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.MouseMoved(arg1Val) return arg0 @@ -70880,21 +70339,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//mouse-out: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//mouse-out: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//mouse-out: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//mouse-out: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//mouse-out: arg 1: expected native") + return env.NewError("Go(*widget.Check)//mouse-out: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.MouseOut() return arg0 @@ -70907,42 +70366,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//move: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//move: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//move: arg 1: expected native") + return env.NewError("Go(*widget.Check)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//move: arg 2: expected native") + return env.NewError("Go(*widget.Check)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -70953,45 +70406,47 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//on-changed!: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//on-changed!: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//on-changed!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//on-changed!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//on-changed!: arg 1: expected native") + return env.NewError("Go(*widget.Check)//on-changed!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(bool) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//on-changed!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*widget.Check)//on-changed!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnChanged = func(arg0 bool) { - var arg0Val env.Object - arg0Val = *env.NewInteger(boolToInt64(arg0)) + newVal = func(farg0 bool) { + var farg0Val env.Object + farg0Val = *env.NewInteger(boolToInt64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//on-changed!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//on-changed!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnChanged = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//on-changed!: arg 2: expected function or nil") + return env.NewError("Go(*widget.Check)//on-changed!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnChanged = newVal return arg0 }, }, @@ -71002,24 +70457,34 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//on-changed?: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//on-changed?: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//on-changed?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//on-changed?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//on-changed?: arg 1: expected native") + return env.NewError("Go(*widget.Check)//on-changed?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnChanged, "Go(func(bool))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val bool + if vc, ok := arg0.(env.Integer); ok { + arg0Val = vc.Value != 0 + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Check)//on-changed?: arg 1: " + "expected integer, but got " + objectDebugString(ps.Idx, arg0)) + } + self.OnChanged(arg0Val) + return nil + }, 1, false, false, "Returned func") return resObj }, }, @@ -71030,21 +70495,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//position: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//position: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//position: arg 1: expected native") + return env.NewError("Go(*widget.Check)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -71059,21 +70524,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//refresh: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//refresh: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.Check)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -71086,42 +70551,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//resize: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//resize: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//resize: arg 1: expected native") + return env.NewError("Go(*widget.Check)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//resize: arg 2: expected native") + return env.NewError("Go(*widget.Check)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -71132,28 +70591,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//set-checked: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//set-checked: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//set-checked: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//set-checked: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//set-checked: arg 1: expected native") + return env.NewError("Go(*widget.Check)//set-checked: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val bool - if v, ok := arg1.(env.Integer); ok { - arg1Val = v.Value != 0 + if vc, ok := arg1.(env.Integer); ok { + arg1Val = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//set-checked: arg 2: expected integer") + return env.NewError("Go(*widget.Check)//set-checked: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetChecked(arg1Val) return arg0 @@ -71166,28 +70625,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//set-text: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//set-text: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//set-text: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//set-text: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//set-text: arg 1: expected native") + return env.NewError("Go(*widget.Check)//set-text: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//set-text: arg 2: expected string") + return env.NewError("Go(*widget.Check)//set-text: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetText(arg1Val) return arg0 @@ -71200,21 +70659,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//show: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//show: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//show: arg 1: expected native") + return env.NewError("Go(*widget.Check)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -71227,21 +70686,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//size: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//size: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//size: arg 1: expected native") + return env.NewError("Go(*widget.Check)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -71256,40 +70715,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//tapped: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//tapped: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//tapped: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//tapped: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//tapped: arg 1: expected native") + return env.NewError("Go(*widget.Check)//tapped: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.PointEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.PointEvent) - if !ok { + if vc, ok := v.Value.(*fyne.PointEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//tapped: arg 2: expected native of type *fyne.PointEvent") + return env.NewError("Go(*widget.Check)//tapped: arg 2: " + "expected native of type *fyne.PointEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//tapped: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//tapped: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//tapped: arg 2: expected native") + return env.NewError("Go(*widget.Check)//tapped: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Tapped(arg1Val) return arg0 @@ -71302,28 +70761,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//text!: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//text!: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//text!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//text!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//text!: arg 1: expected native") + return env.NewError("Go(*widget.Check)//text!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.Text = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//text!: arg 2: expected string") + return env.NewError("Go(*widget.Check)//text!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.Text = newVal return arg0 }, }, @@ -71334,21 +70795,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//text?: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//text?: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//text?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//text?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//text?: arg 1: expected native") + return env.NewError("Go(*widget.Check)//text?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.Text) @@ -71362,40 +70823,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//typed-key: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//typed-key: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//typed-key: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//typed-key: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//typed-key: arg 1: expected native") + return env.NewError("Go(*widget.Check)//typed-key: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.KeyEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.KeyEvent) - if !ok { + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//typed-key: arg 2: expected native of type *fyne.KeyEvent") + return env.NewError("Go(*widget.Check)//typed-key: arg 2: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//typed-key: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//typed-key: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//typed-key: arg 2: expected native") + return env.NewError("Go(*widget.Check)//typed-key: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedKey(arg1Val) return arg0 @@ -71408,34 +70869,34 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//typed-rune: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//typed-rune: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//typed-rune: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//typed-rune: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//typed-rune: arg 1: expected native") + return env.NewError("Go(*widget.Check)//typed-rune: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val rune switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//typed-rune: arg 2: expected native of type rune") + return env.NewError("Go(*widget.Check)//typed-rune: arg 2: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//typed-rune: arg 2: expected native") + return env.NewError("Go(*widget.Check)//typed-rune: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedRune(arg1Val) return arg0 @@ -71448,21 +70909,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//unbind: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//unbind: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//unbind: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//unbind: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//unbind: arg 1: expected native") + return env.NewError("Go(*widget.Check)//unbind: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Unbind() return arg0 @@ -71475,21 +70936,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Check switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Check) - if !ok { + if vc, ok := v.Value.(*widget.Check); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//visible: arg 1: expected native of type *widget.Check") + return env.NewError("Go(*widget.Check)//visible: arg 1: " + "expected native of type *widget.Check, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Check)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Check)//visible: arg 1: expected native") + return env.NewError("Go(*widget.Check)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -71504,33 +70965,107 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.CheckGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.CheckGroup) - if !ok { + if vc, ok := v.Value.(*widget.CheckGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//append: arg 1: expected native of type *widget.CheckGroup") + return env.NewError("Go(*widget.CheckGroup)//append: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//append: arg 1: expected native") + return env.NewError("Go(*widget.CheckGroup)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//append: arg 2: expected string") + return env.NewError("Go(*widget.CheckGroup)//append: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.Append(arg1Val) return arg0 }, }, + "Go(*widget.CheckGroup)//base-widget!": { + Doc: "Set *widget.CheckGroup BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.CheckGroup + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.CheckGroup); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.CheckGroup)//base-widget!: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.CheckGroup)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.CheckGroup)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.CheckGroup)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.CheckGroup)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.CheckGroup)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*widget.CheckGroup)//base-widget?": { + Doc: "Get *widget.CheckGroup BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.CheckGroup + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.CheckGroup); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.CheckGroup)//base-widget?: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.CheckGroup)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.CheckGroup)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj + }, + }, "Go(*widget.CheckGroup)//create-renderer": { Doc: "(*widget.CheckGroup).CreateRenderer", Argsn: 1, @@ -71538,42 +71073,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.CheckGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.CheckGroup) - if !ok { + if vc, ok := v.Value.(*widget.CheckGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//create-renderer: arg 1: expected native of type *widget.CheckGroup") + return env.NewError("Go(*widget.CheckGroup)//create-renderer: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//create-renderer: arg 1: expected native") + return env.NewError("Go(*widget.CheckGroup)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -71584,26 +71102,100 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.CheckGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.CheckGroup) - if !ok { + if vc, ok := v.Value.(*widget.CheckGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//disable: arg 1: expected native of type *widget.CheckGroup") + return env.NewError("Go(*widget.CheckGroup)//disable: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//disable: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//disable: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//disable: arg 1: expected native") + return env.NewError("Go(*widget.CheckGroup)//disable: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Disable() return arg0 }, }, + "Go(*widget.CheckGroup)//disableable-widget!": { + Doc: "Set *widget.CheckGroup DisableableWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.CheckGroup + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.CheckGroup); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.CheckGroup)//disableable-widget!: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.CheckGroup)//disableable-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.CheckGroup)//disableable-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.DisableableWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.DisableableWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.CheckGroup)//disableable-widget!: arg 2: " + "expected native of type *widget.DisableableWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.CheckGroup)//disableable-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.CheckGroup)//disableable-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.DisableableWidget = *newVal + return arg0 + }, + }, + "Go(*widget.CheckGroup)//disableable-widget?": { + Doc: "Get *widget.CheckGroup DisableableWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.CheckGroup + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.CheckGroup); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.CheckGroup)//disableable-widget?: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.CheckGroup)//disableable-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.CheckGroup)//disableable-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.DisableableWidget, "Go(*widget.DisableableWidget)") + return resObj + }, + }, "Go(*widget.CheckGroup)//disabled": { Doc: "(*widget.CheckGroup).Disabled", Argsn: 1, @@ -71611,21 +71203,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.CheckGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.CheckGroup) - if !ok { + if vc, ok := v.Value.(*widget.CheckGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//disabled: arg 1: expected native of type *widget.CheckGroup") + return env.NewError("Go(*widget.CheckGroup)//disabled: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//disabled: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//disabled: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//disabled: arg 1: expected native") + return env.NewError("Go(*widget.CheckGroup)//disabled: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Disabled() var res0Obj env.Object @@ -71640,21 +71232,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.CheckGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.CheckGroup) - if !ok { + if vc, ok := v.Value.(*widget.CheckGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//enable: arg 1: expected native of type *widget.CheckGroup") + return env.NewError("Go(*widget.CheckGroup)//enable: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//enable: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//enable: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//enable: arg 1: expected native") + return env.NewError("Go(*widget.CheckGroup)//enable: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Enable() return arg0 @@ -71667,21 +71259,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.CheckGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.CheckGroup) - if !ok { + if vc, ok := v.Value.(*widget.CheckGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//extend-base-widget: arg 1: expected native of type *widget.CheckGroup") + return env.NewError("Go(*widget.CheckGroup)//extend-base-widget: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.CheckGroup)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -71690,24 +71282,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.CheckGroup)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.CheckGroup)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.CheckGroup)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -71720,28 +71312,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.CheckGroup switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.CheckGroup) - if !ok { + if vc, ok := v.Value.(*widget.CheckGroup); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//hidden!: arg 1: expected native of type *widget.CheckGroup") + return env.NewError("Go(*widget.CheckGroup)//hidden!: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.CheckGroup)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.CheckGroup)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -71752,21 +71346,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.CheckGroup switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.CheckGroup) - if !ok { + if vc, ok := v.Value.(*widget.CheckGroup); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//hidden?: arg 1: expected native of type *widget.CheckGroup") + return env.NewError("Go(*widget.CheckGroup)//hidden?: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.CheckGroup)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -71780,21 +71374,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.CheckGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.CheckGroup) - if !ok { + if vc, ok := v.Value.(*widget.CheckGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//hide: arg 1: expected native of type *widget.CheckGroup") + return env.NewError("Go(*widget.CheckGroup)//hide: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//hide: arg 1: expected native") + return env.NewError("Go(*widget.CheckGroup)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -71807,28 +71401,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.CheckGroup switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.CheckGroup) - if !ok { + if vc, ok := v.Value.(*widget.CheckGroup); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//horizontal!: arg 1: expected native of type *widget.CheckGroup") + return env.NewError("Go(*widget.CheckGroup)//horizontal!: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//horizontal!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//horizontal!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//horizontal!: arg 1: expected native") + return env.NewError("Go(*widget.CheckGroup)//horizontal!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Horizontal = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//horizontal!: arg 2: expected integer") + return env.NewError("Go(*widget.CheckGroup)//horizontal!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Horizontal = newVal return arg0 }, }, @@ -71839,21 +71435,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.CheckGroup switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.CheckGroup) - if !ok { + if vc, ok := v.Value.(*widget.CheckGroup); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//horizontal?: arg 1: expected native of type *widget.CheckGroup") + return env.NewError("Go(*widget.CheckGroup)//horizontal?: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//horizontal?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//horizontal?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//horizontal?: arg 1: expected native") + return env.NewError("Go(*widget.CheckGroup)//horizontal?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Horizontal)) @@ -71867,21 +71463,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.CheckGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.CheckGroup) - if !ok { + if vc, ok := v.Value.(*widget.CheckGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//min-size: arg 1: expected native of type *widget.CheckGroup") + return env.NewError("Go(*widget.CheckGroup)//min-size: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.CheckGroup)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -71896,42 +71492,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.CheckGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.CheckGroup) - if !ok { + if vc, ok := v.Value.(*widget.CheckGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//move: arg 1: expected native of type *widget.CheckGroup") + return env.NewError("Go(*widget.CheckGroup)//move: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//move: arg 1: expected native") + return env.NewError("Go(*widget.CheckGroup)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//move: arg 2: expected native") + return env.NewError("Go(*widget.CheckGroup)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -71942,51 +71532,53 @@ var Builtins = map[string]*env.Builtin{ var self *widget.CheckGroup switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.CheckGroup) - if !ok { + if vc, ok := v.Value.(*widget.CheckGroup); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//on-changed!: arg 1: expected native of type *widget.CheckGroup") + return env.NewError("Go(*widget.CheckGroup)//on-changed!: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//on-changed!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//on-changed!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//on-changed!: arg 1: expected native") + return env.NewError("Go(*widget.CheckGroup)//on-changed!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func([]string) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//on-changed!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*widget.CheckGroup)//on-changed!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnChanged = func(arg0 []string) { - var arg0Val env.Object + newVal = func(farg0 []string) { + var farg0Val env.Object { - items := make([]env.Object, len(arg0)) - for i, it := range arg0 { + items := make([]env.Object, len(farg0)) + for i, it := range farg0 { items[i] = *env.NewString(it) } - arg0Val = *env.NewBlock(*env.NewTSeries(items)) + farg0Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//on-changed!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//on-changed!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnChanged = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//on-changed!: arg 2: expected function or nil") + return env.NewError("Go(*widget.CheckGroup)//on-changed!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnChanged = newVal return arg0 }, }, @@ -71997,24 +71589,49 @@ var Builtins = map[string]*env.Builtin{ var self *widget.CheckGroup switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.CheckGroup) - if !ok { + if vc, ok := v.Value.(*widget.CheckGroup); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//on-changed?: arg 1: expected native of type *widget.CheckGroup") + return env.NewError("Go(*widget.CheckGroup)//on-changed?: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//on-changed?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//on-changed?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//on-changed?: arg 1: expected native") + return env.NewError("Go(*widget.CheckGroup)//on-changed?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnChanged, "Go(func([]string))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val []string + switch v := arg0.(type) { + case env.Block: + arg0Val = make([]string, len(v.Series.S)) + for i, it := range v.Series.S { + if vc, ok := it.(env.String); ok { + arg0Val[i] = string(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.CheckGroup)//on-changed?: arg 1: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) + } + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.CheckGroup)//on-changed?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg0Val = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.CheckGroup)//on-changed?: arg 1: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) + } + self.OnChanged(arg0Val) + return nil + }, 1, false, false, "Returned func") return resObj }, }, @@ -72025,50 +71642,45 @@ var Builtins = map[string]*env.Builtin{ var self *widget.CheckGroup switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.CheckGroup) - if !ok { + if vc, ok := v.Value.(*widget.CheckGroup); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//options!: arg 1: expected native of type *widget.CheckGroup") + return env.NewError("Go(*widget.CheckGroup)//options!: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//options!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//options!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//options!: arg 1: expected native") + return env.NewError("Go(*widget.CheckGroup)//options!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal []string switch v := arg1.(type) { case env.Block: - self.Options = make([]string, len(v.Series.S)) + newVal = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - self.Options[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + newVal[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//options!: arg 2: block item: expected string") + return env.NewError("Go(*widget.CheckGroup)//options!: arg 2: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - self.Options, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//options!: arg 2: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//options!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//options!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Options = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//options!: arg 2: expected block, native or nil") + return env.NewError("Go(*widget.CheckGroup)//options!: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } + self.Options = newVal return arg0 }, }, @@ -72079,21 +71691,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.CheckGroup switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.CheckGroup) - if !ok { + if vc, ok := v.Value.(*widget.CheckGroup); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//options?: arg 1: expected native of type *widget.CheckGroup") + return env.NewError("Go(*widget.CheckGroup)//options?: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//options?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//options?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//options?: arg 1: expected native") + return env.NewError("Go(*widget.CheckGroup)//options?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object { @@ -72113,21 +71725,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.CheckGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.CheckGroup) - if !ok { + if vc, ok := v.Value.(*widget.CheckGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//position: arg 1: expected native of type *widget.CheckGroup") + return env.NewError("Go(*widget.CheckGroup)//position: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//position: arg 1: expected native") + return env.NewError("Go(*widget.CheckGroup)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -72142,21 +71754,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.CheckGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.CheckGroup) - if !ok { + if vc, ok := v.Value.(*widget.CheckGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//refresh: arg 1: expected native of type *widget.CheckGroup") + return env.NewError("Go(*widget.CheckGroup)//refresh: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.CheckGroup)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -72169,28 +71781,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.CheckGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.CheckGroup) - if !ok { + if vc, ok := v.Value.(*widget.CheckGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//remove: arg 1: expected native of type *widget.CheckGroup") + return env.NewError("Go(*widget.CheckGroup)//remove: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//remove: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//remove: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//remove: arg 1: expected native") + return env.NewError("Go(*widget.CheckGroup)//remove: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//remove: arg 2: expected string") + return env.NewError("Go(*widget.CheckGroup)//remove: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := arg0Val.Remove(arg1Val) var res0Obj env.Object @@ -72205,28 +71817,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.CheckGroup switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.CheckGroup) - if !ok { + if vc, ok := v.Value.(*widget.CheckGroup); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//required!: arg 1: expected native of type *widget.CheckGroup") + return env.NewError("Go(*widget.CheckGroup)//required!: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//required!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//required!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//required!: arg 1: expected native") + return env.NewError("Go(*widget.CheckGroup)//required!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Required = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//required!: arg 2: expected integer") + return env.NewError("Go(*widget.CheckGroup)//required!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Required = newVal return arg0 }, }, @@ -72237,21 +71851,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.CheckGroup switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.CheckGroup) - if !ok { + if vc, ok := v.Value.(*widget.CheckGroup); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//required?: arg 1: expected native of type *widget.CheckGroup") + return env.NewError("Go(*widget.CheckGroup)//required?: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//required?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//required?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//required?: arg 1: expected native") + return env.NewError("Go(*widget.CheckGroup)//required?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Required)) @@ -72265,42 +71879,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.CheckGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.CheckGroup) - if !ok { + if vc, ok := v.Value.(*widget.CheckGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//resize: arg 1: expected native of type *widget.CheckGroup") + return env.NewError("Go(*widget.CheckGroup)//resize: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//resize: arg 1: expected native") + return env.NewError("Go(*widget.CheckGroup)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//resize: arg 2: expected native") + return env.NewError("Go(*widget.CheckGroup)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -72311,50 +71919,45 @@ var Builtins = map[string]*env.Builtin{ var self *widget.CheckGroup switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.CheckGroup) - if !ok { + if vc, ok := v.Value.(*widget.CheckGroup); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//selected!: arg 1: expected native of type *widget.CheckGroup") + return env.NewError("Go(*widget.CheckGroup)//selected!: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//selected!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//selected!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//selected!: arg 1: expected native") + return env.NewError("Go(*widget.CheckGroup)//selected!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal []string switch v := arg1.(type) { case env.Block: - self.Selected = make([]string, len(v.Series.S)) + newVal = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - self.Selected[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + newVal[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//selected!: arg 2: block item: expected string") + return env.NewError("Go(*widget.CheckGroup)//selected!: arg 2: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - self.Selected, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//selected!: arg 2: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//selected!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//selected!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Selected = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//selected!: arg 2: expected block, native or nil") + return env.NewError("Go(*widget.CheckGroup)//selected!: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } + self.Selected = newVal return arg0 }, }, @@ -72365,21 +71968,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.CheckGroup switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.CheckGroup) - if !ok { + if vc, ok := v.Value.(*widget.CheckGroup); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//selected?: arg 1: expected native of type *widget.CheckGroup") + return env.NewError("Go(*widget.CheckGroup)//selected?: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//selected?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//selected?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//selected?: arg 1: expected native") + return env.NewError("Go(*widget.CheckGroup)//selected?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object { @@ -72399,50 +72002,43 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.CheckGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.CheckGroup) - if !ok { + if vc, ok := v.Value.(*widget.CheckGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//set-selected: arg 1: expected native of type *widget.CheckGroup") + return env.NewError("Go(*widget.CheckGroup)//set-selected: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//set-selected: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//set-selected: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//set-selected: arg 1: expected native") + return env.NewError("Go(*widget.CheckGroup)//set-selected: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []string switch v := arg1.(type) { case env.Block: arg1Val = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - arg1Val[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + arg1Val[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//set-selected: arg 2: block item: expected string") + return env.NewError("Go(*widget.CheckGroup)//set-selected: arg 2: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//set-selected: arg 2: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//set-selected: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//set-selected: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//set-selected: arg 2: expected block, native or nil") + return env.NewError("Go(*widget.CheckGroup)//set-selected: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetSelected(arg1Val) return arg0 @@ -72455,21 +72051,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.CheckGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.CheckGroup) - if !ok { + if vc, ok := v.Value.(*widget.CheckGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//show: arg 1: expected native of type *widget.CheckGroup") + return env.NewError("Go(*widget.CheckGroup)//show: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//show: arg 1: expected native") + return env.NewError("Go(*widget.CheckGroup)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -72482,21 +72078,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.CheckGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.CheckGroup) - if !ok { + if vc, ok := v.Value.(*widget.CheckGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//size: arg 1: expected native of type *widget.CheckGroup") + return env.NewError("Go(*widget.CheckGroup)//size: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//size: arg 1: expected native") + return env.NewError("Go(*widget.CheckGroup)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -72511,21 +72107,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.CheckGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.CheckGroup) - if !ok { + if vc, ok := v.Value.(*widget.CheckGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//visible: arg 1: expected native of type *widget.CheckGroup") + return env.NewError("Go(*widget.CheckGroup)//visible: arg 1: " + "expected native of type *widget.CheckGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CheckGroup)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CheckGroup)//visible: arg 1: expected native") + return env.NewError("Go(*widget.CheckGroup)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -72540,21 +72136,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.CustomTextGridStyle switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.CustomTextGridStyle) - if !ok { + if vc, ok := v.Value.(*widget.CustomTextGridStyle); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CustomTextGridStyle)//background-color: arg 1: expected native of type *widget.CustomTextGridStyle") + return env.NewError("Go(*widget.CustomTextGridStyle)//background-color: arg 1: " + "expected native of type *widget.CustomTextGridStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CustomTextGridStyle)//background-color: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CustomTextGridStyle)//background-color: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CustomTextGridStyle)//background-color: arg 1: expected native") + return env.NewError("Go(*widget.CustomTextGridStyle)//background-color: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.BackgroundColor() var res0Obj env.Object @@ -72569,34 +72165,36 @@ var Builtins = map[string]*env.Builtin{ var self *widget.CustomTextGridStyle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.CustomTextGridStyle) - if !ok { + if vc, ok := v.Value.(*widget.CustomTextGridStyle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CustomTextGridStyle)//bg-color!: arg 1: expected native of type *widget.CustomTextGridStyle") + return env.NewError("Go(*widget.CustomTextGridStyle)//bg-color!: arg 1: " + "expected native of type *widget.CustomTextGridStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CustomTextGridStyle)//bg-color!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CustomTextGridStyle)//bg-color!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CustomTextGridStyle)//bg-color!: arg 1: expected native") + return env.NewError("Go(*widget.CustomTextGridStyle)//bg-color!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal color.Color switch v := arg1.(type) { case env.Native: - var ok bool - self.BGColor, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CustomTextGridStyle)//bg-color!: arg 2: expected native of type color.Color") + return env.NewError("Go(*widget.CustomTextGridStyle)//bg-color!: arg 2: " + "expected native of type color.Color, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*widget.CustomTextGridStyle)//bg-color!: arg 2: expected native") + return env.NewError("Go(*widget.CustomTextGridStyle)//bg-color!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.BGColor = newVal return arg0 }, }, @@ -72607,21 +72205,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.CustomTextGridStyle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.CustomTextGridStyle) - if !ok { + if vc, ok := v.Value.(*widget.CustomTextGridStyle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CustomTextGridStyle)//bg-color?: arg 1: expected native of type *widget.CustomTextGridStyle") + return env.NewError("Go(*widget.CustomTextGridStyle)//bg-color?: arg 1: " + "expected native of type *widget.CustomTextGridStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CustomTextGridStyle)//bg-color?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CustomTextGridStyle)//bg-color?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CustomTextGridStyle)//bg-color?: arg 1: expected native") + return env.NewError("Go(*widget.CustomTextGridStyle)//bg-color?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, self.BGColor, "Go(color.Color)") @@ -72635,34 +72233,36 @@ var Builtins = map[string]*env.Builtin{ var self *widget.CustomTextGridStyle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.CustomTextGridStyle) - if !ok { + if vc, ok := v.Value.(*widget.CustomTextGridStyle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CustomTextGridStyle)//fg-color!: arg 1: expected native of type *widget.CustomTextGridStyle") + return env.NewError("Go(*widget.CustomTextGridStyle)//fg-color!: arg 1: " + "expected native of type *widget.CustomTextGridStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CustomTextGridStyle)//fg-color!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CustomTextGridStyle)//fg-color!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CustomTextGridStyle)//fg-color!: arg 1: expected native") + return env.NewError("Go(*widget.CustomTextGridStyle)//fg-color!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal color.Color switch v := arg1.(type) { case env.Native: - var ok bool - self.FGColor, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CustomTextGridStyle)//fg-color!: arg 2: expected native of type color.Color") + return env.NewError("Go(*widget.CustomTextGridStyle)//fg-color!: arg 2: " + "expected native of type color.Color, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*widget.CustomTextGridStyle)//fg-color!: arg 2: expected native") + return env.NewError("Go(*widget.CustomTextGridStyle)//fg-color!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.FGColor = newVal return arg0 }, }, @@ -72673,21 +72273,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.CustomTextGridStyle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.CustomTextGridStyle) - if !ok { + if vc, ok := v.Value.(*widget.CustomTextGridStyle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CustomTextGridStyle)//fg-color?: arg 1: expected native of type *widget.CustomTextGridStyle") + return env.NewError("Go(*widget.CustomTextGridStyle)//fg-color?: arg 1: " + "expected native of type *widget.CustomTextGridStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CustomTextGridStyle)//fg-color?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CustomTextGridStyle)//fg-color?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CustomTextGridStyle)//fg-color?: arg 1: expected native") + return env.NewError("Go(*widget.CustomTextGridStyle)//fg-color?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, self.FGColor, "Go(color.Color)") @@ -72701,21 +72301,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.CustomTextGridStyle switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.CustomTextGridStyle) - if !ok { + if vc, ok := v.Value.(*widget.CustomTextGridStyle); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.CustomTextGridStyle)//text-color: arg 1: expected native of type *widget.CustomTextGridStyle") + return env.NewError("Go(*widget.CustomTextGridStyle)//text-color: arg 1: " + "expected native of type *widget.CustomTextGridStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.CustomTextGridStyle)//text-color: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.CustomTextGridStyle)//text-color: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.CustomTextGridStyle)//text-color: arg 1: expected native") + return env.NewError("Go(*widget.CustomTextGridStyle)//text-color: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.TextColor() var res0Obj env.Object @@ -72723,6 +72323,80 @@ var Builtins = map[string]*env.Builtin{ return res0Obj }, }, + "Go(*widget.DisableableWidget)//base-widget!": { + Doc: "Set *widget.DisableableWidget BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.DisableableWidget + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.DisableableWidget); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.DisableableWidget)//base-widget!: arg 1: " + "expected native of type *widget.DisableableWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.DisableableWidget)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.DisableableWidget)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.DisableableWidget)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.DisableableWidget)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.DisableableWidget)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*widget.DisableableWidget)//base-widget?": { + Doc: "Get *widget.DisableableWidget BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.DisableableWidget + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.DisableableWidget); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.DisableableWidget)//base-widget?: arg 1: " + "expected native of type *widget.DisableableWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.DisableableWidget)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.DisableableWidget)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj + }, + }, "Go(*widget.DisableableWidget)//disable": { Doc: "(*widget.DisableableWidget).Disable", Argsn: 1, @@ -72730,21 +72404,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.DisableableWidget switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.DisableableWidget) - if !ok { + if vc, ok := v.Value.(*widget.DisableableWidget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//disable: arg 1: expected native of type *widget.DisableableWidget") + return env.NewError("Go(*widget.DisableableWidget)//disable: arg 1: " + "expected native of type *widget.DisableableWidget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//disable: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.DisableableWidget)//disable: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//disable: arg 1: expected native") + return env.NewError("Go(*widget.DisableableWidget)//disable: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Disable() return arg0 @@ -72757,21 +72431,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.DisableableWidget switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.DisableableWidget) - if !ok { + if vc, ok := v.Value.(*widget.DisableableWidget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//disabled: arg 1: expected native of type *widget.DisableableWidget") + return env.NewError("Go(*widget.DisableableWidget)//disabled: arg 1: " + "expected native of type *widget.DisableableWidget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//disabled: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.DisableableWidget)//disabled: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//disabled: arg 1: expected native") + return env.NewError("Go(*widget.DisableableWidget)//disabled: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Disabled() var res0Obj env.Object @@ -72786,21 +72460,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.DisableableWidget switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.DisableableWidget) - if !ok { + if vc, ok := v.Value.(*widget.DisableableWidget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//enable: arg 1: expected native of type *widget.DisableableWidget") + return env.NewError("Go(*widget.DisableableWidget)//enable: arg 1: " + "expected native of type *widget.DisableableWidget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//enable: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.DisableableWidget)//enable: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//enable: arg 1: expected native") + return env.NewError("Go(*widget.DisableableWidget)//enable: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Enable() return arg0 @@ -72813,21 +72487,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.DisableableWidget switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.DisableableWidget) - if !ok { + if vc, ok := v.Value.(*widget.DisableableWidget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//extend-base-widget: arg 1: expected native of type *widget.DisableableWidget") + return env.NewError("Go(*widget.DisableableWidget)//extend-base-widget: arg 1: " + "expected native of type *widget.DisableableWidget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.DisableableWidget)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.DisableableWidget)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -72836,24 +72510,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.DisableableWidget)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.DisableableWidget)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.DisableableWidget)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.DisableableWidget)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -72866,28 +72540,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.DisableableWidget switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.DisableableWidget) - if !ok { + if vc, ok := v.Value.(*widget.DisableableWidget); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//hidden!: arg 1: expected native of type *widget.DisableableWidget") + return env.NewError("Go(*widget.DisableableWidget)//hidden!: arg 1: " + "expected native of type *widget.DisableableWidget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.DisableableWidget)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.DisableableWidget)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.DisableableWidget)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -72898,21 +72574,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.DisableableWidget switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.DisableableWidget) - if !ok { + if vc, ok := v.Value.(*widget.DisableableWidget); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//hidden?: arg 1: expected native of type *widget.DisableableWidget") + return env.NewError("Go(*widget.DisableableWidget)//hidden?: arg 1: " + "expected native of type *widget.DisableableWidget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.DisableableWidget)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.DisableableWidget)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -72926,21 +72602,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.DisableableWidget switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.DisableableWidget) - if !ok { + if vc, ok := v.Value.(*widget.DisableableWidget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//hide: arg 1: expected native of type *widget.DisableableWidget") + return env.NewError("Go(*widget.DisableableWidget)//hide: arg 1: " + "expected native of type *widget.DisableableWidget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.DisableableWidget)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//hide: arg 1: expected native") + return env.NewError("Go(*widget.DisableableWidget)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -72953,21 +72629,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.DisableableWidget switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.DisableableWidget) - if !ok { + if vc, ok := v.Value.(*widget.DisableableWidget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//min-size: arg 1: expected native of type *widget.DisableableWidget") + return env.NewError("Go(*widget.DisableableWidget)//min-size: arg 1: " + "expected native of type *widget.DisableableWidget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.DisableableWidget)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.DisableableWidget)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -72982,42 +72658,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.DisableableWidget switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.DisableableWidget) - if !ok { + if vc, ok := v.Value.(*widget.DisableableWidget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//move: arg 1: expected native of type *widget.DisableableWidget") + return env.NewError("Go(*widget.DisableableWidget)//move: arg 1: " + "expected native of type *widget.DisableableWidget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.DisableableWidget)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//move: arg 1: expected native") + return env.NewError("Go(*widget.DisableableWidget)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.DisableableWidget)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//move: arg 2: expected native") + return env.NewError("Go(*widget.DisableableWidget)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -73028,21 +72698,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.DisableableWidget switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.DisableableWidget) - if !ok { + if vc, ok := v.Value.(*widget.DisableableWidget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//position: arg 1: expected native of type *widget.DisableableWidget") + return env.NewError("Go(*widget.DisableableWidget)//position: arg 1: " + "expected native of type *widget.DisableableWidget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.DisableableWidget)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//position: arg 1: expected native") + return env.NewError("Go(*widget.DisableableWidget)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -73057,21 +72727,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.DisableableWidget switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.DisableableWidget) - if !ok { + if vc, ok := v.Value.(*widget.DisableableWidget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//refresh: arg 1: expected native of type *widget.DisableableWidget") + return env.NewError("Go(*widget.DisableableWidget)//refresh: arg 1: " + "expected native of type *widget.DisableableWidget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.DisableableWidget)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.DisableableWidget)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -73084,42 +72754,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.DisableableWidget switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.DisableableWidget) - if !ok { + if vc, ok := v.Value.(*widget.DisableableWidget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//resize: arg 1: expected native of type *widget.DisableableWidget") + return env.NewError("Go(*widget.DisableableWidget)//resize: arg 1: " + "expected native of type *widget.DisableableWidget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.DisableableWidget)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//resize: arg 1: expected native") + return env.NewError("Go(*widget.DisableableWidget)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.DisableableWidget)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//resize: arg 2: expected native") + return env.NewError("Go(*widget.DisableableWidget)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -73130,21 +72794,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.DisableableWidget switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.DisableableWidget) - if !ok { + if vc, ok := v.Value.(*widget.DisableableWidget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//show: arg 1: expected native of type *widget.DisableableWidget") + return env.NewError("Go(*widget.DisableableWidget)//show: arg 1: " + "expected native of type *widget.DisableableWidget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.DisableableWidget)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//show: arg 1: expected native") + return env.NewError("Go(*widget.DisableableWidget)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -73157,21 +72821,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.DisableableWidget switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.DisableableWidget) - if !ok { + if vc, ok := v.Value.(*widget.DisableableWidget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//size: arg 1: expected native of type *widget.DisableableWidget") + return env.NewError("Go(*widget.DisableableWidget)//size: arg 1: " + "expected native of type *widget.DisableableWidget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.DisableableWidget)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//size: arg 1: expected native") + return env.NewError("Go(*widget.DisableableWidget)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -73186,21 +72850,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.DisableableWidget switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.DisableableWidget) - if !ok { + if vc, ok := v.Value.(*widget.DisableableWidget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//visible: arg 1: expected native of type *widget.DisableableWidget") + return env.NewError("Go(*widget.DisableableWidget)//visible: arg 1: " + "expected native of type *widget.DisableableWidget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.DisableableWidget)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.DisableableWidget)//visible: arg 1: expected native") + return env.NewError("Go(*widget.DisableableWidget)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -73215,21 +72879,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//accepts-tab: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//accepts-tab: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//accepts-tab: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//accepts-tab: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//accepts-tab: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//accepts-tab: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.AcceptsTab() var res0Obj env.Object @@ -73244,47 +72908,49 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//action-item!: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//action-item!: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//action-item!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//action-item!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//action-item!: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//action-item!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.CanvasObject switch v := arg1.(type) { case env.RyeCtx: var err error - self.ActionItem, err = ctxTo_fyne_CanvasObject(ps, v) + newVal, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//action-item!: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Entry)//action-item!: arg 2: " + err.Error()) } case env.Native: - var ok bool - self.ActionItem, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//action-item!: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("Go(*widget.Entry)//action-item!: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//action-item!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//action-item!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.ActionItem = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//action-item!: arg 2: expected native") + return env.NewError("Go(*widget.Entry)//action-item!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.ActionItem = newVal return arg0 }, }, @@ -73295,41 +72961,24 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//action-item?: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//action-item?: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//action-item?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//action-item?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//action-item?: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//action-item?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - { - typ := reflect.TypeOf(self.ActionItem) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - resObj = *env.NewNative(ps.Idx, self.ActionItem, typRyeName) - } else { - resObj = *env.NewNative(ps.Idx, self.ActionItem, "Go(fyne.CanvasObject)") - } - } + resObj = ifaceToNative(ps.Idx, self.ActionItem, "Go(fyne.CanvasObject)") return resObj }, }, @@ -73340,33 +72989,107 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//append: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//append: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//append: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//append: arg 2: expected string") + return env.NewError("Go(*widget.Entry)//append: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.Append(arg1Val) return arg0 }, }, + "Go(*widget.Entry)//base-widget!": { + Doc: "Set *widget.Entry BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Entry + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Entry)//base-widget!: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Entry)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Entry)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Entry)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Entry)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Entry)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*widget.Entry)//base-widget?": { + Doc: "Get *widget.Entry BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Entry + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Entry)//base-widget?: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Entry)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Entry)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj + }, + }, "Go(*widget.Entry)//bind": { Doc: "(*widget.Entry).Bind", Argsn: 2, @@ -73374,21 +73097,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//bind: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//bind: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//bind: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//bind: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//bind: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//bind: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.String switch v := arg1.(type) { @@ -73397,24 +73120,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_String(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//bind: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Entry)//bind: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.String) - if !ok { + if vc, ok := v.Value.(binding.String); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//bind: arg 2: expected native of type binding.String") + return env.NewError("Go(*widget.Entry)//bind: arg 2: " + "expected native of type binding.String, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//bind: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//bind: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//bind: arg 2: expected native") + return env.NewError("Go(*widget.Entry)//bind: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Bind(arg1Val) return arg0 @@ -73427,42 +73150,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//create-renderer: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//create-renderer: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//create-renderer: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -73473,42 +73179,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//cursor: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//cursor: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//cursor: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//cursor: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//cursor: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//cursor: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Cursor() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(desktop.Cursor)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(desktop.Cursor)") return res0Obj }, }, @@ -73519,28 +73208,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//cursor-column!: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//cursor-column!: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//cursor-column!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//cursor-column!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//cursor-column!: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//cursor-column!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.CursorColumn = int(v.Value) + var newVal int + if vc, ok := arg1.(env.Integer); ok { + newVal = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//cursor-column!: arg 2: expected integer") + return env.NewError("Go(*widget.Entry)//cursor-column!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.CursorColumn = newVal return arg0 }, }, @@ -73551,21 +73242,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//cursor-column?: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//cursor-column?: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//cursor-column?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//cursor-column?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//cursor-column?: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//cursor-column?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(self.CursorColumn)) @@ -73579,28 +73270,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//cursor-row!: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//cursor-row!: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//cursor-row!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//cursor-row!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//cursor-row!: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//cursor-row!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.CursorRow = int(v.Value) + var newVal int + if vc, ok := arg1.(env.Integer); ok { + newVal = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//cursor-row!: arg 2: expected integer") + return env.NewError("Go(*widget.Entry)//cursor-row!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.CursorRow = newVal return arg0 }, }, @@ -73611,21 +73304,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//cursor-row?: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//cursor-row?: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//cursor-row?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//cursor-row?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//cursor-row?: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//cursor-row?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(self.CursorRow)) @@ -73639,26 +73332,100 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//disable: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//disable: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//disable: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//disable: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//disable: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//disable: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Disable() return arg0 }, }, + "Go(*widget.Entry)//disableable-widget!": { + Doc: "Set *widget.Entry DisableableWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Entry + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Entry)//disableable-widget!: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Entry)//disableable-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Entry)//disableable-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.DisableableWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.DisableableWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Entry)//disableable-widget!: arg 2: " + "expected native of type *widget.DisableableWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Entry)//disableable-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Entry)//disableable-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.DisableableWidget = *newVal + return arg0 + }, + }, + "Go(*widget.Entry)//disableable-widget?": { + Doc: "Get *widget.Entry DisableableWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Entry + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Entry)//disableable-widget?: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Entry)//disableable-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Entry)//disableable-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.DisableableWidget, "Go(*widget.DisableableWidget)") + return resObj + }, + }, "Go(*widget.Entry)//disabled": { Doc: "(*widget.Entry).Disabled", Argsn: 1, @@ -73666,21 +73433,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//disabled: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//disabled: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//disabled: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//disabled: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//disabled: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//disabled: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Disabled() var res0Obj env.Object @@ -73695,40 +73462,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//double-tapped: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//double-tapped: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//double-tapped: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//double-tapped: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//double-tapped: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//double-tapped: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.PointEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.PointEvent) - if !ok { + if vc, ok := v.Value.(*fyne.PointEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//double-tapped: arg 2: expected native of type *fyne.PointEvent") + return env.NewError("Go(*widget.Entry)//double-tapped: arg 2: " + "expected native of type *fyne.PointEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//double-tapped: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//double-tapped: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//double-tapped: arg 2: expected native") + return env.NewError("Go(*widget.Entry)//double-tapped: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.DoubleTapped(arg1Val) return arg0 @@ -73741,21 +73508,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//drag-end: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//drag-end: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//drag-end: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//drag-end: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//drag-end: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//drag-end: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.DragEnd() return arg0 @@ -73768,40 +73535,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//dragged: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//dragged: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//dragged: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//dragged: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//dragged: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//dragged: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.DragEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.DragEvent) - if !ok { + if vc, ok := v.Value.(*fyne.DragEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//dragged: arg 2: expected native of type *fyne.DragEvent") + return env.NewError("Go(*widget.Entry)//dragged: arg 2: " + "expected native of type *fyne.DragEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//dragged: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//dragged: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//dragged: arg 2: expected native") + return env.NewError("Go(*widget.Entry)//dragged: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Dragged(arg1Val) return arg0 @@ -73814,21 +73581,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//enable: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//enable: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//enable: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//enable: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//enable: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//enable: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Enable() return arg0 @@ -73841,21 +73608,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//extend-base-widget: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//extend-base-widget: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -73864,24 +73631,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Entry)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.Entry)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.Entry)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -73894,21 +73661,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//focus-gained: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//focus-gained: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//focus-gained: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//focus-gained: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//focus-gained: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//focus-gained: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusGained() return arg0 @@ -73921,21 +73688,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//focus-lost: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//focus-lost: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//focus-lost: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//focus-lost: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//focus-lost: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//focus-lost: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusLost() return arg0 @@ -73948,28 +73715,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//hidden!: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//hidden!: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.Entry)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -73980,21 +73749,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//hidden?: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//hidden?: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -74008,21 +73777,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//hide: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//hide: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//hide: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -74035,40 +73804,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//key-down: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//key-down: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//key-down: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//key-down: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//key-down: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//key-down: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.KeyEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.KeyEvent) - if !ok { + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//key-down: arg 2: expected native of type *fyne.KeyEvent") + return env.NewError("Go(*widget.Entry)//key-down: arg 2: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//key-down: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//key-down: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//key-down: arg 2: expected native") + return env.NewError("Go(*widget.Entry)//key-down: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.KeyDown(arg1Val) return arg0 @@ -74081,40 +73850,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//key-up: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//key-up: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//key-up: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//key-up: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//key-up: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//key-up: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.KeyEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.KeyEvent) - if !ok { + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//key-up: arg 2: expected native of type *fyne.KeyEvent") + return env.NewError("Go(*widget.Entry)//key-up: arg 2: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//key-up: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//key-up: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//key-up: arg 2: expected native") + return env.NewError("Go(*widget.Entry)//key-up: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.KeyUp(arg1Val) return arg0 @@ -74127,21 +73896,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//keyboard: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//keyboard: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//keyboard: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//keyboard: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//keyboard: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//keyboard: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Keyboard() var res0Obj env.Object @@ -74156,21 +73925,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//min-size: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//min-size: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -74185,40 +73954,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//mouse-down: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//mouse-down: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//mouse-down: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//mouse-down: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//mouse-down: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//mouse-down: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *desktop.MouseEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//mouse-down: arg 2: expected native of type *desktop.MouseEvent") + return env.NewError("Go(*widget.Entry)//mouse-down: arg 2: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//mouse-down: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//mouse-down: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//mouse-down: arg 2: expected native") + return env.NewError("Go(*widget.Entry)//mouse-down: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.MouseDown(arg1Val) return arg0 @@ -74231,40 +74000,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//mouse-up: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//mouse-up: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//mouse-up: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//mouse-up: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//mouse-up: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//mouse-up: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *desktop.MouseEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//mouse-up: arg 2: expected native of type *desktop.MouseEvent") + return env.NewError("Go(*widget.Entry)//mouse-up: arg 2: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//mouse-up: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//mouse-up: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//mouse-up: arg 2: expected native") + return env.NewError("Go(*widget.Entry)//mouse-up: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.MouseUp(arg1Val) return arg0 @@ -74277,42 +74046,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//move: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//move: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//move: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//move: arg 2: expected native") + return env.NewError("Go(*widget.Entry)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -74323,28 +74086,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//multi-line!: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//multi-line!: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//multi-line!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//multi-line!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//multi-line!: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//multi-line!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.MultiLine = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//multi-line!: arg 2: expected integer") + return env.NewError("Go(*widget.Entry)//multi-line!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.MultiLine = newVal return arg0 }, }, @@ -74355,21 +74120,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//multi-line?: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//multi-line?: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//multi-line?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//multi-line?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//multi-line?: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//multi-line?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.MultiLine)) @@ -74383,45 +74148,47 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//on-changed!: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//on-changed!: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//on-changed!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//on-changed!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//on-changed!: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//on-changed!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(string) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//on-changed!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*widget.Entry)//on-changed!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnChanged = func(arg0 string) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + newVal = func(farg0 string) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//on-changed!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//on-changed!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnChanged = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//on-changed!: arg 2: expected function or nil") + return env.NewError("Go(*widget.Entry)//on-changed!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnChanged = newVal return arg0 }, }, @@ -74432,24 +74199,34 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//on-changed?: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//on-changed?: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//on-changed?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//on-changed?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//on-changed?: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//on-changed?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnChanged, "Go(func(string))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val string + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Entry)//on-changed?: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) + } + self.OnChanged(arg0Val) + return nil + }, 1, false, false, "Returned func") return resObj }, }, @@ -74460,29 +74237,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//on-cursor-changed!: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//on-cursor-changed!: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//on-cursor-changed!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//on-cursor-changed!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//on-cursor-changed!: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//on-cursor-changed!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func() switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//on-cursor-changed!: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(*widget.Entry)//on-cursor-changed!: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnCursorChanged = func() { + newVal = func() { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, ps.Ctx) @@ -74490,13 +74268,14 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//on-cursor-changed!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//on-cursor-changed!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnCursorChanged = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//on-cursor-changed!: arg 2: expected function or nil") + return env.NewError("Go(*widget.Entry)//on-cursor-changed!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnCursorChanged = newVal return arg0 }, }, @@ -74507,24 +74286,27 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//on-cursor-changed?: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//on-cursor-changed?: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//on-cursor-changed?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//on-cursor-changed?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//on-cursor-changed?: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//on-cursor-changed?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnCursorChanged, "Go(func())") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + self.OnCursorChanged() + return nil + }, 0, false, false, "Returned func") return resObj }, }, @@ -74535,45 +74317,47 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//on-submitted!: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//on-submitted!: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//on-submitted!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//on-submitted!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//on-submitted!: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//on-submitted!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(string) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//on-submitted!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*widget.Entry)//on-submitted!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnSubmitted = func(arg0 string) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + newVal = func(farg0 string) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//on-submitted!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//on-submitted!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnSubmitted = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//on-submitted!: arg 2: expected function or nil") + return env.NewError("Go(*widget.Entry)//on-submitted!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnSubmitted = newVal return arg0 }, }, @@ -74584,24 +74368,34 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//on-submitted?: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//on-submitted?: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//on-submitted?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//on-submitted?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//on-submitted?: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//on-submitted?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnSubmitted, "Go(func(string))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val string + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Entry)//on-submitted?: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) + } + self.OnSubmitted(arg0Val) + return nil + }, 1, false, false, "Returned func") return resObj }, }, @@ -74612,28 +74406,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//password!: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//password!: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//password!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//password!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//password!: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//password!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Password = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//password!: arg 2: expected integer") + return env.NewError("Go(*widget.Entry)//password!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Password = newVal return arg0 }, }, @@ -74644,21 +74440,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//password?: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//password?: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//password?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//password?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//password?: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//password?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Password)) @@ -74672,28 +74468,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//place-holder!: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//place-holder!: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//place-holder!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//place-holder!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//place-holder!: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//place-holder!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.PlaceHolder = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//place-holder!: arg 2: expected string") + return env.NewError("Go(*widget.Entry)//place-holder!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.PlaceHolder = newVal return arg0 }, }, @@ -74704,21 +74502,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//place-holder?: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//place-holder?: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//place-holder?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//place-holder?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//place-holder?: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//place-holder?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.PlaceHolder) @@ -74732,21 +74530,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//position: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//position: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//position: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -74761,21 +74559,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//refresh: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//refresh: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -74788,123 +74586,37 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//resize: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//resize: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//resize: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//resize: arg 2: expected integer to be 0 or nil") - } - arg1Val = nil - default: - ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//resize: arg 2: expected native") - } - arg0Val.Resize(*arg1Val) - return arg0 - }, - }, - "Go(*widget.Entry)//scroll!": { - Doc: "Set *widget.Entry Scroll value", - Argsn: 2, - Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var self *widget.Entry - switch v := arg0.(type) { - case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//scroll!: arg 1: expected native of type *widget.Entry") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//scroll!: arg 1: expected integer to be 0 or nil") - } - self = nil - default: - ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//scroll!: arg 1: expected native") - } - { - nat, natOk := arg1.(env.Native) - var natValOk bool - var rOut, rIn reflect.Value - if natOk { - // HACK: self.Scroll, natValOk = internal_widget.ScrollDirection(u) - rOut = reflect.ValueOf(&self.Scroll).Elem() - rIn = reflect.ValueOf(nat.Value) - natValOk = rIn.CanConvert(rOut.Type()) - } - if natValOk { - rOut.Set(rIn.Convert(rOut.Type())) + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc } else { - var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) - } else { - ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//scroll!: arg 2: expected integer") - } - // HACK: self.Scroll = internal_widget.ScrollDirection(u) - rOut := reflect.ValueOf(&self.Scroll).Elem() - rIn := reflect.ValueOf(u) - rOut.Set(rIn.Convert(rOut.Type())) - } - } - return arg0 - }, - }, - "Go(*widget.Entry)//scroll?": { - Doc: "Get *widget.Entry Scroll value", - Argsn: 1, - Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var self *widget.Entry - switch v := arg0.(type) { - case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//scroll?: arg 1: expected native of type *widget.Entry") - } - case env.Integer: - if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//scroll?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//scroll?: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var resObj env.Object - resObj = *env.NewInteger(int64(int(self.Scroll))) - return resObj + arg0Val.Resize(arg1Val) + return arg0 }, }, "Go(*widget.Entry)//selected-text": { @@ -74914,21 +74626,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//selected-text: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//selected-text: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//selected-text: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//selected-text: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//selected-text: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//selected-text: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.SelectedText() var res0Obj env.Object @@ -74943,28 +74655,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//set-min-rows-visible: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//set-min-rows-visible: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//set-min-rows-visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//set-min-rows-visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//set-min-rows-visible: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//set-min-rows-visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//set-min-rows-visible: arg 2: expected integer") + return env.NewError("Go(*widget.Entry)//set-min-rows-visible: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetMinRowsVisible(arg1Val) return arg0 @@ -74977,47 +74689,47 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//set-on-validation-changed: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//set-on-validation-changed: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//set-on-validation-changed: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//set-on-validation-changed: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//set-on-validation-changed: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//set-on-validation-changed: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func(error) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//set-on-validation-changed: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*widget.Entry)//set-on-validation-changed: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg1Val = func(arg0 error) { - var arg0Val env.Object - if arg0 != nil { - arg0Val = env.NewError(arg0.Error()) + arg1Val = func(farg0 error) { + var farg0Val env.Object + if farg0 != nil { + farg0Val = env.NewError(farg0.Error()) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//set-on-validation-changed: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//set-on-validation-changed: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//set-on-validation-changed: arg 2: expected function or nil") + return env.NewError("Go(*widget.Entry)//set-on-validation-changed: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } arg0Val.SetOnValidationChanged(arg1Val) return arg0 @@ -75030,28 +74742,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//set-place-holder: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//set-place-holder: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//set-place-holder: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//set-place-holder: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//set-place-holder: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//set-place-holder: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//set-place-holder: arg 2: expected string") + return env.NewError("Go(*widget.Entry)//set-place-holder: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetPlaceHolder(arg1Val) return arg0 @@ -75064,28 +74776,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//set-text: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//set-text: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//set-text: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//set-text: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//set-text: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//set-text: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//set-text: arg 2: expected string") + return env.NewError("Go(*widget.Entry)//set-text: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetText(arg1Val) return arg0 @@ -75098,21 +74810,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//set-validation-error: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//set-validation-error: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//set-validation-error: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//set-validation-error: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//set-validation-error: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//set-validation-error: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val error switch v := arg1.(type) { @@ -75123,12 +74835,12 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//set-validation-error: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//set-validation-error: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//set-validation-error: arg 2: expected error, string or nil") + return env.NewError("Go(*widget.Entry)//set-validation-error: arg 2: " + "expected error, string or nil, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetValidationError(arg1Val) return arg0 @@ -75141,21 +74853,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//show: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//show: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//show: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -75168,21 +74880,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//size: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//size: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//size: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -75197,40 +74909,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//tapped: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//tapped: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//tapped: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//tapped: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//tapped: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//tapped: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.PointEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.PointEvent) - if !ok { + if vc, ok := v.Value.(*fyne.PointEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//tapped: arg 2: expected native of type *fyne.PointEvent") + return env.NewError("Go(*widget.Entry)//tapped: arg 2: " + "expected native of type *fyne.PointEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//tapped: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//tapped: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//tapped: arg 2: expected native") + return env.NewError("Go(*widget.Entry)//tapped: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Tapped(arg1Val) return arg0 @@ -75243,40 +74955,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//tapped-secondary: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//tapped-secondary: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//tapped-secondary: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//tapped-secondary: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//tapped-secondary: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//tapped-secondary: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.PointEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.PointEvent) - if !ok { + if vc, ok := v.Value.(*fyne.PointEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//tapped-secondary: arg 2: expected native of type *fyne.PointEvent") + return env.NewError("Go(*widget.Entry)//tapped-secondary: arg 2: " + "expected native of type *fyne.PointEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//tapped-secondary: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//tapped-secondary: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//tapped-secondary: arg 2: expected native") + return env.NewError("Go(*widget.Entry)//tapped-secondary: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TappedSecondary(arg1Val) return arg0 @@ -75289,28 +75001,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//text!: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//text!: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//text!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//text!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//text!: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//text!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.Text = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//text!: arg 2: expected string") + return env.NewError("Go(*widget.Entry)//text!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.Text = newVal return arg0 }, }, @@ -75321,34 +75035,42 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//text-style!: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//text-style!: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//text-style!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//text-style!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//text-style!: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//text-style!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal *fyne.TextStyle switch v := arg1.(type) { case env.Native: - var ok bool - self.TextStyle, ok = v.Value.(fyne.TextStyle) - if !ok { + if vc, ok := v.Value.(*fyne.TextStyle); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Entry)//text-style!: arg 2: " + "expected native of type *fyne.TextStyle, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//text-style!: arg 2: expected native of type fyne.TextStyle") + return env.NewError("Go(*widget.Entry)//text-style!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//text-style!: arg 2: expected native") + return env.NewError("Go(*widget.Entry)//text-style!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.TextStyle = *newVal return arg0 }, }, @@ -75359,21 +75081,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//text-style?: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//text-style?: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//text-style?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//text-style?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//text-style?: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//text-style?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, &self.TextStyle, "Go(*fyne.TextStyle)") @@ -75387,21 +75109,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//text?: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//text?: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//text?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//text?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//text?: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//text?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.Text) @@ -75415,40 +75137,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//touch-cancel: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//touch-cancel: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//touch-cancel: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//touch-cancel: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//touch-cancel: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//touch-cancel: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *mobile.TouchEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*mobile.TouchEvent) - if !ok { + if vc, ok := v.Value.(*mobile.TouchEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//touch-cancel: arg 2: expected native of type *mobile.TouchEvent") + return env.NewError("Go(*widget.Entry)//touch-cancel: arg 2: " + "expected native of type *mobile.TouchEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//touch-cancel: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//touch-cancel: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//touch-cancel: arg 2: expected native") + return env.NewError("Go(*widget.Entry)//touch-cancel: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TouchCancel(arg1Val) return arg0 @@ -75461,40 +75183,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//touch-down: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//touch-down: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//touch-down: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//touch-down: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//touch-down: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//touch-down: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *mobile.TouchEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*mobile.TouchEvent) - if !ok { + if vc, ok := v.Value.(*mobile.TouchEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//touch-down: arg 2: expected native of type *mobile.TouchEvent") + return env.NewError("Go(*widget.Entry)//touch-down: arg 2: " + "expected native of type *mobile.TouchEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//touch-down: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//touch-down: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//touch-down: arg 2: expected native") + return env.NewError("Go(*widget.Entry)//touch-down: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TouchDown(arg1Val) return arg0 @@ -75507,40 +75229,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//touch-up: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//touch-up: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//touch-up: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//touch-up: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//touch-up: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//touch-up: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *mobile.TouchEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*mobile.TouchEvent) - if !ok { + if vc, ok := v.Value.(*mobile.TouchEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//touch-up: arg 2: expected native of type *mobile.TouchEvent") + return env.NewError("Go(*widget.Entry)//touch-up: arg 2: " + "expected native of type *mobile.TouchEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//touch-up: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//touch-up: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//touch-up: arg 2: expected native") + return env.NewError("Go(*widget.Entry)//touch-up: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TouchUp(arg1Val) return arg0 @@ -75553,40 +75275,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//typed-key: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//typed-key: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//typed-key: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//typed-key: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//typed-key: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//typed-key: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.KeyEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.KeyEvent) - if !ok { + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//typed-key: arg 2: expected native of type *fyne.KeyEvent") + return env.NewError("Go(*widget.Entry)//typed-key: arg 2: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//typed-key: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//typed-key: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//typed-key: arg 2: expected native") + return env.NewError("Go(*widget.Entry)//typed-key: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedKey(arg1Val) return arg0 @@ -75599,34 +75321,34 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//typed-rune: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//typed-rune: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//typed-rune: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//typed-rune: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//typed-rune: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//typed-rune: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val rune switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//typed-rune: arg 2: expected native of type rune") + return env.NewError("Go(*widget.Entry)//typed-rune: arg 2: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//typed-rune: arg 2: expected native") + return env.NewError("Go(*widget.Entry)//typed-rune: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedRune(arg1Val) return arg0 @@ -75639,21 +75361,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//typed-shortcut: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//typed-shortcut: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//typed-shortcut: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//typed-shortcut: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//typed-shortcut: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//typed-shortcut: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Shortcut switch v := arg1.(type) { @@ -75662,24 +75384,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Shortcut(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//typed-shortcut: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Entry)//typed-shortcut: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Shortcut) - if !ok { + if vc, ok := v.Value.(fyne.Shortcut); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//typed-shortcut: arg 2: expected native of type fyne.Shortcut") + return env.NewError("Go(*widget.Entry)//typed-shortcut: arg 2: " + "expected native of type fyne.Shortcut, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//typed-shortcut: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//typed-shortcut: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//typed-shortcut: arg 2: expected native") + return env.NewError("Go(*widget.Entry)//typed-shortcut: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedShortcut(arg1Val) return arg0 @@ -75692,21 +75414,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//unbind: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//unbind: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//unbind: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//unbind: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//unbind: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//unbind: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Unbind() return arg0 @@ -75719,21 +75441,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//validate: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//validate: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//validate: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//validate: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//validate: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//validate: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Validate() var resErrObj env.Object @@ -75754,22 +75476,23 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//validator!: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//validator!: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//validator!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//validator!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//validator!: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//validator!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.StringValidator { nat, natOk := arg1.(env.Native) var natValOk bool @@ -75778,21 +75501,21 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(fyne.StringValidator) } if natValOk { - self.Validator = natVal + newVal = natVal } else { var u func(string) error switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//validator!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*widget.Entry)//validator!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - u = func(arg0 string) error { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + u = func(farg0 string) error { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -75801,8 +75524,9 @@ var Builtins = map[string]*env.Builtin{ res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.Entry)//validator!: arg 2: callback result: expected integer to be 0 or nil", + "Go(*widget.Entry)//validator!: arg 2: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -75810,8 +75534,9 @@ var Builtins = map[string]*env.Builtin{ } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.Entry)//validator!: arg 2: callback result: expected error, string or nil", + "Go(*widget.Entry)//validator!: arg 2: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -75822,16 +75547,17 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//validator!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//validator!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } u = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//validator!: arg 2: expected function or nil") + return env.NewError("Go(*widget.Entry)//validator!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } - self.Validator = fyne.StringValidator(u) + newVal = fyne.StringValidator(u) } } + self.Validator = newVal return arg0 }, }, @@ -75842,24 +75568,42 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//validator?: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//validator?: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//validator?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//validator?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//validator?: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//validator?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, (func(string) error)(self.Validator), "Go(func(string) (error))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val string + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Entry)//validator?: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) + } + resErr := (func(string) error)(self.Validator)(arg0Val) + var resErrObj env.Object + if resErr != nil { + resErrObj = env.NewError(resErr.Error()) + } + if resErrObj != nil { + ps.FailureFlag = true + return resErrObj + } + return nil + }, 1, false, false, "Returned func") return resObj }, }, @@ -75870,21 +75614,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//visible: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//visible: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//visible: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -75899,22 +75643,23 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//wrapping!: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//wrapping!: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//wrapping!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//wrapping!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//wrapping!: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//wrapping!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.TextWrap { nat, natOk := arg1.(env.Native) var natValOk bool @@ -75923,18 +75668,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(fyne.TextWrap) } if natValOk { - self.Wrapping = natVal + newVal = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//wrapping!: arg 2: expected integer") + return env.NewError("Go(*widget.Entry)//wrapping!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } - self.Wrapping = fyne.TextWrap(u) + newVal = fyne.TextWrap(u) } } + self.Wrapping = newVal return arg0 }, }, @@ -75945,27 +75691,101 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Entry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Entry) - if !ok { + if vc, ok := v.Value.(*widget.Entry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//wrapping?: arg 1: expected native of type *widget.Entry") + return env.NewError("Go(*widget.Entry)//wrapping?: arg 1: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//wrapping?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Entry)//wrapping?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Entry)//wrapping?: arg 1: expected native") + return env.NewError("Go(*widget.Entry)//wrapping?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(int(self.Wrapping))) return resObj }, }, + "Go(*widget.FileIcon)//base-widget!": { + Doc: "Set *widget.FileIcon BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.FileIcon + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.FileIcon); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.FileIcon)//base-widget!: arg 1: " + "expected native of type *widget.FileIcon, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.FileIcon)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.FileIcon)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.FileIcon)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.FileIcon)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.FileIcon)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*widget.FileIcon)//base-widget?": { + Doc: "Get *widget.FileIcon BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.FileIcon + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.FileIcon); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.FileIcon)//base-widget?: arg 1: " + "expected native of type *widget.FileIcon, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.FileIcon)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.FileIcon)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj + }, + }, "Go(*widget.FileIcon)//create-renderer": { Doc: "(*widget.FileIcon).CreateRenderer", Argsn: 1, @@ -75973,42 +75793,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.FileIcon switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.FileIcon) - if !ok { + if vc, ok := v.Value.(*widget.FileIcon); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//create-renderer: arg 1: expected native of type *widget.FileIcon") + return env.NewError("Go(*widget.FileIcon)//create-renderer: arg 1: " + "expected native of type *widget.FileIcon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FileIcon)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//create-renderer: arg 1: expected native") + return env.NewError("Go(*widget.FileIcon)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -76019,21 +75822,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.FileIcon switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.FileIcon) - if !ok { + if vc, ok := v.Value.(*widget.FileIcon); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//extend-base-widget: arg 1: expected native of type *widget.FileIcon") + return env.NewError("Go(*widget.FileIcon)//extend-base-widget: arg 1: " + "expected native of type *widget.FileIcon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FileIcon)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.FileIcon)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -76042,24 +75845,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.FileIcon)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.FileIcon)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FileIcon)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.FileIcon)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -76072,28 +75875,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.FileIcon switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.FileIcon) - if !ok { + if vc, ok := v.Value.(*widget.FileIcon); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//hidden!: arg 1: expected native of type *widget.FileIcon") + return env.NewError("Go(*widget.FileIcon)//hidden!: arg 1: " + "expected native of type *widget.FileIcon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FileIcon)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.FileIcon)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.FileIcon)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -76104,21 +75909,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.FileIcon switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.FileIcon) - if !ok { + if vc, ok := v.Value.(*widget.FileIcon); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//hidden?: arg 1: expected native of type *widget.FileIcon") + return env.NewError("Go(*widget.FileIcon)//hidden?: arg 1: " + "expected native of type *widget.FileIcon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FileIcon)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.FileIcon)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -76132,21 +75937,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.FileIcon switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.FileIcon) - if !ok { + if vc, ok := v.Value.(*widget.FileIcon); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//hide: arg 1: expected native of type *widget.FileIcon") + return env.NewError("Go(*widget.FileIcon)//hide: arg 1: " + "expected native of type *widget.FileIcon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FileIcon)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//hide: arg 1: expected native") + return env.NewError("Go(*widget.FileIcon)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -76159,21 +75964,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.FileIcon switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.FileIcon) - if !ok { + if vc, ok := v.Value.(*widget.FileIcon); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//min-size: arg 1: expected native of type *widget.FileIcon") + return env.NewError("Go(*widget.FileIcon)//min-size: arg 1: " + "expected native of type *widget.FileIcon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FileIcon)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.FileIcon)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -76188,42 +75993,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.FileIcon switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.FileIcon) - if !ok { + if vc, ok := v.Value.(*widget.FileIcon); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//move: arg 1: expected native of type *widget.FileIcon") + return env.NewError("Go(*widget.FileIcon)//move: arg 1: " + "expected native of type *widget.FileIcon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FileIcon)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//move: arg 1: expected native") + return env.NewError("Go(*widget.FileIcon)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FileIcon)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//move: arg 2: expected native") + return env.NewError("Go(*widget.FileIcon)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -76234,21 +76033,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.FileIcon switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.FileIcon) - if !ok { + if vc, ok := v.Value.(*widget.FileIcon); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//position: arg 1: expected native of type *widget.FileIcon") + return env.NewError("Go(*widget.FileIcon)//position: arg 1: " + "expected native of type *widget.FileIcon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FileIcon)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//position: arg 1: expected native") + return env.NewError("Go(*widget.FileIcon)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -76263,21 +76062,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.FileIcon switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.FileIcon) - if !ok { + if vc, ok := v.Value.(*widget.FileIcon); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//refresh: arg 1: expected native of type *widget.FileIcon") + return env.NewError("Go(*widget.FileIcon)//refresh: arg 1: " + "expected native of type *widget.FileIcon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FileIcon)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.FileIcon)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -76290,42 +76089,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.FileIcon switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.FileIcon) - if !ok { + if vc, ok := v.Value.(*widget.FileIcon); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//resize: arg 1: expected native of type *widget.FileIcon") + return env.NewError("Go(*widget.FileIcon)//resize: arg 1: " + "expected native of type *widget.FileIcon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FileIcon)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//resize: arg 1: expected native") + return env.NewError("Go(*widget.FileIcon)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FileIcon)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//resize: arg 2: expected native") + return env.NewError("Go(*widget.FileIcon)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -76336,28 +76129,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.FileIcon switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.FileIcon) - if !ok { + if vc, ok := v.Value.(*widget.FileIcon); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//selected!: arg 1: expected native of type *widget.FileIcon") + return env.NewError("Go(*widget.FileIcon)//selected!: arg 1: " + "expected native of type *widget.FileIcon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//selected!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FileIcon)//selected!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//selected!: arg 1: expected native") + return env.NewError("Go(*widget.FileIcon)//selected!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Selected = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//selected!: arg 2: expected integer") + return env.NewError("Go(*widget.FileIcon)//selected!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Selected = newVal return arg0 }, }, @@ -76368,21 +76163,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.FileIcon switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.FileIcon) - if !ok { + if vc, ok := v.Value.(*widget.FileIcon); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//selected?: arg 1: expected native of type *widget.FileIcon") + return env.NewError("Go(*widget.FileIcon)//selected?: arg 1: " + "expected native of type *widget.FileIcon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//selected?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FileIcon)//selected?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//selected?: arg 1: expected native") + return env.NewError("Go(*widget.FileIcon)//selected?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Selected)) @@ -76396,28 +76191,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.FileIcon switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.FileIcon) - if !ok { + if vc, ok := v.Value.(*widget.FileIcon); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//set-selected: arg 1: expected native of type *widget.FileIcon") + return env.NewError("Go(*widget.FileIcon)//set-selected: arg 1: " + "expected native of type *widget.FileIcon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//set-selected: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FileIcon)//set-selected: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//set-selected: arg 1: expected native") + return env.NewError("Go(*widget.FileIcon)//set-selected: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val bool - if v, ok := arg1.(env.Integer); ok { - arg1Val = v.Value != 0 + if vc, ok := arg1.(env.Integer); ok { + arg1Val = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//set-selected: arg 2: expected integer") + return env.NewError("Go(*widget.FileIcon)//set-selected: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetSelected(arg1Val) return arg0 @@ -76430,21 +76225,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.FileIcon switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.FileIcon) - if !ok { + if vc, ok := v.Value.(*widget.FileIcon); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//set-uri: arg 1: expected native of type *widget.FileIcon") + return env.NewError("Go(*widget.FileIcon)//set-uri: arg 1: " + "expected native of type *widget.FileIcon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//set-uri: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FileIcon)//set-uri: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//set-uri: arg 1: expected native") + return env.NewError("Go(*widget.FileIcon)//set-uri: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -76453,24 +76248,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//set-uri: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.FileIcon)//set-uri: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//set-uri: arg 2: expected native of type fyne.URI") + return env.NewError("Go(*widget.FileIcon)//set-uri: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//set-uri: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FileIcon)//set-uri: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//set-uri: arg 2: expected native") + return env.NewError("Go(*widget.FileIcon)//set-uri: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetURI(arg1Val) return arg0 @@ -76483,21 +76278,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.FileIcon switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.FileIcon) - if !ok { + if vc, ok := v.Value.(*widget.FileIcon); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//show: arg 1: expected native of type *widget.FileIcon") + return env.NewError("Go(*widget.FileIcon)//show: arg 1: " + "expected native of type *widget.FileIcon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FileIcon)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//show: arg 1: expected native") + return env.NewError("Go(*widget.FileIcon)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -76510,21 +76305,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.FileIcon switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.FileIcon) - if !ok { + if vc, ok := v.Value.(*widget.FileIcon); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//size: arg 1: expected native of type *widget.FileIcon") + return env.NewError("Go(*widget.FileIcon)//size: arg 1: " + "expected native of type *widget.FileIcon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FileIcon)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//size: arg 1: expected native") + return env.NewError("Go(*widget.FileIcon)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -76539,47 +76334,49 @@ var Builtins = map[string]*env.Builtin{ var self *widget.FileIcon switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.FileIcon) - if !ok { + if vc, ok := v.Value.(*widget.FileIcon); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//uri!: arg 1: expected native of type *widget.FileIcon") + return env.NewError("Go(*widget.FileIcon)//uri!: arg 1: " + "expected native of type *widget.FileIcon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//uri!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FileIcon)//uri!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//uri!: arg 1: expected native") + return env.NewError("Go(*widget.FileIcon)//uri!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.URI switch v := arg1.(type) { case env.RyeCtx: var err error - self.URI, err = ctxTo_fyne_URI(ps, v) + newVal, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//uri!: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.FileIcon)//uri!: arg 2: " + err.Error()) } case env.Native: - var ok bool - self.URI, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//uri!: arg 2: expected native of type fyne.URI") + return env.NewError("Go(*widget.FileIcon)//uri!: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//uri!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FileIcon)//uri!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.URI = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//uri!: arg 2: expected native") + return env.NewError("Go(*widget.FileIcon)//uri!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.URI = newVal return arg0 }, }, @@ -76590,41 +76387,24 @@ var Builtins = map[string]*env.Builtin{ var self *widget.FileIcon switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.FileIcon) - if !ok { + if vc, ok := v.Value.(*widget.FileIcon); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//uri?: arg 1: expected native of type *widget.FileIcon") + return env.NewError("Go(*widget.FileIcon)//uri?: arg 1: " + "expected native of type *widget.FileIcon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//uri?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FileIcon)//uri?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//uri?: arg 1: expected native") + return env.NewError("Go(*widget.FileIcon)//uri?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - { - typ := reflect.TypeOf(self.URI) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - resObj = *env.NewNative(ps.Idx, self.URI, typRyeName) - } else { - resObj = *env.NewNative(ps.Idx, self.URI, "Go(fyne.URI)") - } - } + resObj = ifaceToNative(ps.Idx, self.URI, "Go(fyne.URI)") return resObj }, }, @@ -76635,21 +76415,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.FileIcon switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.FileIcon) - if !ok { + if vc, ok := v.Value.(*widget.FileIcon); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//visible: arg 1: expected native of type *widget.FileIcon") + return env.NewError("Go(*widget.FileIcon)//visible: arg 1: " + "expected native of type *widget.FileIcon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FileIcon)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FileIcon)//visible: arg 1: expected native") + return env.NewError("Go(*widget.FileIcon)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -76664,28 +76444,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//append: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//append: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//append: arg 1: expected native") + return env.NewError("Go(*widget.Form)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//append: arg 2: expected string") + return env.NewError("Go(*widget.Form)//append: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val fyne.CanvasObject switch v := arg2.(type) { @@ -76694,24 +76474,24 @@ var Builtins = map[string]*env.Builtin{ arg2Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//append: arg 3: " + err.Error() + "") + return env.NewError("Go(*widget.Form)//append: arg 3: " + err.Error()) } case env.Native: - var ok bool - arg2Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//append: arg 3: expected native of type fyne.CanvasObject") + return env.NewError("Go(*widget.Form)//append: arg 3: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//append: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//append: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//append: arg 3: expected native") + return env.NewError("Go(*widget.Form)//append: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Append(arg1Val, arg2Val) return arg0 @@ -76724,45 +76504,119 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//append-item: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//append-item: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//append-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//append-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//append-item: arg 1: expected native") + return env.NewError("Go(*widget.Form)//append-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *widget.FormItem switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*widget.FormItem) - if !ok { + if vc, ok := v.Value.(*widget.FormItem); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//append-item: arg 2: expected native of type *widget.FormItem") + return env.NewError("Go(*widget.Form)//append-item: arg 2: " + "expected native of type *widget.FormItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//append-item: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//append-item: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//append-item: arg 2: expected native") + return env.NewError("Go(*widget.Form)//append-item: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AppendItem(arg1Val) return arg0 }, }, + "Go(*widget.Form)//base-widget!": { + Doc: "Set *widget.Form BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Form + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Form); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Form)//base-widget!: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Form)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Form)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Form)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Form)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Form)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*widget.Form)//base-widget?": { + Doc: "Get *widget.Form BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Form + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Form); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Form)//base-widget?: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Form)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Form)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj + }, + }, "Go(*widget.Form)//cancel-text!": { Doc: "Set *widget.Form CancelText value", Argsn: 2, @@ -76770,28 +76624,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//cancel-text!: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//cancel-text!: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//cancel-text!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//cancel-text!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//cancel-text!: arg 1: expected native") + return env.NewError("Go(*widget.Form)//cancel-text!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.CancelText = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//cancel-text!: arg 2: expected string") + return env.NewError("Go(*widget.Form)//cancel-text!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.CancelText = newVal return arg0 }, }, @@ -76802,21 +76658,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//cancel-text?: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//cancel-text?: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//cancel-text?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//cancel-text?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//cancel-text?: arg 1: expected native") + return env.NewError("Go(*widget.Form)//cancel-text?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.CancelText) @@ -76830,42 +76686,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//create-renderer: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//create-renderer: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//create-renderer: arg 1: expected native") + return env.NewError("Go(*widget.Form)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -76876,21 +76715,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//disable: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//disable: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//disable: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//disable: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//disable: arg 1: expected native") + return env.NewError("Go(*widget.Form)//disable: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Disable() return arg0 @@ -76903,21 +76742,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//disabled: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//disabled: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//disabled: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//disabled: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//disabled: arg 1: expected native") + return env.NewError("Go(*widget.Form)//disabled: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Disabled() var res0Obj env.Object @@ -76932,21 +76771,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//enable: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//enable: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//enable: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//enable: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//enable: arg 1: expected native") + return env.NewError("Go(*widget.Form)//enable: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Enable() return arg0 @@ -76959,21 +76798,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//extend-base-widget: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//extend-base-widget: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.Form)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -76982,24 +76821,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Form)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.Form)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.Form)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -77012,28 +76851,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//hidden!: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//hidden!: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.Form)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.Form)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -77044,21 +76885,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//hidden?: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//hidden?: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.Form)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -77072,21 +76913,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//hide: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//hide: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//hide: arg 1: expected native") + return env.NewError("Go(*widget.Form)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -77099,62 +76940,57 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//items!: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//items!: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//items!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//items!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//items!: arg 1: expected native") + return env.NewError("Go(*widget.Form)//items!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal []*widget.FormItem switch v := arg1.(type) { case env.Block: - self.Items = make([]*widget.FormItem, len(v.Series.S)) + newVal = make([]*widget.FormItem, len(v.Series.S)) for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - self.Items[i], ok = v.Value.(*widget.FormItem) - if !ok { + if vc, ok := v.Value.(*widget.FormItem); ok { + newVal[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//items!: arg 2: block item: expected native of type *widget.FormItem") + return env.NewError("Go(*widget.Form)//items!: arg 2: " + "block item: " + "expected native of type *widget.FormItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//items!: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//items!: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Items[i] = nil + newVal[i] = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//items!: arg 2: block item: expected native") + return env.NewError("Go(*widget.Form)//items!: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - self.Items, ok = v.Value.([]*widget.FormItem) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//items!: arg 2: expected native of type []*widget.FormItem") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//items!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//items!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Items = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//items!: arg 2: expected block, native or nil") + return env.NewError("Go(*widget.Form)//items!: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } + self.Items = newVal return arg0 }, }, @@ -77165,21 +77001,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//items?: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//items?: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//items?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//items?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//items?: arg 1: expected native") + return env.NewError("Go(*widget.Form)//items?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object { @@ -77199,21 +77035,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//min-size: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//min-size: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.Form)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -77228,42 +77064,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//move: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//move: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//move: arg 1: expected native") + return env.NewError("Go(*widget.Form)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//move: arg 2: expected native") + return env.NewError("Go(*widget.Form)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -77274,29 +77104,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//on-cancel!: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//on-cancel!: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//on-cancel!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//on-cancel!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//on-cancel!: arg 1: expected native") + return env.NewError("Go(*widget.Form)//on-cancel!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func() switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//on-cancel!: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(*widget.Form)//on-cancel!: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnCancel = func() { + newVal = func() { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, ps.Ctx) @@ -77304,13 +77135,14 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//on-cancel!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//on-cancel!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnCancel = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//on-cancel!: arg 2: expected function or nil") + return env.NewError("Go(*widget.Form)//on-cancel!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnCancel = newVal return arg0 }, }, @@ -77321,24 +77153,27 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//on-cancel?: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//on-cancel?: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//on-cancel?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//on-cancel?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//on-cancel?: arg 1: expected native") + return env.NewError("Go(*widget.Form)//on-cancel?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnCancel, "Go(func())") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + self.OnCancel() + return nil + }, 0, false, false, "Returned func") return resObj }, }, @@ -77349,29 +77184,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//on-submit!: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//on-submit!: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//on-submit!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//on-submit!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//on-submit!: arg 1: expected native") + return env.NewError("Go(*widget.Form)//on-submit!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func() switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//on-submit!: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(*widget.Form)//on-submit!: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnSubmit = func() { + newVal = func() { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, ps.Ctx) @@ -77379,13 +77215,14 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//on-submit!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//on-submit!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnSubmit = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//on-submit!: arg 2: expected function or nil") + return env.NewError("Go(*widget.Form)//on-submit!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnSubmit = newVal return arg0 }, }, @@ -77396,24 +77233,27 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//on-submit?: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//on-submit?: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//on-submit?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//on-submit?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//on-submit?: arg 1: expected native") + return env.NewError("Go(*widget.Form)//on-submit?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnSubmit, "Go(func())") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + self.OnSubmit() + return nil + }, 0, false, false, "Returned func") return resObj }, }, @@ -77424,21 +77264,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//position: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//position: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//position: arg 1: expected native") + return env.NewError("Go(*widget.Form)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -77453,21 +77293,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//refresh: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//refresh: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.Form)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -77480,42 +77320,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//resize: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//resize: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//resize: arg 1: expected native") + return env.NewError("Go(*widget.Form)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//resize: arg 2: expected native") + return env.NewError("Go(*widget.Form)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -77526,47 +77360,47 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//set-on-validation-changed: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//set-on-validation-changed: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//set-on-validation-changed: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//set-on-validation-changed: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//set-on-validation-changed: arg 1: expected native") + return env.NewError("Go(*widget.Form)//set-on-validation-changed: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func(error) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//set-on-validation-changed: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*widget.Form)//set-on-validation-changed: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg1Val = func(arg0 error) { - var arg0Val env.Object - if arg0 != nil { - arg0Val = env.NewError(arg0.Error()) + arg1Val = func(farg0 error) { + var farg0Val env.Object + if farg0 != nil { + farg0Val = env.NewError(farg0.Error()) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//set-on-validation-changed: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//set-on-validation-changed: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//set-on-validation-changed: arg 2: expected function or nil") + return env.NewError("Go(*widget.Form)//set-on-validation-changed: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } arg0Val.SetOnValidationChanged(arg1Val) return arg0 @@ -77579,21 +77413,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//show: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//show: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//show: arg 1: expected native") + return env.NewError("Go(*widget.Form)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -77606,21 +77440,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//size: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//size: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//size: arg 1: expected native") + return env.NewError("Go(*widget.Form)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -77635,28 +77469,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//submit-text!: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//submit-text!: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//submit-text!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//submit-text!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//submit-text!: arg 1: expected native") + return env.NewError("Go(*widget.Form)//submit-text!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.SubmitText = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//submit-text!: arg 2: expected string") + return env.NewError("Go(*widget.Form)//submit-text!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.SubmitText = newVal return arg0 }, }, @@ -77667,21 +77503,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//submit-text?: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//submit-text?: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//submit-text?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//submit-text?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//submit-text?: arg 1: expected native") + return env.NewError("Go(*widget.Form)//submit-text?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.SubmitText) @@ -77695,21 +77531,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//validate: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//validate: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//validate: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//validate: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//validate: arg 1: expected native") + return env.NewError("Go(*widget.Form)//validate: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Validate() var resErrObj env.Object @@ -77730,21 +77566,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Form switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Form) - if !ok { + if vc, ok := v.Value.(*widget.Form); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//visible: arg 1: expected native of type *widget.Form") + return env.NewError("Go(*widget.Form)//visible: arg 1: " + "expected native of type *widget.Form, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Form)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Form)//visible: arg 1: expected native") + return env.NewError("Go(*widget.Form)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -77759,28 +77595,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.FormItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.FormItem) - if !ok { + if vc, ok := v.Value.(*widget.FormItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FormItem)//hint-text!: arg 1: expected native of type *widget.FormItem") + return env.NewError("Go(*widget.FormItem)//hint-text!: arg 1: " + "expected native of type *widget.FormItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.FormItem)//hint-text!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FormItem)//hint-text!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FormItem)//hint-text!: arg 1: expected native") + return env.NewError("Go(*widget.FormItem)//hint-text!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.HintText = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FormItem)//hint-text!: arg 2: expected string") + return env.NewError("Go(*widget.FormItem)//hint-text!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.HintText = newVal return arg0 }, }, @@ -77791,21 +77629,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.FormItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.FormItem) - if !ok { + if vc, ok := v.Value.(*widget.FormItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FormItem)//hint-text?: arg 1: expected native of type *widget.FormItem") + return env.NewError("Go(*widget.FormItem)//hint-text?: arg 1: " + "expected native of type *widget.FormItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.FormItem)//hint-text?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FormItem)//hint-text?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FormItem)//hint-text?: arg 1: expected native") + return env.NewError("Go(*widget.FormItem)//hint-text?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.HintText) @@ -77819,28 +77657,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.FormItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.FormItem) - if !ok { + if vc, ok := v.Value.(*widget.FormItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FormItem)//text!: arg 1: expected native of type *widget.FormItem") + return env.NewError("Go(*widget.FormItem)//text!: arg 1: " + "expected native of type *widget.FormItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.FormItem)//text!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FormItem)//text!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FormItem)//text!: arg 1: expected native") + return env.NewError("Go(*widget.FormItem)//text!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.Text = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FormItem)//text!: arg 2: expected string") + return env.NewError("Go(*widget.FormItem)//text!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.Text = newVal return arg0 }, }, @@ -77851,21 +77691,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.FormItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.FormItem) - if !ok { + if vc, ok := v.Value.(*widget.FormItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FormItem)//text?: arg 1: expected native of type *widget.FormItem") + return env.NewError("Go(*widget.FormItem)//text?: arg 1: " + "expected native of type *widget.FormItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.FormItem)//text?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FormItem)//text?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FormItem)//text?: arg 1: expected native") + return env.NewError("Go(*widget.FormItem)//text?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.Text) @@ -77879,47 +77719,49 @@ var Builtins = map[string]*env.Builtin{ var self *widget.FormItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.FormItem) - if !ok { + if vc, ok := v.Value.(*widget.FormItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FormItem)//widget!: arg 1: expected native of type *widget.FormItem") + return env.NewError("Go(*widget.FormItem)//widget!: arg 1: " + "expected native of type *widget.FormItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.FormItem)//widget!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FormItem)//widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FormItem)//widget!: arg 1: expected native") + return env.NewError("Go(*widget.FormItem)//widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.CanvasObject switch v := arg1.(type) { case env.RyeCtx: var err error - self.Widget, err = ctxTo_fyne_CanvasObject(ps, v) + newVal, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.FormItem)//widget!: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.FormItem)//widget!: arg 2: " + err.Error()) } case env.Native: - var ok bool - self.Widget, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FormItem)//widget!: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("Go(*widget.FormItem)//widget!: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.FormItem)//widget!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FormItem)//widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Widget = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FormItem)//widget!: arg 2: expected native") + return env.NewError("Go(*widget.FormItem)//widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Widget = newVal return arg0 }, }, @@ -77930,41 +77772,98 @@ var Builtins = map[string]*env.Builtin{ var self *widget.FormItem switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.FormItem) - if !ok { + if vc, ok := v.Value.(*widget.FormItem); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.FormItem)//widget?: arg 1: expected native of type *widget.FormItem") + return env.NewError("Go(*widget.FormItem)//widget?: arg 1: " + "expected native of type *widget.FormItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.FormItem)//widget?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.FormItem)//widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.FormItem)//widget?: arg 1: expected native") + return env.NewError("Go(*widget.FormItem)//widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - { - typ := reflect.TypeOf(self.Widget) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] + resObj = ifaceToNative(ps.Idx, self.Widget, "Go(fyne.CanvasObject)") + return resObj + }, + }, + "Go(*widget.GridWrap)//base-widget!": { + Doc: "Set *widget.GridWrap BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.GridWrap + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.GridWrap); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.GridWrap)//base-widget!: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } - if ok { - resObj = *env.NewNative(ps.Idx, self.Widget, typRyeName) + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.GridWrap)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.GridWrap)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.GridWrap)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.GridWrap)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.GridWrap)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*widget.GridWrap)//base-widget?": { + Doc: "Get *widget.GridWrap BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.GridWrap + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.GridWrap); ok { + self = vc } else { - resObj = *env.NewNative(ps.Idx, self.Widget, "Go(fyne.CanvasObject)") + ps.FailureFlag = true + return env.NewError("Go(*widget.GridWrap)//base-widget?: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.GridWrap)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.GridWrap)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") return resObj }, }, @@ -77975,29 +77874,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//create-item!: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//create-item!: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//create-item!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//create-item!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//create-item!: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//create-item!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func() fyne.CanvasObject switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//create-item!: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(*widget.GridWrap)//create-item!: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.CreateItem = func() fyne.CanvasObject { + newVal = func() fyne.CanvasObject { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, ps.Ctx) @@ -78007,19 +77907,21 @@ var Builtins = map[string]*env.Builtin{ var err error res, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.GridWrap)//create-item!: arg 2: callback result: "+err.Error()+"", + "Go(*widget.GridWrap)//create-item!: arg 2: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.GridWrap)//create-item!: arg 2: callback result: expected native of type fyne.CanvasObject", + "Go(*widget.GridWrap)//create-item!: arg 2: callback result: "+"expected native of type fyne.CanvasObject, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -78027,8 +77929,9 @@ var Builtins = map[string]*env.Builtin{ } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.GridWrap)//create-item!: arg 2: callback result: expected integer to be 0 or nil", + "Go(*widget.GridWrap)//create-item!: arg 2: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -78036,8 +77939,9 @@ var Builtins = map[string]*env.Builtin{ } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.GridWrap)//create-item!: arg 2: callback result: expected native", + "Go(*widget.GridWrap)//create-item!: arg 2: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -78048,13 +77952,14 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//create-item!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//create-item!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.CreateItem = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//create-item!: arg 2: expected function or nil") + return env.NewError("Go(*widget.GridWrap)//create-item!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.CreateItem = newVal return arg0 }, }, @@ -78065,24 +77970,29 @@ var Builtins = map[string]*env.Builtin{ var self *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//create-item?: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//create-item?: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//create-item?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//create-item?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//create-item?: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//create-item?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.CreateItem, "Go(func() (fyne.CanvasObject))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + res0 := self.CreateItem() + var res0Obj env.Object + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.CanvasObject)") + return res0Obj + }, 0, false, false, "Returned func") return resObj }, }, @@ -78093,42 +78003,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//create-renderer: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//create-renderer: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//create-renderer: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -78139,21 +78032,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//extend-base-widget: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//extend-base-widget: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -78162,24 +78055,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.GridWrap)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.GridWrap)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.GridWrap)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -78192,21 +78085,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//focus-gained: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//focus-gained: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//focus-gained: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//focus-gained: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//focus-gained: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//focus-gained: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusGained() return arg0 @@ -78219,21 +78112,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//focus-lost: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//focus-lost: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//focus-lost: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//focus-lost: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//focus-lost: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//focus-lost: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusLost() return arg0 @@ -78246,21 +78139,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//get-scroll-offset: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//get-scroll-offset: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//get-scroll-offset: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//get-scroll-offset: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//get-scroll-offset: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//get-scroll-offset: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.GetScrollOffset() var res0Obj env.Object @@ -78275,28 +78168,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//hidden!: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//hidden!: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.GridWrap)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -78307,21 +78202,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//hidden?: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//hidden?: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -78335,21 +78230,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//hide: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//hide: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//hide: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -78362,38 +78257,40 @@ var Builtins = map[string]*env.Builtin{ var self *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//length!: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//length!: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//length!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//length!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//length!: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//length!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func() int switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//length!: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(*widget.GridWrap)//length!: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.Length = func() int { + newVal = func() int { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, ps.Ctx) var res int - if v, ok := ps.Res.(env.Integer); ok { - res = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + res = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.GridWrap)//length!: arg 2: callback result: expected integer", + "Go(*widget.GridWrap)//length!: arg 2: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -78404,13 +78301,14 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//length!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//length!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.Length = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//length!: arg 2: expected function or nil") + return env.NewError("Go(*widget.GridWrap)//length!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.Length = newVal return arg0 }, }, @@ -78421,24 +78319,29 @@ var Builtins = map[string]*env.Builtin{ var self *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//length?: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//length?: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//length?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//length?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//length?: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//length?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.Length, "Go(func() (int))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + res0 := self.Length() + var res0Obj env.Object + res0Obj = *env.NewInteger(int64(res0)) + return res0Obj + }, 0, false, false, "Returned func") return resObj }, }, @@ -78449,21 +78352,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//min-size: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//min-size: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -78478,42 +78381,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//move: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//move: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//move: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//move: arg 2: expected native") + return env.NewError("Go(*widget.GridWrap)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -78524,45 +78421,47 @@ var Builtins = map[string]*env.Builtin{ var self *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//on-selected!: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//on-selected!: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//on-selected!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//on-selected!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//on-selected!: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//on-selected!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(widget.GridWrapItemID) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//on-selected!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*widget.GridWrap)//on-selected!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnSelected = func(arg0 widget.GridWrapItemID) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(int(arg0))) + newVal = func(farg0 widget.GridWrapItemID) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(int(farg0))) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//on-selected!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//on-selected!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnSelected = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//on-selected!: arg 2: expected function or nil") + return env.NewError("Go(*widget.GridWrap)//on-selected!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnSelected = newVal return arg0 }, }, @@ -78573,24 +78472,48 @@ var Builtins = map[string]*env.Builtin{ var self *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//on-selected?: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//on-selected?: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//on-selected?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//on-selected?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//on-selected?: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//on-selected?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnSelected, "Go(func(widget.GridWrapItemID))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val widget.GridWrapItemID + { + nat, natOk := arg0.(env.Native) + var natValOk bool + var natVal widget.GridWrapItemID + if natOk { + natVal, natValOk = nat.Value.(widget.GridWrapItemID) + } + if natValOk { + arg0Val = natVal + } else { + var u int + if vc, ok := arg0.(env.Integer); ok { + u = int(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.GridWrap)//on-selected?: arg 1: " + "expected integer, but got " + objectDebugString(ps.Idx, arg0)) + } + arg0Val = widget.GridWrapItemID(u) + } + } + self.OnSelected(arg0Val) + return nil + }, 1, false, false, "Returned func") return resObj }, }, @@ -78601,45 +78524,47 @@ var Builtins = map[string]*env.Builtin{ var self *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//on-unselected!: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//on-unselected!: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//on-unselected!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//on-unselected!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//on-unselected!: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//on-unselected!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(widget.GridWrapItemID) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//on-unselected!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*widget.GridWrap)//on-unselected!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnUnselected = func(arg0 widget.GridWrapItemID) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(int(arg0))) + newVal = func(farg0 widget.GridWrapItemID) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(int(farg0))) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//on-unselected!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//on-unselected!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnUnselected = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//on-unselected!: arg 2: expected function or nil") + return env.NewError("Go(*widget.GridWrap)//on-unselected!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnUnselected = newVal return arg0 }, }, @@ -78650,24 +78575,48 @@ var Builtins = map[string]*env.Builtin{ var self *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//on-unselected?: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//on-unselected?: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//on-unselected?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//on-unselected?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//on-unselected?: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//on-unselected?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnUnselected, "Go(func(widget.GridWrapItemID))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val widget.GridWrapItemID + { + nat, natOk := arg0.(env.Native) + var natValOk bool + var natVal widget.GridWrapItemID + if natOk { + natVal, natValOk = nat.Value.(widget.GridWrapItemID) + } + if natValOk { + arg0Val = natVal + } else { + var u int + if vc, ok := arg0.(env.Integer); ok { + u = int(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.GridWrap)//on-unselected?: arg 1: " + "expected integer, but got " + objectDebugString(ps.Idx, arg0)) + } + arg0Val = widget.GridWrapItemID(u) + } + } + self.OnUnselected(arg0Val) + return nil + }, 1, false, false, "Returned func") return resObj }, }, @@ -78678,21 +78627,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//position: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//position: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//position: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -78707,21 +78656,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//refresh: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//refresh: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -78734,21 +78683,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//refresh-item: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//refresh-item: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//refresh-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//refresh-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//refresh-item: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//refresh-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val widget.GridWrapItemID { @@ -78762,11 +78711,11 @@ var Builtins = map[string]*env.Builtin{ arg1Val = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//refresh-item: arg 2: expected integer") + return env.NewError("Go(*widget.GridWrap)//refresh-item: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg1Val = widget.GridWrapItemID(u) } @@ -78782,42 +78731,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//resize: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//resize: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//resize: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//resize: arg 2: expected native") + return env.NewError("Go(*widget.GridWrap)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -78828,21 +78771,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//scroll-to: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//scroll-to: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//scroll-to: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//scroll-to: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//scroll-to: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//scroll-to: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val widget.GridWrapItemID { @@ -78856,11 +78799,11 @@ var Builtins = map[string]*env.Builtin{ arg1Val = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//scroll-to: arg 2: expected integer") + return env.NewError("Go(*widget.GridWrap)//scroll-to: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg1Val = widget.GridWrapItemID(u) } @@ -78876,21 +78819,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//scroll-to-bottom: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//scroll-to-bottom: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//scroll-to-bottom: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//scroll-to-bottom: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//scroll-to-bottom: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//scroll-to-bottom: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ScrollToBottom() return arg0 @@ -78903,28 +78846,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//scroll-to-offset: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//scroll-to-offset: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//scroll-to-offset: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//scroll-to-offset: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//scroll-to-offset: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//scroll-to-offset: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val float32 - if v, ok := arg1.(env.Decimal); ok { - arg1Val = float32(v.Value) + if vc, ok := arg1.(env.Decimal); ok { + arg1Val = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//scroll-to-offset: arg 2: expected decimal") + return env.NewError("Go(*widget.GridWrap)//scroll-to-offset: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.ScrollToOffset(arg1Val) return arg0 @@ -78937,21 +78880,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//scroll-to-top: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//scroll-to-top: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//scroll-to-top: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//scroll-to-top: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//scroll-to-top: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//scroll-to-top: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ScrollToTop() return arg0 @@ -78964,21 +78907,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//select: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//select: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//select: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//select: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//select: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//select: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val widget.GridWrapItemID { @@ -78992,11 +78935,11 @@ var Builtins = map[string]*env.Builtin{ arg1Val = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//select: arg 2: expected integer") + return env.NewError("Go(*widget.GridWrap)//select: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg1Val = widget.GridWrapItemID(u) } @@ -79012,21 +78955,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//show: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//show: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//show: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -79039,21 +78982,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//size: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//size: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//size: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -79068,40 +79011,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//typed-key: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//typed-key: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//typed-key: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//typed-key: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//typed-key: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//typed-key: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.KeyEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.KeyEvent) - if !ok { + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//typed-key: arg 2: expected native of type *fyne.KeyEvent") + return env.NewError("Go(*widget.GridWrap)//typed-key: arg 2: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//typed-key: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//typed-key: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//typed-key: arg 2: expected native") + return env.NewError("Go(*widget.GridWrap)//typed-key: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedKey(arg1Val) return arg0 @@ -79114,34 +79057,34 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//typed-rune: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//typed-rune: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//typed-rune: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//typed-rune: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//typed-rune: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//typed-rune: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val rune switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//typed-rune: arg 2: expected native of type rune") + return env.NewError("Go(*widget.GridWrap)//typed-rune: arg 2: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//typed-rune: arg 2: expected native") + return env.NewError("Go(*widget.GridWrap)//typed-rune: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedRune(arg1Val) return arg0 @@ -79154,21 +79097,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//unselect: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//unselect: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//unselect: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//unselect: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//unselect: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//unselect: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val widget.GridWrapItemID { @@ -79182,11 +79125,11 @@ var Builtins = map[string]*env.Builtin{ arg1Val = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//unselect: arg 2: expected integer") + return env.NewError("Go(*widget.GridWrap)//unselect: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg1Val = widget.GridWrapItemID(u) } @@ -79202,21 +79145,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//unselect-all: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//unselect-all: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//unselect-all: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//unselect-all: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//unselect-all: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//unselect-all: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.UnselectAll() return arg0 @@ -79229,63 +79172,48 @@ var Builtins = map[string]*env.Builtin{ var self *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//update-item!: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//update-item!: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//update-item!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//update-item!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//update-item!: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//update-item!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(widget.GridWrapItemID, fyne.CanvasObject) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 2 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//update-item!: arg 2: function has invalid number of arguments (expected 2)") + return env.NewError("Go(*widget.GridWrap)//update-item!: arg 2: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.UpdateItem = func(arg0 widget.GridWrapItemID, arg1 fyne.CanvasObject) { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewInteger(int64(int(arg0))) - { - typ := reflect.TypeOf(arg1) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg1Val = *env.NewNative(ps.Idx, arg1, typRyeName) - } else { - arg1Val = *env.NewNative(ps.Idx, arg1, "Go(fyne.CanvasObject)") - } - } + newVal = func(farg0 widget.GridWrapItemID, farg1 fyne.CanvasObject) { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewInteger(int64(int(farg0))) + farg1Val = ifaceToNative(ps.Idx, farg1, "Go(fyne.CanvasObject)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val, farg1Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//update-item!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//update-item!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.UpdateItem = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//update-item!: arg 2: expected function or nil") + return env.NewError("Go(*widget.GridWrap)//update-item!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.UpdateItem = newVal return arg0 }, }, @@ -79296,24 +79224,74 @@ var Builtins = map[string]*env.Builtin{ var self *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//update-item?: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//update-item?: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//update-item?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//update-item?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//update-item?: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//update-item?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.UpdateItem, "Go(func(widget.GridWrapItemID, fyne.CanvasObject))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val widget.GridWrapItemID + { + nat, natOk := arg0.(env.Native) + var natValOk bool + var natVal widget.GridWrapItemID + if natOk { + natVal, natValOk = nat.Value.(widget.GridWrapItemID) + } + if natValOk { + arg0Val = natVal + } else { + var u int + if vc, ok := arg0.(env.Integer); ok { + u = int(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.GridWrap)//update-item?: arg 1: " + "expected integer, but got " + objectDebugString(ps.Idx, arg0)) + } + arg0Val = widget.GridWrapItemID(u) + } + } + var arg1Val fyne.CanvasObject + switch v := arg1.(type) { + case env.RyeCtx: + var err error + arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) + if err != nil { + ps.FailureFlag = true + return env.NewError("Go(*widget.GridWrap)//update-item?: arg 2: " + err.Error()) + } + case env.Native: + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.GridWrap)//update-item?: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.GridWrap)//update-item?: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg1Val = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.GridWrap)//update-item?: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.UpdateItem(arg0Val, arg1Val) + return nil + }, 2, false, false, "Returned func") return resObj }, }, @@ -79324,21 +79302,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.GridWrap switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.GridWrap) - if !ok { + if vc, ok := v.Value.(*widget.GridWrap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//visible: arg 1: expected native of type *widget.GridWrap") + return env.NewError("Go(*widget.GridWrap)//visible: arg 1: " + "expected native of type *widget.GridWrap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.GridWrap)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.GridWrap)//visible: arg 1: expected native") + return env.NewError("Go(*widget.GridWrap)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -79353,22 +79331,23 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//alignment!: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//alignment!: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//alignment!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//alignment!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//alignment!: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//alignment!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.TextAlign { nat, natOk := arg1.(env.Native) var natValOk bool @@ -79377,18 +79356,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(fyne.TextAlign) } if natValOk { - self.Alignment = natVal + newVal = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//alignment!: arg 2: expected integer") + return env.NewError("Go(*widget.Hyperlink)//alignment!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } - self.Alignment = fyne.TextAlign(u) + newVal = fyne.TextAlign(u) } } + self.Alignment = newVal return arg0 }, }, @@ -79399,27 +79379,101 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//alignment?: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//alignment?: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//alignment?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//alignment?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//alignment?: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//alignment?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(int(self.Alignment))) return resObj }, }, + "Go(*widget.Hyperlink)//base-widget!": { + Doc: "Set *widget.Hyperlink BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Hyperlink + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Hyperlink); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Hyperlink)//base-widget!: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Hyperlink)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Hyperlink)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Hyperlink)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Hyperlink)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Hyperlink)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*widget.Hyperlink)//base-widget?": { + Doc: "Get *widget.Hyperlink BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Hyperlink + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Hyperlink); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Hyperlink)//base-widget?: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Hyperlink)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Hyperlink)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj + }, + }, "Go(*widget.Hyperlink)//create-renderer": { Doc: "(*widget.Hyperlink).CreateRenderer", Argsn: 1, @@ -79427,42 +79481,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//create-renderer: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//create-renderer: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//create-renderer: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -79473,42 +79510,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//cursor: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//cursor: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//cursor: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//cursor: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//cursor: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//cursor: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Cursor() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(desktop.Cursor)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(desktop.Cursor)") return res0Obj }, }, @@ -79519,21 +79539,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//extend-base-widget: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//extend-base-widget: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -79542,24 +79562,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Hyperlink)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.Hyperlink)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.Hyperlink)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -79572,21 +79592,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//focus-gained: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//focus-gained: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//focus-gained: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//focus-gained: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//focus-gained: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//focus-gained: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusGained() return arg0 @@ -79599,21 +79619,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//focus-lost: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//focus-lost: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//focus-lost: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//focus-lost: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//focus-lost: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//focus-lost: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusLost() return arg0 @@ -79626,28 +79646,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//hidden!: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//hidden!: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.Hyperlink)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -79658,21 +79680,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//hidden?: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//hidden?: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -79686,21 +79708,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//hide: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//hide: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//hide: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -79713,21 +79735,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//min-size: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//min-size: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -79742,40 +79764,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//mouse-in: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//mouse-in: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//mouse-in: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//mouse-in: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//mouse-in: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//mouse-in: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *desktop.MouseEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//mouse-in: arg 2: expected native of type *desktop.MouseEvent") + return env.NewError("Go(*widget.Hyperlink)//mouse-in: arg 2: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//mouse-in: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//mouse-in: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//mouse-in: arg 2: expected native") + return env.NewError("Go(*widget.Hyperlink)//mouse-in: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.MouseIn(arg1Val) return arg0 @@ -79788,40 +79810,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//mouse-moved: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//mouse-moved: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//mouse-moved: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//mouse-moved: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//mouse-moved: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//mouse-moved: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *desktop.MouseEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//mouse-moved: arg 2: expected native of type *desktop.MouseEvent") + return env.NewError("Go(*widget.Hyperlink)//mouse-moved: arg 2: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//mouse-moved: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//mouse-moved: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//mouse-moved: arg 2: expected native") + return env.NewError("Go(*widget.Hyperlink)//mouse-moved: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.MouseMoved(arg1Val) return arg0 @@ -79834,21 +79856,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//mouse-out: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//mouse-out: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//mouse-out: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//mouse-out: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//mouse-out: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//mouse-out: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.MouseOut() return arg0 @@ -79861,42 +79883,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//move: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//move: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//move: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//move: arg 2: expected native") + return env.NewError("Go(*widget.Hyperlink)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -79907,29 +79923,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//on-tapped!: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//on-tapped!: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//on-tapped!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//on-tapped!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//on-tapped!: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//on-tapped!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func() switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//on-tapped!: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(*widget.Hyperlink)//on-tapped!: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnTapped = func() { + newVal = func() { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, ps.Ctx) @@ -79937,13 +79954,14 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//on-tapped!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//on-tapped!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnTapped = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//on-tapped!: arg 2: expected function or nil") + return env.NewError("Go(*widget.Hyperlink)//on-tapped!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnTapped = newVal return arg0 }, }, @@ -79954,24 +79972,27 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//on-tapped?: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//on-tapped?: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//on-tapped?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//on-tapped?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//on-tapped?: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//on-tapped?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnTapped, "Go(func())") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + self.OnTapped() + return nil + }, 0, false, false, "Returned func") return resObj }, }, @@ -79982,21 +80003,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//position: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//position: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//position: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -80011,21 +80032,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//refresh: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//refresh: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -80038,42 +80059,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//resize: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//resize: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//resize: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//resize: arg 2: expected native") + return env.NewError("Go(*widget.Hyperlink)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -80084,28 +80099,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//set-text: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//set-text: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//set-text: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//set-text: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//set-text: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//set-text: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//set-text: arg 2: expected string") + return env.NewError("Go(*widget.Hyperlink)//set-text: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetText(arg1Val) return arg0 @@ -80118,40 +80133,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//set-url: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//set-url: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//set-url: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//set-url: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//set-url: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//set-url: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *url.URL switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*url.URL) - if !ok { + if vc, ok := v.Value.(*url.URL); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//set-url: arg 2: expected native of type *url.URL") + return env.NewError("Go(*widget.Hyperlink)//set-url: arg 2: " + "expected native of type *url.URL, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//set-url: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//set-url: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//set-url: arg 2: expected native") + return env.NewError("Go(*widget.Hyperlink)//set-url: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetURL(arg1Val) return arg0 @@ -80164,28 +80179,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//set-url-from-string: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//set-url-from-string: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//set-url-from-string: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//set-url-from-string: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//set-url-from-string: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//set-url-from-string: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//set-url-from-string: arg 2: expected string") + return env.NewError("Go(*widget.Hyperlink)//set-url-from-string: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } resErr := arg0Val.SetURLFromString(arg1Val) var resErrObj env.Object @@ -80206,21 +80221,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//show: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//show: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//show: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -80233,21 +80248,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//size: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//size: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//size: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -80262,40 +80277,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//tapped: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//tapped: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//tapped: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//tapped: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//tapped: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//tapped: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.PointEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.PointEvent) - if !ok { + if vc, ok := v.Value.(*fyne.PointEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//tapped: arg 2: expected native of type *fyne.PointEvent") + return env.NewError("Go(*widget.Hyperlink)//tapped: arg 2: " + "expected native of type *fyne.PointEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//tapped: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//tapped: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//tapped: arg 2: expected native") + return env.NewError("Go(*widget.Hyperlink)//tapped: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Tapped(arg1Val) return arg0 @@ -80308,28 +80323,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//text!: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//text!: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//text!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//text!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//text!: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//text!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.Text = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//text!: arg 2: expected string") + return env.NewError("Go(*widget.Hyperlink)//text!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.Text = newVal return arg0 }, }, @@ -80340,34 +80357,42 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//text-style!: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//text-style!: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//text-style!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//text-style!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//text-style!: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//text-style!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal *fyne.TextStyle switch v := arg1.(type) { case env.Native: - var ok bool - self.TextStyle, ok = v.Value.(fyne.TextStyle) - if !ok { + if vc, ok := v.Value.(*fyne.TextStyle); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Hyperlink)//text-style!: arg 2: " + "expected native of type *fyne.TextStyle, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//text-style!: arg 2: expected native of type fyne.TextStyle") + return env.NewError("Go(*widget.Hyperlink)//text-style!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//text-style!: arg 2: expected native") + return env.NewError("Go(*widget.Hyperlink)//text-style!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.TextStyle = *newVal return arg0 }, }, @@ -80378,21 +80403,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//text-style?: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//text-style?: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//text-style?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//text-style?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//text-style?: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//text-style?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, &self.TextStyle, "Go(*fyne.TextStyle)") @@ -80406,21 +80431,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//text?: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//text?: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//text?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//text?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//text?: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//text?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.Text) @@ -80434,40 +80459,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//typed-key: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//typed-key: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//typed-key: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//typed-key: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//typed-key: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//typed-key: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.KeyEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.KeyEvent) - if !ok { + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//typed-key: arg 2: expected native of type *fyne.KeyEvent") + return env.NewError("Go(*widget.Hyperlink)//typed-key: arg 2: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//typed-key: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//typed-key: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//typed-key: arg 2: expected native") + return env.NewError("Go(*widget.Hyperlink)//typed-key: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedKey(arg1Val) return arg0 @@ -80480,34 +80505,34 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//typed-rune: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//typed-rune: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//typed-rune: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//typed-rune: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//typed-rune: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//typed-rune: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val rune switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//typed-rune: arg 2: expected native of type rune") + return env.NewError("Go(*widget.Hyperlink)//typed-rune: arg 2: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//typed-rune: arg 2: expected native") + return env.NewError("Go(*widget.Hyperlink)//typed-rune: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedRune(arg1Val) return arg0 @@ -80520,40 +80545,42 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//url!: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//url!: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//url!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//url!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//url!: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//url!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal *url.URL switch v := arg1.(type) { case env.Native: - var ok bool - self.URL, ok = v.Value.(*url.URL) - if !ok { + if vc, ok := v.Value.(*url.URL); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//url!: arg 2: expected native of type *url.URL") + return env.NewError("Go(*widget.Hyperlink)//url!: arg 2: " + "expected native of type *url.URL, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//url!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//url!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.URL = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//url!: arg 2: expected native") + return env.NewError("Go(*widget.Hyperlink)//url!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.URL = newVal return arg0 }, }, @@ -80564,21 +80591,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//url?: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//url?: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//url?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//url?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//url?: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//url?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, self.URL, "Go(*url.URL)") @@ -80592,21 +80619,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//visible: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//visible: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//visible: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -80621,22 +80648,23 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//wrapping!: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//wrapping!: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//wrapping!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//wrapping!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//wrapping!: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//wrapping!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.TextWrap { nat, natOk := arg1.(env.Native) var natValOk bool @@ -80645,18 +80673,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(fyne.TextWrap) } if natValOk { - self.Wrapping = natVal + newVal = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//wrapping!: arg 2: expected integer") + return env.NewError("Go(*widget.Hyperlink)//wrapping!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } - self.Wrapping = fyne.TextWrap(u) + newVal = fyne.TextWrap(u) } } + self.Wrapping = newVal return arg0 }, }, @@ -80667,21 +80696,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Hyperlink switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Hyperlink) - if !ok { + if vc, ok := v.Value.(*widget.Hyperlink); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//wrapping?: arg 1: expected native of type *widget.Hyperlink") + return env.NewError("Go(*widget.Hyperlink)//wrapping?: arg 1: " + "expected native of type *widget.Hyperlink, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//wrapping?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Hyperlink)//wrapping?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Hyperlink)//wrapping?: arg 1: expected native") + return env.NewError("Go(*widget.Hyperlink)//wrapping?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(int(self.Wrapping))) @@ -80695,22 +80724,23 @@ var Builtins = map[string]*env.Builtin{ var self *widget.HyperlinkSegment switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.HyperlinkSegment) - if !ok { + if vc, ok := v.Value.(*widget.HyperlinkSegment); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//alignment!: arg 1: expected native of type *widget.HyperlinkSegment") + return env.NewError("Go(*widget.HyperlinkSegment)//alignment!: arg 1: " + "expected native of type *widget.HyperlinkSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//alignment!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.HyperlinkSegment)//alignment!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//alignment!: arg 1: expected native") + return env.NewError("Go(*widget.HyperlinkSegment)//alignment!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.TextAlign { nat, natOk := arg1.(env.Native) var natValOk bool @@ -80719,18 +80749,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(fyne.TextAlign) } if natValOk { - self.Alignment = natVal + newVal = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//alignment!: arg 2: expected integer") + return env.NewError("Go(*widget.HyperlinkSegment)//alignment!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } - self.Alignment = fyne.TextAlign(u) + newVal = fyne.TextAlign(u) } } + self.Alignment = newVal return arg0 }, }, @@ -80741,21 +80772,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.HyperlinkSegment switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.HyperlinkSegment) - if !ok { + if vc, ok := v.Value.(*widget.HyperlinkSegment); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//alignment?: arg 1: expected native of type *widget.HyperlinkSegment") + return env.NewError("Go(*widget.HyperlinkSegment)//alignment?: arg 1: " + "expected native of type *widget.HyperlinkSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//alignment?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.HyperlinkSegment)//alignment?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//alignment?: arg 1: expected native") + return env.NewError("Go(*widget.HyperlinkSegment)//alignment?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(int(self.Alignment))) @@ -80769,21 +80800,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.HyperlinkSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.HyperlinkSegment) - if !ok { + if vc, ok := v.Value.(*widget.HyperlinkSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//inline: arg 1: expected native of type *widget.HyperlinkSegment") + return env.NewError("Go(*widget.HyperlinkSegment)//inline: arg 1: " + "expected native of type *widget.HyperlinkSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//inline: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.HyperlinkSegment)//inline: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//inline: arg 1: expected native") + return env.NewError("Go(*widget.HyperlinkSegment)//inline: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Inline() var res0Obj env.Object @@ -80798,29 +80829,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.HyperlinkSegment switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.HyperlinkSegment) - if !ok { + if vc, ok := v.Value.(*widget.HyperlinkSegment); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//on-tapped!: arg 1: expected native of type *widget.HyperlinkSegment") + return env.NewError("Go(*widget.HyperlinkSegment)//on-tapped!: arg 1: " + "expected native of type *widget.HyperlinkSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//on-tapped!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.HyperlinkSegment)//on-tapped!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//on-tapped!: arg 1: expected native") + return env.NewError("Go(*widget.HyperlinkSegment)//on-tapped!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func() switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//on-tapped!: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(*widget.HyperlinkSegment)//on-tapped!: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnTapped = func() { + newVal = func() { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, ps.Ctx) @@ -80828,13 +80860,14 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//on-tapped!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.HyperlinkSegment)//on-tapped!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnTapped = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//on-tapped!: arg 2: expected function or nil") + return env.NewError("Go(*widget.HyperlinkSegment)//on-tapped!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnTapped = newVal return arg0 }, }, @@ -80845,24 +80878,27 @@ var Builtins = map[string]*env.Builtin{ var self *widget.HyperlinkSegment switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.HyperlinkSegment) - if !ok { + if vc, ok := v.Value.(*widget.HyperlinkSegment); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//on-tapped?: arg 1: expected native of type *widget.HyperlinkSegment") + return env.NewError("Go(*widget.HyperlinkSegment)//on-tapped?: arg 1: " + "expected native of type *widget.HyperlinkSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//on-tapped?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.HyperlinkSegment)//on-tapped?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//on-tapped?: arg 1: expected native") + return env.NewError("Go(*widget.HyperlinkSegment)//on-tapped?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnTapped, "Go(func())") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + self.OnTapped() + return nil + }, 0, false, false, "Returned func") return resObj }, }, @@ -80873,61 +80909,49 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.HyperlinkSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.HyperlinkSegment) - if !ok { + if vc, ok := v.Value.(*widget.HyperlinkSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//select: arg 1: expected native of type *widget.HyperlinkSegment") + return env.NewError("Go(*widget.HyperlinkSegment)//select: arg 1: " + "expected native of type *widget.HyperlinkSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//select: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.HyperlinkSegment)//select: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//select: arg 1: expected native") + return env.NewError("Go(*widget.HyperlinkSegment)//select: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//select: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//select: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.HyperlinkSegment)//select: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//select: arg 2: expected native") + return env.NewError("Go(*widget.HyperlinkSegment)//select: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg2Val *fyne.Position + var arg2Val fyne.Position switch v := arg2.(type) { case env.Native: - var ok bool - arg2Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//select: arg 3: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg2Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//select: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(*widget.HyperlinkSegment)//select: arg 3: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//select: arg 3: expected native") + return env.NewError("Go(*widget.HyperlinkSegment)//select: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Select(*arg1Val, *arg2Val) + arg0Val.Select(arg1Val, arg2Val) return arg0 }, }, @@ -80938,21 +80962,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.HyperlinkSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.HyperlinkSegment) - if !ok { + if vc, ok := v.Value.(*widget.HyperlinkSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//selected-text: arg 1: expected native of type *widget.HyperlinkSegment") + return env.NewError("Go(*widget.HyperlinkSegment)//selected-text: arg 1: " + "expected native of type *widget.HyperlinkSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//selected-text: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.HyperlinkSegment)//selected-text: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//selected-text: arg 1: expected native") + return env.NewError("Go(*widget.HyperlinkSegment)//selected-text: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.SelectedText() var res0Obj env.Object @@ -80967,28 +80991,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.HyperlinkSegment switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.HyperlinkSegment) - if !ok { + if vc, ok := v.Value.(*widget.HyperlinkSegment); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//text!: arg 1: expected native of type *widget.HyperlinkSegment") + return env.NewError("Go(*widget.HyperlinkSegment)//text!: arg 1: " + "expected native of type *widget.HyperlinkSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//text!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.HyperlinkSegment)//text!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//text!: arg 1: expected native") + return env.NewError("Go(*widget.HyperlinkSegment)//text!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.Text = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//text!: arg 2: expected string") + return env.NewError("Go(*widget.HyperlinkSegment)//text!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.Text = newVal return arg0 }, }, @@ -80999,21 +81025,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.HyperlinkSegment switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.HyperlinkSegment) - if !ok { + if vc, ok := v.Value.(*widget.HyperlinkSegment); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//text?: arg 1: expected native of type *widget.HyperlinkSegment") + return env.NewError("Go(*widget.HyperlinkSegment)//text?: arg 1: " + "expected native of type *widget.HyperlinkSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//text?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.HyperlinkSegment)//text?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//text?: arg 1: expected native") + return env.NewError("Go(*widget.HyperlinkSegment)//text?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.Text) @@ -81027,21 +81053,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.HyperlinkSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.HyperlinkSegment) - if !ok { + if vc, ok := v.Value.(*widget.HyperlinkSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//textual: arg 1: expected native of type *widget.HyperlinkSegment") + return env.NewError("Go(*widget.HyperlinkSegment)//textual: arg 1: " + "expected native of type *widget.HyperlinkSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//textual: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.HyperlinkSegment)//textual: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//textual: arg 1: expected native") + return env.NewError("Go(*widget.HyperlinkSegment)//textual: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Textual() var res0Obj env.Object @@ -81056,21 +81082,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.HyperlinkSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.HyperlinkSegment) - if !ok { + if vc, ok := v.Value.(*widget.HyperlinkSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//unselect: arg 1: expected native of type *widget.HyperlinkSegment") + return env.NewError("Go(*widget.HyperlinkSegment)//unselect: arg 1: " + "expected native of type *widget.HyperlinkSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//unselect: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.HyperlinkSegment)//unselect: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//unselect: arg 1: expected native") + return env.NewError("Go(*widget.HyperlinkSegment)//unselect: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Unselect() return arg0 @@ -81083,21 +81109,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.HyperlinkSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.HyperlinkSegment) - if !ok { + if vc, ok := v.Value.(*widget.HyperlinkSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//update: arg 1: expected native of type *widget.HyperlinkSegment") + return env.NewError("Go(*widget.HyperlinkSegment)//update: arg 1: " + "expected native of type *widget.HyperlinkSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//update: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.HyperlinkSegment)//update: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//update: arg 1: expected native") + return env.NewError("Go(*widget.HyperlinkSegment)//update: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.CanvasObject switch v := arg1.(type) { @@ -81106,24 +81132,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//update: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.HyperlinkSegment)//update: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//update: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("Go(*widget.HyperlinkSegment)//update: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//update: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.HyperlinkSegment)//update: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//update: arg 2: expected native") + return env.NewError("Go(*widget.HyperlinkSegment)//update: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Update(arg1Val) return arg0 @@ -81136,40 +81162,42 @@ var Builtins = map[string]*env.Builtin{ var self *widget.HyperlinkSegment switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.HyperlinkSegment) - if !ok { + if vc, ok := v.Value.(*widget.HyperlinkSegment); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//url!: arg 1: expected native of type *widget.HyperlinkSegment") + return env.NewError("Go(*widget.HyperlinkSegment)//url!: arg 1: " + "expected native of type *widget.HyperlinkSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//url!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.HyperlinkSegment)//url!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//url!: arg 1: expected native") + return env.NewError("Go(*widget.HyperlinkSegment)//url!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal *url.URL switch v := arg1.(type) { case env.Native: - var ok bool - self.URL, ok = v.Value.(*url.URL) - if !ok { + if vc, ok := v.Value.(*url.URL); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//url!: arg 2: expected native of type *url.URL") + return env.NewError("Go(*widget.HyperlinkSegment)//url!: arg 2: " + "expected native of type *url.URL, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//url!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.HyperlinkSegment)//url!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.URL = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//url!: arg 2: expected native") + return env.NewError("Go(*widget.HyperlinkSegment)//url!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.URL = newVal return arg0 }, }, @@ -81180,21 +81208,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.HyperlinkSegment switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.HyperlinkSegment) - if !ok { + if vc, ok := v.Value.(*widget.HyperlinkSegment); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//url?: arg 1: expected native of type *widget.HyperlinkSegment") + return env.NewError("Go(*widget.HyperlinkSegment)//url?: arg 1: " + "expected native of type *widget.HyperlinkSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//url?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.HyperlinkSegment)//url?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//url?: arg 1: expected native") + return env.NewError("Go(*widget.HyperlinkSegment)//url?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, self.URL, "Go(*url.URL)") @@ -81208,43 +81236,100 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.HyperlinkSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.HyperlinkSegment) - if !ok { + if vc, ok := v.Value.(*widget.HyperlinkSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//visual: arg 1: expected native of type *widget.HyperlinkSegment") + return env.NewError("Go(*widget.HyperlinkSegment)//visual: arg 1: " + "expected native of type *widget.HyperlinkSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//visual: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.HyperlinkSegment)//visual: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.HyperlinkSegment)//visual: arg 1: expected native") + return env.NewError("Go(*widget.HyperlinkSegment)//visual: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visual() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.CanvasObject)") + return res0Obj + }, + }, + "Go(*widget.Icon)//base-widget!": { + Doc: "Set *widget.Icon BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Icon + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Icon); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Icon)//base-widget!: arg 1: " + "expected native of type *widget.Icon, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Icon)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Icon)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Icon)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Icon)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Icon)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*widget.Icon)//base-widget?": { + Doc: "Get *widget.Icon BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Icon + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Icon); ok { + self = vc } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.CanvasObject)") + ps.FailureFlag = true + return env.NewError("Go(*widget.Icon)//base-widget?: arg 1: " + "expected native of type *widget.Icon, but got " + objectDebugString(ps.Idx, v)) } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Icon)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Icon)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - return res0Obj + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj }, }, "Go(*widget.Icon)//create-renderer": { @@ -81254,42 +81339,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Icon switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Icon) - if !ok { + if vc, ok := v.Value.(*widget.Icon); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//create-renderer: arg 1: expected native of type *widget.Icon") + return env.NewError("Go(*widget.Icon)//create-renderer: arg 1: " + "expected native of type *widget.Icon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Icon)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//create-renderer: arg 1: expected native") + return env.NewError("Go(*widget.Icon)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -81300,21 +81368,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Icon switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Icon) - if !ok { + if vc, ok := v.Value.(*widget.Icon); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//extend-base-widget: arg 1: expected native of type *widget.Icon") + return env.NewError("Go(*widget.Icon)//extend-base-widget: arg 1: " + "expected native of type *widget.Icon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Icon)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.Icon)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -81323,24 +81391,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Icon)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.Icon)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Icon)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.Icon)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -81353,28 +81421,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Icon switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Icon) - if !ok { + if vc, ok := v.Value.(*widget.Icon); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//hidden!: arg 1: expected native of type *widget.Icon") + return env.NewError("Go(*widget.Icon)//hidden!: arg 1: " + "expected native of type *widget.Icon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Icon)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.Icon)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.Icon)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -81385,21 +81455,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Icon switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Icon) - if !ok { + if vc, ok := v.Value.(*widget.Icon); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//hidden?: arg 1: expected native of type *widget.Icon") + return env.NewError("Go(*widget.Icon)//hidden?: arg 1: " + "expected native of type *widget.Icon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Icon)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.Icon)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -81413,21 +81483,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Icon switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Icon) - if !ok { + if vc, ok := v.Value.(*widget.Icon); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//hide: arg 1: expected native of type *widget.Icon") + return env.NewError("Go(*widget.Icon)//hide: arg 1: " + "expected native of type *widget.Icon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Icon)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//hide: arg 1: expected native") + return env.NewError("Go(*widget.Icon)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -81440,21 +81510,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Icon switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Icon) - if !ok { + if vc, ok := v.Value.(*widget.Icon); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//min-size: arg 1: expected native of type *widget.Icon") + return env.NewError("Go(*widget.Icon)//min-size: arg 1: " + "expected native of type *widget.Icon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Icon)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.Icon)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -81469,42 +81539,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Icon switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Icon) - if !ok { + if vc, ok := v.Value.(*widget.Icon); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//move: arg 1: expected native of type *widget.Icon") + return env.NewError("Go(*widget.Icon)//move: arg 1: " + "expected native of type *widget.Icon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Icon)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//move: arg 1: expected native") + return env.NewError("Go(*widget.Icon)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Icon)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//move: arg 2: expected native") + return env.NewError("Go(*widget.Icon)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -81515,21 +81579,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Icon switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Icon) - if !ok { + if vc, ok := v.Value.(*widget.Icon); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//position: arg 1: expected native of type *widget.Icon") + return env.NewError("Go(*widget.Icon)//position: arg 1: " + "expected native of type *widget.Icon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Icon)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//position: arg 1: expected native") + return env.NewError("Go(*widget.Icon)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -81544,21 +81608,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Icon switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Icon) - if !ok { + if vc, ok := v.Value.(*widget.Icon); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//refresh: arg 1: expected native of type *widget.Icon") + return env.NewError("Go(*widget.Icon)//refresh: arg 1: " + "expected native of type *widget.Icon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Icon)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.Icon)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -81571,42 +81635,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Icon switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Icon) - if !ok { + if vc, ok := v.Value.(*widget.Icon); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//resize: arg 1: expected native of type *widget.Icon") + return env.NewError("Go(*widget.Icon)//resize: arg 1: " + "expected native of type *widget.Icon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Icon)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//resize: arg 1: expected native") + return env.NewError("Go(*widget.Icon)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Icon)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//resize: arg 2: expected native") + return env.NewError("Go(*widget.Icon)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -81617,47 +81675,49 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Icon switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Icon) - if !ok { + if vc, ok := v.Value.(*widget.Icon); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//resource!: arg 1: expected native of type *widget.Icon") + return env.NewError("Go(*widget.Icon)//resource!: arg 1: " + "expected native of type *widget.Icon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//resource!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Icon)//resource!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//resource!: arg 1: expected native") + return env.NewError("Go(*widget.Icon)//resource!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.Resource switch v := arg1.(type) { case env.RyeCtx: var err error - self.Resource, err = ctxTo_fyne_Resource(ps, v) + newVal, err = ctxTo_fyne_Resource(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//resource!: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Icon)//resource!: arg 2: " + err.Error()) } case env.Native: - var ok bool - self.Resource, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//resource!: arg 2: expected native of type fyne.Resource") + return env.NewError("Go(*widget.Icon)//resource!: arg 2: " + "expected native of type fyne.Resource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//resource!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Icon)//resource!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Resource = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//resource!: arg 2: expected native") + return env.NewError("Go(*widget.Icon)//resource!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Resource = newVal return arg0 }, }, @@ -81668,41 +81728,24 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Icon switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Icon) - if !ok { + if vc, ok := v.Value.(*widget.Icon); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//resource?: arg 1: expected native of type *widget.Icon") + return env.NewError("Go(*widget.Icon)//resource?: arg 1: " + "expected native of type *widget.Icon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//resource?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Icon)//resource?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//resource?: arg 1: expected native") + return env.NewError("Go(*widget.Icon)//resource?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - { - typ := reflect.TypeOf(self.Resource) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - resObj = *env.NewNative(ps.Idx, self.Resource, typRyeName) - } else { - resObj = *env.NewNative(ps.Idx, self.Resource, "Go(fyne.Resource)") - } - } + resObj = ifaceToNative(ps.Idx, self.Resource, "Go(fyne.Resource)") return resObj }, }, @@ -81713,21 +81756,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Icon switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Icon) - if !ok { + if vc, ok := v.Value.(*widget.Icon); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//set-resource: arg 1: expected native of type *widget.Icon") + return env.NewError("Go(*widget.Icon)//set-resource: arg 1: " + "expected native of type *widget.Icon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//set-resource: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Icon)//set-resource: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//set-resource: arg 1: expected native") + return env.NewError("Go(*widget.Icon)//set-resource: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Resource switch v := arg1.(type) { @@ -81736,24 +81779,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Resource(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//set-resource: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Icon)//set-resource: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//set-resource: arg 2: expected native of type fyne.Resource") + return env.NewError("Go(*widget.Icon)//set-resource: arg 2: " + "expected native of type fyne.Resource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//set-resource: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Icon)//set-resource: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//set-resource: arg 2: expected native") + return env.NewError("Go(*widget.Icon)//set-resource: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetResource(arg1Val) return arg0 @@ -81766,21 +81809,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Icon switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Icon) - if !ok { + if vc, ok := v.Value.(*widget.Icon); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//show: arg 1: expected native of type *widget.Icon") + return env.NewError("Go(*widget.Icon)//show: arg 1: " + "expected native of type *widget.Icon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Icon)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//show: arg 1: expected native") + return env.NewError("Go(*widget.Icon)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -81793,21 +81836,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Icon switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Icon) - if !ok { + if vc, ok := v.Value.(*widget.Icon); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//size: arg 1: expected native of type *widget.Icon") + return env.NewError("Go(*widget.Icon)//size: arg 1: " + "expected native of type *widget.Icon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Icon)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//size: arg 1: expected native") + return env.NewError("Go(*widget.Icon)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -81822,21 +81865,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Icon switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Icon) - if !ok { + if vc, ok := v.Value.(*widget.Icon); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//visible: arg 1: expected native of type *widget.Icon") + return env.NewError("Go(*widget.Icon)//visible: arg 1: " + "expected native of type *widget.Icon, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Icon)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Icon)//visible: arg 1: expected native") + return env.NewError("Go(*widget.Icon)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -81851,22 +81894,23 @@ var Builtins = map[string]*env.Builtin{ var self *widget.ImageSegment switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.ImageSegment) - if !ok { + if vc, ok := v.Value.(*widget.ImageSegment); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//alignment!: arg 1: expected native of type *widget.ImageSegment") + return env.NewError("Go(*widget.ImageSegment)//alignment!: arg 1: " + "expected native of type *widget.ImageSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//alignment!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ImageSegment)//alignment!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//alignment!: arg 1: expected native") + return env.NewError("Go(*widget.ImageSegment)//alignment!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.TextAlign { nat, natOk := arg1.(env.Native) var natValOk bool @@ -81875,18 +81919,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(fyne.TextAlign) } if natValOk { - self.Alignment = natVal + newVal = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//alignment!: arg 2: expected integer") + return env.NewError("Go(*widget.ImageSegment)//alignment!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } - self.Alignment = fyne.TextAlign(u) + newVal = fyne.TextAlign(u) } } + self.Alignment = newVal return arg0 }, }, @@ -81897,21 +81942,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.ImageSegment switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.ImageSegment) - if !ok { + if vc, ok := v.Value.(*widget.ImageSegment); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//alignment?: arg 1: expected native of type *widget.ImageSegment") + return env.NewError("Go(*widget.ImageSegment)//alignment?: arg 1: " + "expected native of type *widget.ImageSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//alignment?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ImageSegment)//alignment?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//alignment?: arg 1: expected native") + return env.NewError("Go(*widget.ImageSegment)//alignment?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(int(self.Alignment))) @@ -81925,21 +81970,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ImageSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ImageSegment) - if !ok { + if vc, ok := v.Value.(*widget.ImageSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//inline: arg 1: expected native of type *widget.ImageSegment") + return env.NewError("Go(*widget.ImageSegment)//inline: arg 1: " + "expected native of type *widget.ImageSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//inline: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ImageSegment)//inline: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//inline: arg 1: expected native") + return env.NewError("Go(*widget.ImageSegment)//inline: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Inline() var res0Obj env.Object @@ -81954,61 +81999,49 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ImageSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ImageSegment) - if !ok { + if vc, ok := v.Value.(*widget.ImageSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//select: arg 1: expected native of type *widget.ImageSegment") + return env.NewError("Go(*widget.ImageSegment)//select: arg 1: " + "expected native of type *widget.ImageSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//select: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ImageSegment)//select: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//select: arg 1: expected native") + return env.NewError("Go(*widget.ImageSegment)//select: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//select: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//select: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ImageSegment)//select: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//select: arg 2: expected native") + return env.NewError("Go(*widget.ImageSegment)//select: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg2Val *fyne.Position + var arg2Val fyne.Position switch v := arg2.(type) { case env.Native: - var ok bool - arg2Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//select: arg 3: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg2Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//select: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ImageSegment)//select: arg 3: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//select: arg 3: expected native") + return env.NewError("Go(*widget.ImageSegment)//select: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Select(*arg1Val, *arg2Val) + arg0Val.Select(arg1Val, arg2Val) return arg0 }, }, @@ -82019,21 +82052,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ImageSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ImageSegment) - if !ok { + if vc, ok := v.Value.(*widget.ImageSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//selected-text: arg 1: expected native of type *widget.ImageSegment") + return env.NewError("Go(*widget.ImageSegment)//selected-text: arg 1: " + "expected native of type *widget.ImageSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//selected-text: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ImageSegment)//selected-text: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//selected-text: arg 1: expected native") + return env.NewError("Go(*widget.ImageSegment)//selected-text: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.SelectedText() var res0Obj env.Object @@ -82048,47 +82081,49 @@ var Builtins = map[string]*env.Builtin{ var self *widget.ImageSegment switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.ImageSegment) - if !ok { + if vc, ok := v.Value.(*widget.ImageSegment); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//source!: arg 1: expected native of type *widget.ImageSegment") + return env.NewError("Go(*widget.ImageSegment)//source!: arg 1: " + "expected native of type *widget.ImageSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//source!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ImageSegment)//source!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//source!: arg 1: expected native") + return env.NewError("Go(*widget.ImageSegment)//source!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.URI switch v := arg1.(type) { case env.RyeCtx: var err error - self.Source, err = ctxTo_fyne_URI(ps, v) + newVal, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//source!: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.ImageSegment)//source!: arg 2: " + err.Error()) } case env.Native: - var ok bool - self.Source, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//source!: arg 2: expected native of type fyne.URI") + return env.NewError("Go(*widget.ImageSegment)//source!: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//source!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ImageSegment)//source!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Source = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//source!: arg 2: expected native") + return env.NewError("Go(*widget.ImageSegment)//source!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Source = newVal return arg0 }, }, @@ -82099,41 +82134,24 @@ var Builtins = map[string]*env.Builtin{ var self *widget.ImageSegment switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.ImageSegment) - if !ok { + if vc, ok := v.Value.(*widget.ImageSegment); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//source?: arg 1: expected native of type *widget.ImageSegment") + return env.NewError("Go(*widget.ImageSegment)//source?: arg 1: " + "expected native of type *widget.ImageSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//source?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ImageSegment)//source?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//source?: arg 1: expected native") + return env.NewError("Go(*widget.ImageSegment)//source?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - { - typ := reflect.TypeOf(self.Source) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - resObj = *env.NewNative(ps.Idx, self.Source, typRyeName) - } else { - resObj = *env.NewNative(ps.Idx, self.Source, "Go(fyne.URI)") - } - } + resObj = ifaceToNative(ps.Idx, self.Source, "Go(fyne.URI)") return resObj }, }, @@ -82144,21 +82162,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ImageSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ImageSegment) - if !ok { + if vc, ok := v.Value.(*widget.ImageSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//textual: arg 1: expected native of type *widget.ImageSegment") + return env.NewError("Go(*widget.ImageSegment)//textual: arg 1: " + "expected native of type *widget.ImageSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//textual: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ImageSegment)//textual: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//textual: arg 1: expected native") + return env.NewError("Go(*widget.ImageSegment)//textual: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Textual() var res0Obj env.Object @@ -82173,28 +82191,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.ImageSegment switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.ImageSegment) - if !ok { + if vc, ok := v.Value.(*widget.ImageSegment); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//title!: arg 1: expected native of type *widget.ImageSegment") + return env.NewError("Go(*widget.ImageSegment)//title!: arg 1: " + "expected native of type *widget.ImageSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//title!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ImageSegment)//title!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//title!: arg 1: expected native") + return env.NewError("Go(*widget.ImageSegment)//title!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.Title = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//title!: arg 2: expected string") + return env.NewError("Go(*widget.ImageSegment)//title!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.Title = newVal return arg0 }, }, @@ -82205,21 +82225,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.ImageSegment switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.ImageSegment) - if !ok { + if vc, ok := v.Value.(*widget.ImageSegment); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//title?: arg 1: expected native of type *widget.ImageSegment") + return env.NewError("Go(*widget.ImageSegment)//title?: arg 1: " + "expected native of type *widget.ImageSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//title?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ImageSegment)//title?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//title?: arg 1: expected native") + return env.NewError("Go(*widget.ImageSegment)//title?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.Title) @@ -82233,21 +82253,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ImageSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ImageSegment) - if !ok { + if vc, ok := v.Value.(*widget.ImageSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//unselect: arg 1: expected native of type *widget.ImageSegment") + return env.NewError("Go(*widget.ImageSegment)//unselect: arg 1: " + "expected native of type *widget.ImageSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//unselect: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ImageSegment)//unselect: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//unselect: arg 1: expected native") + return env.NewError("Go(*widget.ImageSegment)//unselect: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Unselect() return arg0 @@ -82260,21 +82280,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ImageSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ImageSegment) - if !ok { + if vc, ok := v.Value.(*widget.ImageSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//update: arg 1: expected native of type *widget.ImageSegment") + return env.NewError("Go(*widget.ImageSegment)//update: arg 1: " + "expected native of type *widget.ImageSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//update: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ImageSegment)//update: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//update: arg 1: expected native") + return env.NewError("Go(*widget.ImageSegment)//update: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.CanvasObject switch v := arg1.(type) { @@ -82283,24 +82303,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//update: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.ImageSegment)//update: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//update: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("Go(*widget.ImageSegment)//update: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//update: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ImageSegment)//update: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//update: arg 2: expected native") + return env.NewError("Go(*widget.ImageSegment)//update: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Update(arg1Val) return arg0 @@ -82313,42 +82333,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ImageSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ImageSegment) - if !ok { + if vc, ok := v.Value.(*widget.ImageSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//visual: arg 1: expected native of type *widget.ImageSegment") + return env.NewError("Go(*widget.ImageSegment)//visual: arg 1: " + "expected native of type *widget.ImageSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//visual: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ImageSegment)//visual: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ImageSegment)//visual: arg 1: expected native") + return env.NewError("Go(*widget.ImageSegment)//visual: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visual() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.CanvasObject)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.CanvasObject)") return res0Obj }, }, @@ -82359,22 +82362,23 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Label switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Label) - if !ok { + if vc, ok := v.Value.(*widget.Label); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//alignment!: arg 1: expected native of type *widget.Label") + return env.NewError("Go(*widget.Label)//alignment!: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//alignment!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//alignment!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//alignment!: arg 1: expected native") + return env.NewError("Go(*widget.Label)//alignment!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.TextAlign { nat, natOk := arg1.(env.Native) var natValOk bool @@ -82383,18 +82387,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(fyne.TextAlign) } if natValOk { - self.Alignment = natVal + newVal = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//alignment!: arg 2: expected integer") + return env.NewError("Go(*widget.Label)//alignment!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } - self.Alignment = fyne.TextAlign(u) + newVal = fyne.TextAlign(u) } } + self.Alignment = newVal return arg0 }, }, @@ -82405,27 +82410,101 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Label switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Label) - if !ok { + if vc, ok := v.Value.(*widget.Label); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//alignment?: arg 1: expected native of type *widget.Label") + return env.NewError("Go(*widget.Label)//alignment?: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//alignment?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//alignment?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//alignment?: arg 1: expected native") + return env.NewError("Go(*widget.Label)//alignment?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(int(self.Alignment))) return resObj }, }, + "Go(*widget.Label)//base-widget!": { + Doc: "Set *widget.Label BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Label + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Label); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Label)//base-widget!: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Label)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Label)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Label)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Label)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Label)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*widget.Label)//base-widget?": { + Doc: "Get *widget.Label BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Label + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Label); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Label)//base-widget?: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Label)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Label)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj + }, + }, "Go(*widget.Label)//bind": { Doc: "(*widget.Label).Bind", Argsn: 2, @@ -82433,21 +82512,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Label switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Label) - if !ok { + if vc, ok := v.Value.(*widget.Label); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//bind: arg 1: expected native of type *widget.Label") + return env.NewError("Go(*widget.Label)//bind: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//bind: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//bind: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//bind: arg 1: expected native") + return env.NewError("Go(*widget.Label)//bind: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.String switch v := arg1.(type) { @@ -82456,24 +82535,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_String(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//bind: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Label)//bind: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.String) - if !ok { + if vc, ok := v.Value.(binding.String); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//bind: arg 2: expected native of type binding.String") + return env.NewError("Go(*widget.Label)//bind: arg 2: " + "expected native of type binding.String, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//bind: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//bind: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//bind: arg 2: expected native") + return env.NewError("Go(*widget.Label)//bind: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Bind(arg1Val) return arg0 @@ -82486,42 +82565,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Label switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Label) - if !ok { + if vc, ok := v.Value.(*widget.Label); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//create-renderer: arg 1: expected native of type *widget.Label") + return env.NewError("Go(*widget.Label)//create-renderer: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//create-renderer: arg 1: expected native") + return env.NewError("Go(*widget.Label)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -82532,21 +82594,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Label switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Label) - if !ok { + if vc, ok := v.Value.(*widget.Label); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//extend-base-widget: arg 1: expected native of type *widget.Label") + return env.NewError("Go(*widget.Label)//extend-base-widget: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.Label)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -82555,24 +82617,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Label)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.Label)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.Label)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -82585,28 +82647,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Label switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Label) - if !ok { + if vc, ok := v.Value.(*widget.Label); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//hidden!: arg 1: expected native of type *widget.Label") + return env.NewError("Go(*widget.Label)//hidden!: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.Label)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.Label)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -82617,21 +82681,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Label switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Label) - if !ok { + if vc, ok := v.Value.(*widget.Label); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//hidden?: arg 1: expected native of type *widget.Label") + return env.NewError("Go(*widget.Label)//hidden?: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.Label)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -82645,21 +82709,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Label switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Label) - if !ok { + if vc, ok := v.Value.(*widget.Label); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//hide: arg 1: expected native of type *widget.Label") + return env.NewError("Go(*widget.Label)//hide: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//hide: arg 1: expected native") + return env.NewError("Go(*widget.Label)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -82672,22 +82736,23 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Label switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Label) - if !ok { + if vc, ok := v.Value.(*widget.Label); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//importance!: arg 1: expected native of type *widget.Label") + return env.NewError("Go(*widget.Label)//importance!: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//importance!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//importance!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//importance!: arg 1: expected native") + return env.NewError("Go(*widget.Label)//importance!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal widget.Importance { nat, natOk := arg1.(env.Native) var natValOk bool @@ -82696,18 +82761,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(widget.Importance) } if natValOk { - self.Importance = natVal + newVal = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//importance!: arg 2: expected integer") + return env.NewError("Go(*widget.Label)//importance!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } - self.Importance = widget.Importance(u) + newVal = widget.Importance(u) } } + self.Importance = newVal return arg0 }, }, @@ -82718,21 +82784,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Label switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Label) - if !ok { + if vc, ok := v.Value.(*widget.Label); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//importance?: arg 1: expected native of type *widget.Label") + return env.NewError("Go(*widget.Label)//importance?: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//importance?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//importance?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//importance?: arg 1: expected native") + return env.NewError("Go(*widget.Label)//importance?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(int(self.Importance))) @@ -82746,21 +82812,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Label switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Label) - if !ok { + if vc, ok := v.Value.(*widget.Label); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//min-size: arg 1: expected native of type *widget.Label") + return env.NewError("Go(*widget.Label)//min-size: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.Label)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -82775,42 +82841,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Label switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Label) - if !ok { + if vc, ok := v.Value.(*widget.Label); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//move: arg 1: expected native of type *widget.Label") + return env.NewError("Go(*widget.Label)//move: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//move: arg 1: expected native") + return env.NewError("Go(*widget.Label)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//move: arg 2: expected native") + return env.NewError("Go(*widget.Label)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -82821,21 +82881,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Label switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Label) - if !ok { + if vc, ok := v.Value.(*widget.Label); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//position: arg 1: expected native of type *widget.Label") + return env.NewError("Go(*widget.Label)//position: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//position: arg 1: expected native") + return env.NewError("Go(*widget.Label)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -82850,21 +82910,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Label switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Label) - if !ok { + if vc, ok := v.Value.(*widget.Label); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//refresh: arg 1: expected native of type *widget.Label") + return env.NewError("Go(*widget.Label)//refresh: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.Label)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -82877,42 +82937,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Label switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Label) - if !ok { + if vc, ok := v.Value.(*widget.Label); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//resize: arg 1: expected native of type *widget.Label") + return env.NewError("Go(*widget.Label)//resize: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//resize: arg 1: expected native") + return env.NewError("Go(*widget.Label)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//resize: arg 2: expected native") + return env.NewError("Go(*widget.Label)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -82923,28 +82977,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Label switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Label) - if !ok { + if vc, ok := v.Value.(*widget.Label); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//set-text: arg 1: expected native of type *widget.Label") + return env.NewError("Go(*widget.Label)//set-text: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//set-text: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//set-text: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//set-text: arg 1: expected native") + return env.NewError("Go(*widget.Label)//set-text: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//set-text: arg 2: expected string") + return env.NewError("Go(*widget.Label)//set-text: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetText(arg1Val) return arg0 @@ -82957,21 +83011,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Label switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Label) - if !ok { + if vc, ok := v.Value.(*widget.Label); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//show: arg 1: expected native of type *widget.Label") + return env.NewError("Go(*widget.Label)//show: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//show: arg 1: expected native") + return env.NewError("Go(*widget.Label)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -82984,21 +83038,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Label switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Label) - if !ok { + if vc, ok := v.Value.(*widget.Label); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//size: arg 1: expected native of type *widget.Label") + return env.NewError("Go(*widget.Label)//size: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//size: arg 1: expected native") + return env.NewError("Go(*widget.Label)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -83013,28 +83067,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Label switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Label) - if !ok { + if vc, ok := v.Value.(*widget.Label); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//text!: arg 1: expected native of type *widget.Label") + return env.NewError("Go(*widget.Label)//text!: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//text!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//text!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//text!: arg 1: expected native") + return env.NewError("Go(*widget.Label)//text!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.Text = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//text!: arg 2: expected string") + return env.NewError("Go(*widget.Label)//text!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.Text = newVal return arg0 }, }, @@ -83045,34 +83101,42 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Label switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Label) - if !ok { + if vc, ok := v.Value.(*widget.Label); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//text-style!: arg 1: expected native of type *widget.Label") + return env.NewError("Go(*widget.Label)//text-style!: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//text-style!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//text-style!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//text-style!: arg 1: expected native") + return env.NewError("Go(*widget.Label)//text-style!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal *fyne.TextStyle switch v := arg1.(type) { case env.Native: - var ok bool - self.TextStyle, ok = v.Value.(fyne.TextStyle) - if !ok { + if vc, ok := v.Value.(*fyne.TextStyle); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//text-style!: arg 2: expected native of type fyne.TextStyle") + return env.NewError("Go(*widget.Label)//text-style!: arg 2: " + "expected native of type *fyne.TextStyle, but got " + objectDebugString(ps.Idx, v)) } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Label)//text-style!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//text-style!: arg 2: expected native") + return env.NewError("Go(*widget.Label)//text-style!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.TextStyle = *newVal return arg0 }, }, @@ -83083,21 +83147,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Label switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Label) - if !ok { + if vc, ok := v.Value.(*widget.Label); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//text-style?: arg 1: expected native of type *widget.Label") + return env.NewError("Go(*widget.Label)//text-style?: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//text-style?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//text-style?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//text-style?: arg 1: expected native") + return env.NewError("Go(*widget.Label)//text-style?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, &self.TextStyle, "Go(*fyne.TextStyle)") @@ -83111,21 +83175,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Label switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Label) - if !ok { + if vc, ok := v.Value.(*widget.Label); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//text?: arg 1: expected native of type *widget.Label") + return env.NewError("Go(*widget.Label)//text?: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//text?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//text?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//text?: arg 1: expected native") + return env.NewError("Go(*widget.Label)//text?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.Text) @@ -83139,22 +83203,23 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Label switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Label) - if !ok { + if vc, ok := v.Value.(*widget.Label); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//truncation!: arg 1: expected native of type *widget.Label") + return env.NewError("Go(*widget.Label)//truncation!: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//truncation!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//truncation!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//truncation!: arg 1: expected native") + return env.NewError("Go(*widget.Label)//truncation!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.TextTruncation { nat, natOk := arg1.(env.Native) var natValOk bool @@ -83163,18 +83228,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(fyne.TextTruncation) } if natValOk { - self.Truncation = natVal + newVal = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//truncation!: arg 2: expected integer") + return env.NewError("Go(*widget.Label)//truncation!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } - self.Truncation = fyne.TextTruncation(u) + newVal = fyne.TextTruncation(u) } } + self.Truncation = newVal return arg0 }, }, @@ -83185,21 +83251,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Label switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Label) - if !ok { + if vc, ok := v.Value.(*widget.Label); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//truncation?: arg 1: expected native of type *widget.Label") + return env.NewError("Go(*widget.Label)//truncation?: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//truncation?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//truncation?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//truncation?: arg 1: expected native") + return env.NewError("Go(*widget.Label)//truncation?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(int(self.Truncation))) @@ -83213,21 +83279,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Label switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Label) - if !ok { + if vc, ok := v.Value.(*widget.Label); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//unbind: arg 1: expected native of type *widget.Label") + return env.NewError("Go(*widget.Label)//unbind: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//unbind: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//unbind: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//unbind: arg 1: expected native") + return env.NewError("Go(*widget.Label)//unbind: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Unbind() return arg0 @@ -83240,21 +83306,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Label switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Label) - if !ok { + if vc, ok := v.Value.(*widget.Label); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//visible: arg 1: expected native of type *widget.Label") + return env.NewError("Go(*widget.Label)//visible: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//visible: arg 1: expected native") + return env.NewError("Go(*widget.Label)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -83269,22 +83335,23 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Label switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Label) - if !ok { + if vc, ok := v.Value.(*widget.Label); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//wrapping!: arg 1: expected native of type *widget.Label") + return env.NewError("Go(*widget.Label)//wrapping!: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//wrapping!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//wrapping!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//wrapping!: arg 1: expected native") + return env.NewError("Go(*widget.Label)//wrapping!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.TextWrap { nat, natOk := arg1.(env.Native) var natValOk bool @@ -83293,18 +83360,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(fyne.TextWrap) } if natValOk { - self.Wrapping = natVal + newVal = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//wrapping!: arg 2: expected integer") + return env.NewError("Go(*widget.Label)//wrapping!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } - self.Wrapping = fyne.TextWrap(u) + newVal = fyne.TextWrap(u) } } + self.Wrapping = newVal return arg0 }, }, @@ -83315,27 +83383,101 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Label switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Label) - if !ok { + if vc, ok := v.Value.(*widget.Label); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//wrapping?: arg 1: expected native of type *widget.Label") + return env.NewError("Go(*widget.Label)//wrapping?: arg 1: " + "expected native of type *widget.Label, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//wrapping?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Label)//wrapping?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Label)//wrapping?: arg 1: expected native") + return env.NewError("Go(*widget.Label)//wrapping?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(int(self.Wrapping))) return resObj }, }, + "Go(*widget.List)//base-widget!": { + Doc: "Set *widget.List BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.List + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.List); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.List)//base-widget!: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.List)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.List)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.List)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.List)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.List)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*widget.List)//base-widget?": { + Doc: "Get *widget.List BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.List + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.List); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.List)//base-widget?: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.List)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.List)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj + }, + }, "Go(*widget.List)//create-item!": { Doc: "Set *widget.List CreateItem value", Argsn: 2, @@ -83343,29 +83485,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//create-item!: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//create-item!: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//create-item!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//create-item!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//create-item!: arg 1: expected native") + return env.NewError("Go(*widget.List)//create-item!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func() fyne.CanvasObject switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//create-item!: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(*widget.List)//create-item!: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.CreateItem = func() fyne.CanvasObject { + newVal = func() fyne.CanvasObject { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, ps.Ctx) @@ -83375,19 +83518,21 @@ var Builtins = map[string]*env.Builtin{ var err error res, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.List)//create-item!: arg 2: callback result: "+err.Error()+"", + "Go(*widget.List)//create-item!: arg 2: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.List)//create-item!: arg 2: callback result: expected native of type fyne.CanvasObject", + "Go(*widget.List)//create-item!: arg 2: callback result: "+"expected native of type fyne.CanvasObject, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -83395,8 +83540,9 @@ var Builtins = map[string]*env.Builtin{ } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.List)//create-item!: arg 2: callback result: expected integer to be 0 or nil", + "Go(*widget.List)//create-item!: arg 2: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -83404,8 +83550,9 @@ var Builtins = map[string]*env.Builtin{ } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.List)//create-item!: arg 2: callback result: expected native", + "Go(*widget.List)//create-item!: arg 2: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -83416,13 +83563,14 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//create-item!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//create-item!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.CreateItem = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//create-item!: arg 2: expected function or nil") + return env.NewError("Go(*widget.List)//create-item!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.CreateItem = newVal return arg0 }, }, @@ -83433,24 +83581,29 @@ var Builtins = map[string]*env.Builtin{ var self *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//create-item?: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//create-item?: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//create-item?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//create-item?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//create-item?: arg 1: expected native") + return env.NewError("Go(*widget.List)//create-item?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.CreateItem, "Go(func() (fyne.CanvasObject))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + res0 := self.CreateItem() + var res0Obj env.Object + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.CanvasObject)") + return res0Obj + }, 0, false, false, "Returned func") return resObj }, }, @@ -83461,42 +83614,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//create-renderer: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//create-renderer: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//create-renderer: arg 1: expected native") + return env.NewError("Go(*widget.List)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -83507,21 +83643,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//extend-base-widget: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//extend-base-widget: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.List)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -83530,24 +83666,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.List)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.List)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.List)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -83560,21 +83696,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//focus-gained: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//focus-gained: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//focus-gained: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//focus-gained: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//focus-gained: arg 1: expected native") + return env.NewError("Go(*widget.List)//focus-gained: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusGained() return arg0 @@ -83587,21 +83723,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//focus-lost: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//focus-lost: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//focus-lost: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//focus-lost: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//focus-lost: arg 1: expected native") + return env.NewError("Go(*widget.List)//focus-lost: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusLost() return arg0 @@ -83614,28 +83750,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//hidden!: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//hidden!: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.List)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.List)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -83646,21 +83784,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//hidden?: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//hidden?: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.List)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -83674,21 +83812,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//hide: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//hide: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//hide: arg 1: expected native") + return env.NewError("Go(*widget.List)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -83701,38 +83839,40 @@ var Builtins = map[string]*env.Builtin{ var self *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//length!: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//length!: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//length!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//length!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//length!: arg 1: expected native") + return env.NewError("Go(*widget.List)//length!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func() int switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//length!: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(*widget.List)//length!: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.Length = func() int { + newVal = func() int { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, ps.Ctx) var res int - if v, ok := ps.Res.(env.Integer); ok { - res = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + res = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.List)//length!: arg 2: callback result: expected integer", + "Go(*widget.List)//length!: arg 2: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -83743,13 +83883,14 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//length!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//length!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.Length = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//length!: arg 2: expected function or nil") + return env.NewError("Go(*widget.List)//length!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.Length = newVal return arg0 }, }, @@ -83760,24 +83901,29 @@ var Builtins = map[string]*env.Builtin{ var self *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//length?: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//length?: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//length?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//length?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//length?: arg 1: expected native") + return env.NewError("Go(*widget.List)//length?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.Length, "Go(func() (int))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + res0 := self.Length() + var res0Obj env.Object + res0Obj = *env.NewInteger(int64(res0)) + return res0Obj + }, 0, false, false, "Returned func") return resObj }, }, @@ -83788,21 +83934,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//min-size: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//min-size: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.List)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -83817,42 +83963,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//move: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//move: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//move: arg 1: expected native") + return env.NewError("Go(*widget.List)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.List)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//move: arg 2: expected native") + return env.NewError("Go(*widget.List)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -83863,45 +84003,47 @@ var Builtins = map[string]*env.Builtin{ var self *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//on-selected!: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//on-selected!: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//on-selected!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//on-selected!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//on-selected!: arg 1: expected native") + return env.NewError("Go(*widget.List)//on-selected!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(widget.ListItemID) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//on-selected!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*widget.List)//on-selected!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnSelected = func(arg0 widget.ListItemID) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(int(arg0))) + newVal = func(farg0 widget.ListItemID) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(int(farg0))) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//on-selected!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//on-selected!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnSelected = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//on-selected!: arg 2: expected function or nil") + return env.NewError("Go(*widget.List)//on-selected!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnSelected = newVal return arg0 }, }, @@ -83912,24 +84054,48 @@ var Builtins = map[string]*env.Builtin{ var self *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//on-selected?: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//on-selected?: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//on-selected?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//on-selected?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//on-selected?: arg 1: expected native") + return env.NewError("Go(*widget.List)//on-selected?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnSelected, "Go(func(widget.ListItemID))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val widget.ListItemID + { + nat, natOk := arg0.(env.Native) + var natValOk bool + var natVal widget.ListItemID + if natOk { + natVal, natValOk = nat.Value.(widget.ListItemID) + } + if natValOk { + arg0Val = natVal + } else { + var u int + if vc, ok := arg0.(env.Integer); ok { + u = int(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.List)//on-selected?: arg 1: " + "expected integer, but got " + objectDebugString(ps.Idx, arg0)) + } + arg0Val = widget.ListItemID(u) + } + } + self.OnSelected(arg0Val) + return nil + }, 1, false, false, "Returned func") return resObj }, }, @@ -83940,45 +84106,47 @@ var Builtins = map[string]*env.Builtin{ var self *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//on-unselected!: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//on-unselected!: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//on-unselected!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//on-unselected!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//on-unselected!: arg 1: expected native") + return env.NewError("Go(*widget.List)//on-unselected!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(widget.ListItemID) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//on-unselected!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*widget.List)//on-unselected!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnUnselected = func(arg0 widget.ListItemID) { - var arg0Val env.Object - arg0Val = *env.NewInteger(int64(int(arg0))) + newVal = func(farg0 widget.ListItemID) { + var farg0Val env.Object + farg0Val = *env.NewInteger(int64(int(farg0))) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//on-unselected!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//on-unselected!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnUnselected = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//on-unselected!: arg 2: expected function or nil") + return env.NewError("Go(*widget.List)//on-unselected!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnUnselected = newVal return arg0 }, }, @@ -83989,24 +84157,48 @@ var Builtins = map[string]*env.Builtin{ var self *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//on-unselected?: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//on-unselected?: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//on-unselected?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//on-unselected?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//on-unselected?: arg 1: expected native") + return env.NewError("Go(*widget.List)//on-unselected?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnUnselected, "Go(func(widget.ListItemID))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val widget.ListItemID + { + nat, natOk := arg0.(env.Native) + var natValOk bool + var natVal widget.ListItemID + if natOk { + natVal, natValOk = nat.Value.(widget.ListItemID) + } + if natValOk { + arg0Val = natVal + } else { + var u int + if vc, ok := arg0.(env.Integer); ok { + u = int(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.List)//on-unselected?: arg 1: " + "expected integer, but got " + objectDebugString(ps.Idx, arg0)) + } + arg0Val = widget.ListItemID(u) + } + } + self.OnUnselected(arg0Val) + return nil + }, 1, false, false, "Returned func") return resObj }, }, @@ -84017,21 +84209,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//position: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//position: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//position: arg 1: expected native") + return env.NewError("Go(*widget.List)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -84046,21 +84238,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//refresh: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//refresh: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.List)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -84073,21 +84265,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//refresh-item: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//refresh-item: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//refresh-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//refresh-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//refresh-item: arg 1: expected native") + return env.NewError("Go(*widget.List)//refresh-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val widget.ListItemID { @@ -84101,11 +84293,11 @@ var Builtins = map[string]*env.Builtin{ arg1Val = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//refresh-item: arg 2: expected integer") + return env.NewError("Go(*widget.List)//refresh-item: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg1Val = widget.ListItemID(u) } @@ -84121,42 +84313,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//resize: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//resize: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//resize: arg 1: expected native") + return env.NewError("Go(*widget.List)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.List)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//resize: arg 2: expected native") + return env.NewError("Go(*widget.List)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -84167,21 +84353,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//scroll-to: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//scroll-to: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//scroll-to: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//scroll-to: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//scroll-to: arg 1: expected native") + return env.NewError("Go(*widget.List)//scroll-to: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val widget.ListItemID { @@ -84195,11 +84381,11 @@ var Builtins = map[string]*env.Builtin{ arg1Val = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//scroll-to: arg 2: expected integer") + return env.NewError("Go(*widget.List)//scroll-to: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg1Val = widget.ListItemID(u) } @@ -84215,21 +84401,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//scroll-to-bottom: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//scroll-to-bottom: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//scroll-to-bottom: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//scroll-to-bottom: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//scroll-to-bottom: arg 1: expected native") + return env.NewError("Go(*widget.List)//scroll-to-bottom: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ScrollToBottom() return arg0 @@ -84242,21 +84428,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//scroll-to-top: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//scroll-to-top: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//scroll-to-top: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//scroll-to-top: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//scroll-to-top: arg 1: expected native") + return env.NewError("Go(*widget.List)//scroll-to-top: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ScrollToTop() return arg0 @@ -84269,21 +84455,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//select: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//select: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//select: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//select: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//select: arg 1: expected native") + return env.NewError("Go(*widget.List)//select: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val widget.ListItemID { @@ -84297,11 +84483,11 @@ var Builtins = map[string]*env.Builtin{ arg1Val = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//select: arg 2: expected integer") + return env.NewError("Go(*widget.List)//select: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg1Val = widget.ListItemID(u) } @@ -84317,21 +84503,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//set-item-height: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//set-item-height: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//set-item-height: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//set-item-height: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//set-item-height: arg 1: expected native") + return env.NewError("Go(*widget.List)//set-item-height: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val widget.ListItemID { @@ -84345,21 +84531,21 @@ var Builtins = map[string]*env.Builtin{ arg1Val = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//set-item-height: arg 2: expected integer") + return env.NewError("Go(*widget.List)//set-item-height: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg1Val = widget.ListItemID(u) } } var arg2Val float32 - if v, ok := arg2.(env.Decimal); ok { - arg2Val = float32(v.Value) + if vc, ok := arg2.(env.Decimal); ok { + arg2Val = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//set-item-height: arg 3: expected decimal") + return env.NewError("Go(*widget.List)//set-item-height: arg 3: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg2)) } arg0Val.SetItemHeight(arg1Val, arg2Val) return arg0 @@ -84372,21 +84558,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//show: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//show: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//show: arg 1: expected native") + return env.NewError("Go(*widget.List)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -84399,21 +84585,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//size: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//size: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//size: arg 1: expected native") + return env.NewError("Go(*widget.List)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -84428,40 +84614,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//typed-key: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//typed-key: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//typed-key: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//typed-key: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//typed-key: arg 1: expected native") + return env.NewError("Go(*widget.List)//typed-key: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.KeyEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.KeyEvent) - if !ok { + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//typed-key: arg 2: expected native of type *fyne.KeyEvent") + return env.NewError("Go(*widget.List)//typed-key: arg 2: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//typed-key: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//typed-key: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//typed-key: arg 2: expected native") + return env.NewError("Go(*widget.List)//typed-key: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedKey(arg1Val) return arg0 @@ -84474,34 +84660,34 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//typed-rune: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//typed-rune: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//typed-rune: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//typed-rune: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//typed-rune: arg 1: expected native") + return env.NewError("Go(*widget.List)//typed-rune: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val rune switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//typed-rune: arg 2: expected native of type rune") + return env.NewError("Go(*widget.List)//typed-rune: arg 2: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//typed-rune: arg 2: expected native") + return env.NewError("Go(*widget.List)//typed-rune: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedRune(arg1Val) return arg0 @@ -84514,21 +84700,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//unselect: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//unselect: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//unselect: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//unselect: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//unselect: arg 1: expected native") + return env.NewError("Go(*widget.List)//unselect: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val widget.ListItemID { @@ -84542,11 +84728,11 @@ var Builtins = map[string]*env.Builtin{ arg1Val = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//unselect: arg 2: expected integer") + return env.NewError("Go(*widget.List)//unselect: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg1Val = widget.ListItemID(u) } @@ -84562,21 +84748,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//unselect-all: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//unselect-all: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//unselect-all: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//unselect-all: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//unselect-all: arg 1: expected native") + return env.NewError("Go(*widget.List)//unselect-all: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.UnselectAll() return arg0 @@ -84589,63 +84775,48 @@ var Builtins = map[string]*env.Builtin{ var self *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//update-item!: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//update-item!: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//update-item!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//update-item!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//update-item!: arg 1: expected native") + return env.NewError("Go(*widget.List)//update-item!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(widget.ListItemID, fyne.CanvasObject) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 2 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//update-item!: arg 2: function has invalid number of arguments (expected 2)") + return env.NewError("Go(*widget.List)//update-item!: arg 2: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.UpdateItem = func(arg0 widget.ListItemID, arg1 fyne.CanvasObject) { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewInteger(int64(int(arg0))) - { - typ := reflect.TypeOf(arg1) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg1Val = *env.NewNative(ps.Idx, arg1, typRyeName) - } else { - arg1Val = *env.NewNative(ps.Idx, arg1, "Go(fyne.CanvasObject)") - } - } + newVal = func(farg0 widget.ListItemID, farg1 fyne.CanvasObject) { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewInteger(int64(int(farg0))) + farg1Val = ifaceToNative(ps.Idx, farg1, "Go(fyne.CanvasObject)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val, farg1Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//update-item!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//update-item!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.UpdateItem = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//update-item!: arg 2: expected function or nil") + return env.NewError("Go(*widget.List)//update-item!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.UpdateItem = newVal return arg0 }, }, @@ -84656,24 +84827,74 @@ var Builtins = map[string]*env.Builtin{ var self *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//update-item?: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//update-item?: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//update-item?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//update-item?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//update-item?: arg 1: expected native") + return env.NewError("Go(*widget.List)//update-item?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.UpdateItem, "Go(func(widget.ListItemID, fyne.CanvasObject))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val widget.ListItemID + { + nat, natOk := arg0.(env.Native) + var natValOk bool + var natVal widget.ListItemID + if natOk { + natVal, natValOk = nat.Value.(widget.ListItemID) + } + if natValOk { + arg0Val = natVal + } else { + var u int + if vc, ok := arg0.(env.Integer); ok { + u = int(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.List)//update-item?: arg 1: " + "expected integer, but got " + objectDebugString(ps.Idx, arg0)) + } + arg0Val = widget.ListItemID(u) + } + } + var arg1Val fyne.CanvasObject + switch v := arg1.(type) { + case env.RyeCtx: + var err error + arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) + if err != nil { + ps.FailureFlag = true + return env.NewError("Go(*widget.List)//update-item?: arg 2: " + err.Error()) + } + case env.Native: + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.List)//update-item?: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.List)//update-item?: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg1Val = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.List)//update-item?: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.UpdateItem(arg0Val, arg1Val) + return nil + }, 2, false, false, "Returned func") return resObj }, }, @@ -84684,21 +84905,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.List switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.List) - if !ok { + if vc, ok := v.Value.(*widget.List); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//visible: arg 1: expected native of type *widget.List") + return env.NewError("Go(*widget.List)//visible: arg 1: " + "expected native of type *widget.List, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.List)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.List)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.List)//visible: arg 1: expected native") + return env.NewError("Go(*widget.List)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -84713,21 +84934,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ListSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ListSegment) - if !ok { + if vc, ok := v.Value.(*widget.ListSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//inline: arg 1: expected native of type *widget.ListSegment") + return env.NewError("Go(*widget.ListSegment)//inline: arg 1: " + "expected native of type *widget.ListSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//inline: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ListSegment)//inline: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//inline: arg 1: expected native") + return env.NewError("Go(*widget.ListSegment)//inline: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Inline() var res0Obj env.Object @@ -84742,69 +84963,64 @@ var Builtins = map[string]*env.Builtin{ var self *widget.ListSegment switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.ListSegment) - if !ok { + if vc, ok := v.Value.(*widget.ListSegment); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//items!: arg 1: expected native of type *widget.ListSegment") + return env.NewError("Go(*widget.ListSegment)//items!: arg 1: " + "expected native of type *widget.ListSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//items!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ListSegment)//items!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//items!: arg 1: expected native") + return env.NewError("Go(*widget.ListSegment)//items!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal []widget.RichTextSegment switch v := arg1.(type) { case env.Block: - self.Items = make([]widget.RichTextSegment, len(v.Series.S)) + newVal = make([]widget.RichTextSegment, len(v.Series.S)) for i, it := range v.Series.S { switch v := it.(type) { case env.RyeCtx: var err error - self.Items[i], err = ctxTo_widget_RichTextSegment(ps, v) + newVal[i], err = ctxTo_widget_RichTextSegment(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//items!: arg 2: block item: " + err.Error() + "") + return env.NewError("Go(*widget.ListSegment)//items!: arg 2: " + "block item: " + err.Error()) } case env.Native: - var ok bool - self.Items[i], ok = v.Value.(widget.RichTextSegment) - if !ok { + if vc, ok := v.Value.(widget.RichTextSegment); ok { + newVal[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//items!: arg 2: block item: expected native of type widget.RichTextSegment") + return env.NewError("Go(*widget.ListSegment)//items!: arg 2: " + "block item: " + "expected native of type widget.RichTextSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//items!: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ListSegment)//items!: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Items[i] = nil + newVal[i] = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//items!: arg 2: block item: expected native") + return env.NewError("Go(*widget.ListSegment)//items!: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - self.Items, ok = v.Value.([]widget.RichTextSegment) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//items!: arg 2: expected native of type []widget.RichTextSegment") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//items!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ListSegment)//items!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Items = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//items!: arg 2: expected block, native or nil") + return env.NewError("Go(*widget.ListSegment)//items!: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } + self.Items = newVal return arg0 }, }, @@ -84815,44 +85031,27 @@ var Builtins = map[string]*env.Builtin{ var self *widget.ListSegment switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.ListSegment) - if !ok { + if vc, ok := v.Value.(*widget.ListSegment); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//items?: arg 1: expected native of type *widget.ListSegment") + return env.NewError("Go(*widget.ListSegment)//items?: arg 1: " + "expected native of type *widget.ListSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//items?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ListSegment)//items?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//items?: arg 1: expected native") + return env.NewError("Go(*widget.ListSegment)//items?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object { items := make([]env.Object, len(self.Items)) for i, it := range self.Items { - { - typ := reflect.TypeOf(it) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - items[i] = *env.NewNative(ps.Idx, it, typRyeName) - } else { - items[i] = *env.NewNative(ps.Idx, it, "Go(widget.RichTextSegment)") - } - } + items[i] = ifaceToNative(ps.Idx, it, "Go(widget.RichTextSegment)") } resObj = *env.NewBlock(*env.NewTSeries(items)) } @@ -84866,28 +85065,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.ListSegment switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.ListSegment) - if !ok { + if vc, ok := v.Value.(*widget.ListSegment); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//ordered!: arg 1: expected native of type *widget.ListSegment") + return env.NewError("Go(*widget.ListSegment)//ordered!: arg 1: " + "expected native of type *widget.ListSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//ordered!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ListSegment)//ordered!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//ordered!: arg 1: expected native") + return env.NewError("Go(*widget.ListSegment)//ordered!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Ordered = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//ordered!: arg 2: expected integer") + return env.NewError("Go(*widget.ListSegment)//ordered!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Ordered = newVal return arg0 }, }, @@ -84898,21 +85099,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.ListSegment switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.ListSegment) - if !ok { + if vc, ok := v.Value.(*widget.ListSegment); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//ordered?: arg 1: expected native of type *widget.ListSegment") + return env.NewError("Go(*widget.ListSegment)//ordered?: arg 1: " + "expected native of type *widget.ListSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//ordered?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ListSegment)//ordered?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//ordered?: arg 1: expected native") + return env.NewError("Go(*widget.ListSegment)//ordered?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Ordered)) @@ -84926,45 +85127,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ListSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ListSegment) - if !ok { + if vc, ok := v.Value.(*widget.ListSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//segments: arg 1: expected native of type *widget.ListSegment") + return env.NewError("Go(*widget.ListSegment)//segments: arg 1: " + "expected native of type *widget.ListSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//segments: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ListSegment)//segments: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//segments: arg 1: expected native") + return env.NewError("Go(*widget.ListSegment)//segments: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Segments() var res0Obj env.Object { items := make([]env.Object, len(res0)) for i, it := range res0 { - { - typ := reflect.TypeOf(it) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - items[i] = *env.NewNative(ps.Idx, it, typRyeName) - } else { - items[i] = *env.NewNative(ps.Idx, it, "Go(widget.RichTextSegment)") - } - } + items[i] = ifaceToNative(ps.Idx, it, "Go(widget.RichTextSegment)") } res0Obj = *env.NewBlock(*env.NewTSeries(items)) } @@ -84978,61 +85162,49 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ListSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ListSegment) - if !ok { + if vc, ok := v.Value.(*widget.ListSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//select: arg 1: expected native of type *widget.ListSegment") + return env.NewError("Go(*widget.ListSegment)//select: arg 1: " + "expected native of type *widget.ListSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//select: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ListSegment)//select: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//select: arg 1: expected native") + return env.NewError("Go(*widget.ListSegment)//select: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//select: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//select: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ListSegment)//select: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//select: arg 2: expected native") + return env.NewError("Go(*widget.ListSegment)//select: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg2Val *fyne.Position + var arg2Val fyne.Position switch v := arg2.(type) { case env.Native: - var ok bool - arg2Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//select: arg 3: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg2Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//select: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ListSegment)//select: arg 3: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//select: arg 3: expected native") + return env.NewError("Go(*widget.ListSegment)//select: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Select(*arg1Val, *arg2Val) + arg0Val.Select(arg1Val, arg2Val) return arg0 }, }, @@ -85043,21 +85215,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ListSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ListSegment) - if !ok { + if vc, ok := v.Value.(*widget.ListSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//selected-text: arg 1: expected native of type *widget.ListSegment") + return env.NewError("Go(*widget.ListSegment)//selected-text: arg 1: " + "expected native of type *widget.ListSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//selected-text: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ListSegment)//selected-text: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//selected-text: arg 1: expected native") + return env.NewError("Go(*widget.ListSegment)//selected-text: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.SelectedText() var res0Obj env.Object @@ -85072,21 +85244,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ListSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ListSegment) - if !ok { + if vc, ok := v.Value.(*widget.ListSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//textual: arg 1: expected native of type *widget.ListSegment") + return env.NewError("Go(*widget.ListSegment)//textual: arg 1: " + "expected native of type *widget.ListSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//textual: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ListSegment)//textual: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//textual: arg 1: expected native") + return env.NewError("Go(*widget.ListSegment)//textual: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Textual() var res0Obj env.Object @@ -85101,21 +85273,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ListSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ListSegment) - if !ok { + if vc, ok := v.Value.(*widget.ListSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//unselect: arg 1: expected native of type *widget.ListSegment") + return env.NewError("Go(*widget.ListSegment)//unselect: arg 1: " + "expected native of type *widget.ListSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//unselect: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ListSegment)//unselect: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//unselect: arg 1: expected native") + return env.NewError("Go(*widget.ListSegment)//unselect: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Unselect() return arg0 @@ -85128,21 +85300,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ListSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ListSegment) - if !ok { + if vc, ok := v.Value.(*widget.ListSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//update: arg 1: expected native of type *widget.ListSegment") + return env.NewError("Go(*widget.ListSegment)//update: arg 1: " + "expected native of type *widget.ListSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//update: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ListSegment)//update: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//update: arg 1: expected native") + return env.NewError("Go(*widget.ListSegment)//update: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.CanvasObject switch v := arg1.(type) { @@ -85151,24 +85323,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//update: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.ListSegment)//update: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//update: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("Go(*widget.ListSegment)//update: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//update: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ListSegment)//update: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//update: arg 2: expected native") + return env.NewError("Go(*widget.ListSegment)//update: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Update(arg1Val) return arg0 @@ -85181,42 +85353,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ListSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ListSegment) - if !ok { + if vc, ok := v.Value.(*widget.ListSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//visual: arg 1: expected native of type *widget.ListSegment") + return env.NewError("Go(*widget.ListSegment)//visual: arg 1: " + "expected native of type *widget.ListSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//visual: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ListSegment)//visual: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ListSegment)//visual: arg 1: expected native") + return env.NewError("Go(*widget.ListSegment)//visual: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visual() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.CanvasObject)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.CanvasObject)") return res0Obj }, }, @@ -85227,21 +85382,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Menu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Menu) - if !ok { + if vc, ok := v.Value.(*widget.Menu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//activate-last-submenu: arg 1: expected native of type *widget.Menu") + return env.NewError("Go(*widget.Menu)//activate-last-submenu: arg 1: " + "expected native of type *widget.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//activate-last-submenu: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//activate-last-submenu: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//activate-last-submenu: arg 1: expected native") + return env.NewError("Go(*widget.Menu)//activate-last-submenu: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.ActivateLastSubmenu() var res0Obj env.Object @@ -85256,21 +85411,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Menu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Menu) - if !ok { + if vc, ok := v.Value.(*widget.Menu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//activate-next: arg 1: expected native of type *widget.Menu") + return env.NewError("Go(*widget.Menu)//activate-next: arg 1: " + "expected native of type *widget.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//activate-next: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//activate-next: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//activate-next: arg 1: expected native") + return env.NewError("Go(*widget.Menu)//activate-next: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ActivateNext() return arg0 @@ -85283,26 +85438,100 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Menu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Menu) - if !ok { + if vc, ok := v.Value.(*widget.Menu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//activate-previous: arg 1: expected native of type *widget.Menu") + return env.NewError("Go(*widget.Menu)//activate-previous: arg 1: " + "expected native of type *widget.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//activate-previous: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//activate-previous: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//activate-previous: arg 1: expected native") + return env.NewError("Go(*widget.Menu)//activate-previous: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ActivatePrevious() return arg0 }, }, + "Go(*widget.Menu)//base-widget!": { + Doc: "Set *widget.Menu BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Menu + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Menu); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Menu)//base-widget!: arg 1: " + "expected native of type *widget.Menu, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Menu)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Menu)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Menu)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Menu)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Menu)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*widget.Menu)//base-widget?": { + Doc: "Get *widget.Menu BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Menu + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Menu); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Menu)//base-widget?: arg 1: " + "expected native of type *widget.Menu, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Menu)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Menu)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj + }, + }, "Go(*widget.Menu)//create-renderer": { Doc: "(*widget.Menu).CreateRenderer", Argsn: 1, @@ -85310,42 +85539,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Menu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Menu) - if !ok { + if vc, ok := v.Value.(*widget.Menu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//create-renderer: arg 1: expected native of type *widget.Menu") + return env.NewError("Go(*widget.Menu)//create-renderer: arg 1: " + "expected native of type *widget.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//create-renderer: arg 1: expected native") + return env.NewError("Go(*widget.Menu)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -85356,21 +85568,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Menu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Menu) - if !ok { + if vc, ok := v.Value.(*widget.Menu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//deactivate-child: arg 1: expected native of type *widget.Menu") + return env.NewError("Go(*widget.Menu)//deactivate-child: arg 1: " + "expected native of type *widget.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//deactivate-child: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//deactivate-child: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//deactivate-child: arg 1: expected native") + return env.NewError("Go(*widget.Menu)//deactivate-child: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.DeactivateChild() return arg0 @@ -85383,21 +85595,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Menu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Menu) - if !ok { + if vc, ok := v.Value.(*widget.Menu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//deactivate-last-submenu: arg 1: expected native of type *widget.Menu") + return env.NewError("Go(*widget.Menu)//deactivate-last-submenu: arg 1: " + "expected native of type *widget.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//deactivate-last-submenu: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//deactivate-last-submenu: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//deactivate-last-submenu: arg 1: expected native") + return env.NewError("Go(*widget.Menu)//deactivate-last-submenu: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.DeactivateLastSubmenu() var res0Obj env.Object @@ -85412,21 +85624,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Menu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Menu) - if !ok { + if vc, ok := v.Value.(*widget.Menu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//dismiss: arg 1: expected native of type *widget.Menu") + return env.NewError("Go(*widget.Menu)//dismiss: arg 1: " + "expected native of type *widget.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//dismiss: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//dismiss: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//dismiss: arg 1: expected native") + return env.NewError("Go(*widget.Menu)//dismiss: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Dismiss() return arg0 @@ -85439,21 +85651,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Menu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Menu) - if !ok { + if vc, ok := v.Value.(*widget.Menu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//extend-base-widget: arg 1: expected native of type *widget.Menu") + return env.NewError("Go(*widget.Menu)//extend-base-widget: arg 1: " + "expected native of type *widget.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.Menu)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -85462,24 +85674,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Menu)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.Menu)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.Menu)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -85492,28 +85704,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Menu switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Menu) - if !ok { + if vc, ok := v.Value.(*widget.Menu); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//hidden!: arg 1: expected native of type *widget.Menu") + return env.NewError("Go(*widget.Menu)//hidden!: arg 1: " + "expected native of type *widget.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.Menu)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.Menu)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -85524,21 +85738,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Menu switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Menu) - if !ok { + if vc, ok := v.Value.(*widget.Menu); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//hidden?: arg 1: expected native of type *widget.Menu") + return env.NewError("Go(*widget.Menu)//hidden?: arg 1: " + "expected native of type *widget.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.Menu)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -85552,21 +85766,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Menu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Menu) - if !ok { + if vc, ok := v.Value.(*widget.Menu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//hide: arg 1: expected native of type *widget.Menu") + return env.NewError("Go(*widget.Menu)//hide: arg 1: " + "expected native of type *widget.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//hide: arg 1: expected native") + return env.NewError("Go(*widget.Menu)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -85579,69 +85793,64 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Menu switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Menu) - if !ok { + if vc, ok := v.Value.(*widget.Menu); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//items!: arg 1: expected native of type *widget.Menu") + return env.NewError("Go(*widget.Menu)//items!: arg 1: " + "expected native of type *widget.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//items!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//items!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//items!: arg 1: expected native") + return env.NewError("Go(*widget.Menu)//items!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal []fyne.CanvasObject switch v := arg1.(type) { case env.Block: - self.Items = make([]fyne.CanvasObject, len(v.Series.S)) + newVal = make([]fyne.CanvasObject, len(v.Series.S)) for i, it := range v.Series.S { switch v := it.(type) { case env.RyeCtx: var err error - self.Items[i], err = ctxTo_fyne_CanvasObject(ps, v) + newVal[i], err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//items!: arg 2: block item: " + err.Error() + "") + return env.NewError("Go(*widget.Menu)//items!: arg 2: " + "block item: " + err.Error()) } case env.Native: - var ok bool - self.Items[i], ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + newVal[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//items!: arg 2: block item: expected native of type fyne.CanvasObject") + return env.NewError("Go(*widget.Menu)//items!: arg 2: " + "block item: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//items!: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//items!: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Items[i] = nil + newVal[i] = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//items!: arg 2: block item: expected native") + return env.NewError("Go(*widget.Menu)//items!: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - self.Items, ok = v.Value.([]fyne.CanvasObject) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//items!: arg 2: expected native of type []fyne.CanvasObject") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//items!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//items!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Items = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//items!: arg 2: expected block, native or nil") + return env.NewError("Go(*widget.Menu)//items!: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } + self.Items = newVal return arg0 }, }, @@ -85652,44 +85861,27 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Menu switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Menu) - if !ok { + if vc, ok := v.Value.(*widget.Menu); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//items?: arg 1: expected native of type *widget.Menu") + return env.NewError("Go(*widget.Menu)//items?: arg 1: " + "expected native of type *widget.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//items?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//items?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//items?: arg 1: expected native") + return env.NewError("Go(*widget.Menu)//items?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object { items := make([]env.Object, len(self.Items)) for i, it := range self.Items { - { - typ := reflect.TypeOf(it) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - items[i] = *env.NewNative(ps.Idx, it, typRyeName) - } else { - items[i] = *env.NewNative(ps.Idx, it, "Go(fyne.CanvasObject)") - } - } + items[i] = ifaceToNative(ps.Idx, it, "Go(fyne.CanvasObject)") } resObj = *env.NewBlock(*env.NewTSeries(items)) } @@ -85703,21 +85895,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Menu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Menu) - if !ok { + if vc, ok := v.Value.(*widget.Menu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//min-size: arg 1: expected native of type *widget.Menu") + return env.NewError("Go(*widget.Menu)//min-size: arg 1: " + "expected native of type *widget.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.Menu)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -85732,42 +85924,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Menu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Menu) - if !ok { + if vc, ok := v.Value.(*widget.Menu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//move: arg 1: expected native of type *widget.Menu") + return env.NewError("Go(*widget.Menu)//move: arg 1: " + "expected native of type *widget.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//move: arg 1: expected native") + return env.NewError("Go(*widget.Menu)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//move: arg 2: expected native") + return env.NewError("Go(*widget.Menu)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -85778,29 +85964,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Menu switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Menu) - if !ok { + if vc, ok := v.Value.(*widget.Menu); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//on-dismiss!: arg 1: expected native of type *widget.Menu") + return env.NewError("Go(*widget.Menu)//on-dismiss!: arg 1: " + "expected native of type *widget.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//on-dismiss!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//on-dismiss!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//on-dismiss!: arg 1: expected native") + return env.NewError("Go(*widget.Menu)//on-dismiss!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func() switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//on-dismiss!: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(*widget.Menu)//on-dismiss!: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnDismiss = func() { + newVal = func() { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, ps.Ctx) @@ -85808,13 +85995,14 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//on-dismiss!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//on-dismiss!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnDismiss = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//on-dismiss!: arg 2: expected function or nil") + return env.NewError("Go(*widget.Menu)//on-dismiss!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnDismiss = newVal return arg0 }, }, @@ -85825,24 +86013,27 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Menu switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Menu) - if !ok { + if vc, ok := v.Value.(*widget.Menu); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//on-dismiss?: arg 1: expected native of type *widget.Menu") + return env.NewError("Go(*widget.Menu)//on-dismiss?: arg 1: " + "expected native of type *widget.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//on-dismiss?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//on-dismiss?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//on-dismiss?: arg 1: expected native") + return env.NewError("Go(*widget.Menu)//on-dismiss?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnDismiss, "Go(func())") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + self.OnDismiss() + return nil + }, 0, false, false, "Returned func") return resObj }, }, @@ -85853,21 +86044,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Menu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Menu) - if !ok { + if vc, ok := v.Value.(*widget.Menu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//position: arg 1: expected native of type *widget.Menu") + return env.NewError("Go(*widget.Menu)//position: arg 1: " + "expected native of type *widget.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//position: arg 1: expected native") + return env.NewError("Go(*widget.Menu)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -85882,21 +86073,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Menu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Menu) - if !ok { + if vc, ok := v.Value.(*widget.Menu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//refresh: arg 1: expected native of type *widget.Menu") + return env.NewError("Go(*widget.Menu)//refresh: arg 1: " + "expected native of type *widget.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.Menu)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -85909,42 +86100,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Menu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Menu) - if !ok { + if vc, ok := v.Value.(*widget.Menu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//resize: arg 1: expected native of type *widget.Menu") + return env.NewError("Go(*widget.Menu)//resize: arg 1: " + "expected native of type *widget.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//resize: arg 1: expected native") + return env.NewError("Go(*widget.Menu)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//resize: arg 2: expected native") + return env.NewError("Go(*widget.Menu)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -85955,21 +86140,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Menu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Menu) - if !ok { + if vc, ok := v.Value.(*widget.Menu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//show: arg 1: expected native of type *widget.Menu") + return env.NewError("Go(*widget.Menu)//show: arg 1: " + "expected native of type *widget.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//show: arg 1: expected native") + return env.NewError("Go(*widget.Menu)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -85982,21 +86167,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Menu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Menu) - if !ok { + if vc, ok := v.Value.(*widget.Menu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//size: arg 1: expected native of type *widget.Menu") + return env.NewError("Go(*widget.Menu)//size: arg 1: " + "expected native of type *widget.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//size: arg 1: expected native") + return env.NewError("Go(*widget.Menu)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -86011,40 +86196,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Menu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Menu) - if !ok { + if vc, ok := v.Value.(*widget.Menu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//tapped: arg 1: expected native of type *widget.Menu") + return env.NewError("Go(*widget.Menu)//tapped: arg 1: " + "expected native of type *widget.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//tapped: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//tapped: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//tapped: arg 1: expected native") + return env.NewError("Go(*widget.Menu)//tapped: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.PointEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.PointEvent) - if !ok { + if vc, ok := v.Value.(*fyne.PointEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//tapped: arg 2: expected native of type *fyne.PointEvent") + return env.NewError("Go(*widget.Menu)//tapped: arg 2: " + "expected native of type *fyne.PointEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//tapped: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//tapped: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//tapped: arg 2: expected native") + return env.NewError("Go(*widget.Menu)//tapped: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Tapped(arg1Val) return arg0 @@ -86057,21 +86242,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Menu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Menu) - if !ok { + if vc, ok := v.Value.(*widget.Menu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//trigger-last: arg 1: expected native of type *widget.Menu") + return env.NewError("Go(*widget.Menu)//trigger-last: arg 1: " + "expected native of type *widget.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//trigger-last: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//trigger-last: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//trigger-last: arg 1: expected native") + return env.NewError("Go(*widget.Menu)//trigger-last: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TriggerLast() return arg0 @@ -86084,21 +86269,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Menu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Menu) - if !ok { + if vc, ok := v.Value.(*widget.Menu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//visible: arg 1: expected native of type *widget.Menu") + return env.NewError("Go(*widget.Menu)//visible: arg 1: " + "expected native of type *widget.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Menu)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Menu)//visible: arg 1: expected native") + return env.NewError("Go(*widget.Menu)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -86113,21 +86298,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ParagraphSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ParagraphSegment) - if !ok { + if vc, ok := v.Value.(*widget.ParagraphSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//inline: arg 1: expected native of type *widget.ParagraphSegment") + return env.NewError("Go(*widget.ParagraphSegment)//inline: arg 1: " + "expected native of type *widget.ParagraphSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//inline: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ParagraphSegment)//inline: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//inline: arg 1: expected native") + return env.NewError("Go(*widget.ParagraphSegment)//inline: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Inline() var res0Obj env.Object @@ -86142,45 +86327,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ParagraphSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ParagraphSegment) - if !ok { + if vc, ok := v.Value.(*widget.ParagraphSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//segments: arg 1: expected native of type *widget.ParagraphSegment") + return env.NewError("Go(*widget.ParagraphSegment)//segments: arg 1: " + "expected native of type *widget.ParagraphSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//segments: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ParagraphSegment)//segments: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//segments: arg 1: expected native") + return env.NewError("Go(*widget.ParagraphSegment)//segments: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Segments() var res0Obj env.Object { items := make([]env.Object, len(res0)) for i, it := range res0 { - { - typ := reflect.TypeOf(it) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - items[i] = *env.NewNative(ps.Idx, it, typRyeName) - } else { - items[i] = *env.NewNative(ps.Idx, it, "Go(widget.RichTextSegment)") - } - } + items[i] = ifaceToNative(ps.Idx, it, "Go(widget.RichTextSegment)") } res0Obj = *env.NewBlock(*env.NewTSeries(items)) } @@ -86194,61 +86362,49 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ParagraphSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ParagraphSegment) - if !ok { + if vc, ok := v.Value.(*widget.ParagraphSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//select: arg 1: expected native of type *widget.ParagraphSegment") + return env.NewError("Go(*widget.ParagraphSegment)//select: arg 1: " + "expected native of type *widget.ParagraphSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//select: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ParagraphSegment)//select: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//select: arg 1: expected native") + return env.NewError("Go(*widget.ParagraphSegment)//select: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//select: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//select: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ParagraphSegment)//select: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//select: arg 2: expected native") + return env.NewError("Go(*widget.ParagraphSegment)//select: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg2Val *fyne.Position + var arg2Val fyne.Position switch v := arg2.(type) { case env.Native: - var ok bool - arg2Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//select: arg 3: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg2Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//select: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ParagraphSegment)//select: arg 3: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//select: arg 3: expected native") + return env.NewError("Go(*widget.ParagraphSegment)//select: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Select(*arg1Val, *arg2Val) + arg0Val.Select(arg1Val, arg2Val) return arg0 }, }, @@ -86259,21 +86415,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ParagraphSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ParagraphSegment) - if !ok { + if vc, ok := v.Value.(*widget.ParagraphSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//selected-text: arg 1: expected native of type *widget.ParagraphSegment") + return env.NewError("Go(*widget.ParagraphSegment)//selected-text: arg 1: " + "expected native of type *widget.ParagraphSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//selected-text: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ParagraphSegment)//selected-text: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//selected-text: arg 1: expected native") + return env.NewError("Go(*widget.ParagraphSegment)//selected-text: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.SelectedText() var res0Obj env.Object @@ -86288,69 +86444,64 @@ var Builtins = map[string]*env.Builtin{ var self *widget.ParagraphSegment switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.ParagraphSegment) - if !ok { + if vc, ok := v.Value.(*widget.ParagraphSegment); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//texts!: arg 1: expected native of type *widget.ParagraphSegment") + return env.NewError("Go(*widget.ParagraphSegment)//texts!: arg 1: " + "expected native of type *widget.ParagraphSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//texts!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ParagraphSegment)//texts!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//texts!: arg 1: expected native") + return env.NewError("Go(*widget.ParagraphSegment)//texts!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal []widget.RichTextSegment switch v := arg1.(type) { case env.Block: - self.Texts = make([]widget.RichTextSegment, len(v.Series.S)) + newVal = make([]widget.RichTextSegment, len(v.Series.S)) for i, it := range v.Series.S { switch v := it.(type) { case env.RyeCtx: var err error - self.Texts[i], err = ctxTo_widget_RichTextSegment(ps, v) + newVal[i], err = ctxTo_widget_RichTextSegment(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//texts!: arg 2: block item: " + err.Error() + "") + return env.NewError("Go(*widget.ParagraphSegment)//texts!: arg 2: " + "block item: " + err.Error()) } case env.Native: - var ok bool - self.Texts[i], ok = v.Value.(widget.RichTextSegment) - if !ok { + if vc, ok := v.Value.(widget.RichTextSegment); ok { + newVal[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//texts!: arg 2: block item: expected native of type widget.RichTextSegment") + return env.NewError("Go(*widget.ParagraphSegment)//texts!: arg 2: " + "block item: " + "expected native of type widget.RichTextSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//texts!: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ParagraphSegment)//texts!: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Texts[i] = nil + newVal[i] = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//texts!: arg 2: block item: expected native") + return env.NewError("Go(*widget.ParagraphSegment)//texts!: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - self.Texts, ok = v.Value.([]widget.RichTextSegment) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//texts!: arg 2: expected native of type []widget.RichTextSegment") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//texts!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ParagraphSegment)//texts!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Texts = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//texts!: arg 2: expected block, native or nil") + return env.NewError("Go(*widget.ParagraphSegment)//texts!: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } + self.Texts = newVal return arg0 }, }, @@ -86361,44 +86512,27 @@ var Builtins = map[string]*env.Builtin{ var self *widget.ParagraphSegment switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.ParagraphSegment) - if !ok { + if vc, ok := v.Value.(*widget.ParagraphSegment); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//texts?: arg 1: expected native of type *widget.ParagraphSegment") + return env.NewError("Go(*widget.ParagraphSegment)//texts?: arg 1: " + "expected native of type *widget.ParagraphSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//texts?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ParagraphSegment)//texts?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//texts?: arg 1: expected native") + return env.NewError("Go(*widget.ParagraphSegment)//texts?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object { items := make([]env.Object, len(self.Texts)) for i, it := range self.Texts { - { - typ := reflect.TypeOf(it) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - items[i] = *env.NewNative(ps.Idx, it, typRyeName) - } else { - items[i] = *env.NewNative(ps.Idx, it, "Go(widget.RichTextSegment)") - } - } + items[i] = ifaceToNative(ps.Idx, it, "Go(widget.RichTextSegment)") } resObj = *env.NewBlock(*env.NewTSeries(items)) } @@ -86412,21 +86546,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ParagraphSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ParagraphSegment) - if !ok { + if vc, ok := v.Value.(*widget.ParagraphSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//textual: arg 1: expected native of type *widget.ParagraphSegment") + return env.NewError("Go(*widget.ParagraphSegment)//textual: arg 1: " + "expected native of type *widget.ParagraphSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//textual: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ParagraphSegment)//textual: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//textual: arg 1: expected native") + return env.NewError("Go(*widget.ParagraphSegment)//textual: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Textual() var res0Obj env.Object @@ -86441,21 +86575,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ParagraphSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ParagraphSegment) - if !ok { + if vc, ok := v.Value.(*widget.ParagraphSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//unselect: arg 1: expected native of type *widget.ParagraphSegment") + return env.NewError("Go(*widget.ParagraphSegment)//unselect: arg 1: " + "expected native of type *widget.ParagraphSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//unselect: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ParagraphSegment)//unselect: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//unselect: arg 1: expected native") + return env.NewError("Go(*widget.ParagraphSegment)//unselect: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Unselect() return arg0 @@ -86468,21 +86602,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ParagraphSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ParagraphSegment) - if !ok { + if vc, ok := v.Value.(*widget.ParagraphSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//update: arg 1: expected native of type *widget.ParagraphSegment") + return env.NewError("Go(*widget.ParagraphSegment)//update: arg 1: " + "expected native of type *widget.ParagraphSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//update: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ParagraphSegment)//update: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//update: arg 1: expected native") + return env.NewError("Go(*widget.ParagraphSegment)//update: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.CanvasObject switch v := arg1.(type) { @@ -86491,24 +86625,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//update: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.ParagraphSegment)//update: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//update: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("Go(*widget.ParagraphSegment)//update: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//update: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ParagraphSegment)//update: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//update: arg 2: expected native") + return env.NewError("Go(*widget.ParagraphSegment)//update: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Update(arg1Val) return arg0 @@ -86521,43 +86655,100 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ParagraphSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ParagraphSegment) - if !ok { + if vc, ok := v.Value.(*widget.ParagraphSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//visual: arg 1: expected native of type *widget.ParagraphSegment") + return env.NewError("Go(*widget.ParagraphSegment)//visual: arg 1: " + "expected native of type *widget.ParagraphSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//visual: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ParagraphSegment)//visual: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ParagraphSegment)//visual: arg 1: expected native") + return env.NewError("Go(*widget.ParagraphSegment)//visual: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visual() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.CanvasObject)") + return res0Obj + }, + }, + "Go(*widget.PopUp)//base-widget!": { + Doc: "Set *widget.PopUp BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.PopUp + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.PopUp); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.PopUp)//base-widget!: arg 1: " + "expected native of type *widget.PopUp, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.PopUp)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.PopUp)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.CanvasObject)") + ps.FailureFlag = true + return env.NewError("Go(*widget.PopUp)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.PopUp)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.PopUp)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - return res0Obj + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*widget.PopUp)//base-widget?": { + Doc: "Get *widget.PopUp BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.PopUp + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.PopUp); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.PopUp)//base-widget?: arg 1: " + "expected native of type *widget.PopUp, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.PopUp)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.PopUp)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj }, }, "Go(*widget.PopUp)//canvas!": { @@ -86567,47 +86758,49 @@ var Builtins = map[string]*env.Builtin{ var self *widget.PopUp switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.PopUp) - if !ok { + if vc, ok := v.Value.(*widget.PopUp); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//canvas!: arg 1: expected native of type *widget.PopUp") + return env.NewError("Go(*widget.PopUp)//canvas!: arg 1: " + "expected native of type *widget.PopUp, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//canvas!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//canvas!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//canvas!: arg 1: expected native") + return env.NewError("Go(*widget.PopUp)//canvas!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.Canvas switch v := arg1.(type) { case env.RyeCtx: var err error - self.Canvas, err = ctxTo_fyne_Canvas(ps, v) + newVal, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//canvas!: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.PopUp)//canvas!: arg 2: " + err.Error()) } case env.Native: - var ok bool - self.Canvas, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//canvas!: arg 2: expected native of type fyne.Canvas") + return env.NewError("Go(*widget.PopUp)//canvas!: arg 2: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//canvas!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//canvas!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Canvas = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//canvas!: arg 2: expected native") + return env.NewError("Go(*widget.PopUp)//canvas!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Canvas = newVal return arg0 }, }, @@ -86618,41 +86811,24 @@ var Builtins = map[string]*env.Builtin{ var self *widget.PopUp switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.PopUp) - if !ok { + if vc, ok := v.Value.(*widget.PopUp); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//canvas?: arg 1: expected native of type *widget.PopUp") + return env.NewError("Go(*widget.PopUp)//canvas?: arg 1: " + "expected native of type *widget.PopUp, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//canvas?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//canvas?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//canvas?: arg 1: expected native") + return env.NewError("Go(*widget.PopUp)//canvas?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - { - typ := reflect.TypeOf(self.Canvas) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - resObj = *env.NewNative(ps.Idx, self.Canvas, typRyeName) - } else { - resObj = *env.NewNative(ps.Idx, self.Canvas, "Go(fyne.Canvas)") - } - } + resObj = ifaceToNative(ps.Idx, self.Canvas, "Go(fyne.Canvas)") return resObj }, }, @@ -86663,47 +86839,49 @@ var Builtins = map[string]*env.Builtin{ var self *widget.PopUp switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.PopUp) - if !ok { + if vc, ok := v.Value.(*widget.PopUp); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//content!: arg 1: expected native of type *widget.PopUp") + return env.NewError("Go(*widget.PopUp)//content!: arg 1: " + "expected native of type *widget.PopUp, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//content!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//content!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//content!: arg 1: expected native") + return env.NewError("Go(*widget.PopUp)//content!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.CanvasObject switch v := arg1.(type) { case env.RyeCtx: var err error - self.Content, err = ctxTo_fyne_CanvasObject(ps, v) + newVal, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//content!: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.PopUp)//content!: arg 2: " + err.Error()) } case env.Native: - var ok bool - self.Content, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//content!: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("Go(*widget.PopUp)//content!: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//content!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//content!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Content = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//content!: arg 2: expected native") + return env.NewError("Go(*widget.PopUp)//content!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Content = newVal return arg0 }, }, @@ -86714,41 +86892,24 @@ var Builtins = map[string]*env.Builtin{ var self *widget.PopUp switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.PopUp) - if !ok { + if vc, ok := v.Value.(*widget.PopUp); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//content?: arg 1: expected native of type *widget.PopUp") + return env.NewError("Go(*widget.PopUp)//content?: arg 1: " + "expected native of type *widget.PopUp, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//content?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//content?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//content?: arg 1: expected native") + return env.NewError("Go(*widget.PopUp)//content?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - { - typ := reflect.TypeOf(self.Content) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - resObj = *env.NewNative(ps.Idx, self.Content, typRyeName) - } else { - resObj = *env.NewNative(ps.Idx, self.Content, "Go(fyne.CanvasObject)") - } - } + resObj = ifaceToNative(ps.Idx, self.Content, "Go(fyne.CanvasObject)") return resObj }, }, @@ -86759,42 +86920,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUp switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUp) - if !ok { + if vc, ok := v.Value.(*widget.PopUp); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//create-renderer: arg 1: expected native of type *widget.PopUp") + return env.NewError("Go(*widget.PopUp)//create-renderer: arg 1: " + "expected native of type *widget.PopUp, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//create-renderer: arg 1: expected native") + return env.NewError("Go(*widget.PopUp)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -86805,21 +86949,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUp switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUp) - if !ok { + if vc, ok := v.Value.(*widget.PopUp); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//extend-base-widget: arg 1: expected native of type *widget.PopUp") + return env.NewError("Go(*widget.PopUp)//extend-base-widget: arg 1: " + "expected native of type *widget.PopUp, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.PopUp)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -86828,24 +86972,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.PopUp)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.PopUp)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.PopUp)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -86858,28 +87002,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.PopUp switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.PopUp) - if !ok { + if vc, ok := v.Value.(*widget.PopUp); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//hidden!: arg 1: expected native of type *widget.PopUp") + return env.NewError("Go(*widget.PopUp)//hidden!: arg 1: " + "expected native of type *widget.PopUp, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.PopUp)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.PopUp)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -86890,21 +87036,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.PopUp switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.PopUp) - if !ok { + if vc, ok := v.Value.(*widget.PopUp); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//hidden?: arg 1: expected native of type *widget.PopUp") + return env.NewError("Go(*widget.PopUp)//hidden?: arg 1: " + "expected native of type *widget.PopUp, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.PopUp)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -86918,21 +87064,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUp switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUp) - if !ok { + if vc, ok := v.Value.(*widget.PopUp); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//hide: arg 1: expected native of type *widget.PopUp") + return env.NewError("Go(*widget.PopUp)//hide: arg 1: " + "expected native of type *widget.PopUp, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//hide: arg 1: expected native") + return env.NewError("Go(*widget.PopUp)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -86945,21 +87091,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUp switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUp) - if !ok { + if vc, ok := v.Value.(*widget.PopUp); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//min-size: arg 1: expected native of type *widget.PopUp") + return env.NewError("Go(*widget.PopUp)//min-size: arg 1: " + "expected native of type *widget.PopUp, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.PopUp)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -86974,42 +87120,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUp switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUp) - if !ok { + if vc, ok := v.Value.(*widget.PopUp); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//move: arg 1: expected native of type *widget.PopUp") + return env.NewError("Go(*widget.PopUp)//move: arg 1: " + "expected native of type *widget.PopUp, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//move: arg 1: expected native") + return env.NewError("Go(*widget.PopUp)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//move: arg 2: expected native") + return env.NewError("Go(*widget.PopUp)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -87020,21 +87160,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUp switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUp) - if !ok { + if vc, ok := v.Value.(*widget.PopUp); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//position: arg 1: expected native of type *widget.PopUp") + return env.NewError("Go(*widget.PopUp)//position: arg 1: " + "expected native of type *widget.PopUp, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//position: arg 1: expected native") + return env.NewError("Go(*widget.PopUp)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -87049,21 +87189,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUp switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUp) - if !ok { + if vc, ok := v.Value.(*widget.PopUp); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//refresh: arg 1: expected native of type *widget.PopUp") + return env.NewError("Go(*widget.PopUp)//refresh: arg 1: " + "expected native of type *widget.PopUp, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.PopUp)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -87076,42 +87216,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUp switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUp) - if !ok { + if vc, ok := v.Value.(*widget.PopUp); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//resize: arg 1: expected native of type *widget.PopUp") + return env.NewError("Go(*widget.PopUp)//resize: arg 1: " + "expected native of type *widget.PopUp, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//resize: arg 1: expected native") + return env.NewError("Go(*widget.PopUp)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//resize: arg 2: expected native") + return env.NewError("Go(*widget.PopUp)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -87122,21 +87256,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUp switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUp) - if !ok { + if vc, ok := v.Value.(*widget.PopUp); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//show: arg 1: expected native of type *widget.PopUp") + return env.NewError("Go(*widget.PopUp)//show: arg 1: " + "expected native of type *widget.PopUp, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//show: arg 1: expected native") + return env.NewError("Go(*widget.PopUp)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -87149,42 +87283,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUp switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUp) - if !ok { + if vc, ok := v.Value.(*widget.PopUp); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//show-at-position: arg 1: expected native of type *widget.PopUp") + return env.NewError("Go(*widget.PopUp)//show-at-position: arg 1: " + "expected native of type *widget.PopUp, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//show-at-position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//show-at-position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//show-at-position: arg 1: expected native") + return env.NewError("Go(*widget.PopUp)//show-at-position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//show-at-position: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//show-at-position: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//show-at-position: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//show-at-position: arg 2: expected native") + return env.NewError("Go(*widget.PopUp)//show-at-position: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.ShowAtPosition(*arg1Val) + arg0Val.ShowAtPosition(arg1Val) return arg0 }, }, @@ -87195,40 +87323,34 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUp switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUp) - if !ok { + if vc, ok := v.Value.(*widget.PopUp); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//show-at-relative-position: arg 1: expected native of type *widget.PopUp") + return env.NewError("Go(*widget.PopUp)//show-at-relative-position: arg 1: " + "expected native of type *widget.PopUp, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//show-at-relative-position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//show-at-relative-position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//show-at-relative-position: arg 1: expected native") + return env.NewError("Go(*widget.PopUp)//show-at-relative-position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//show-at-relative-position: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//show-at-relative-position: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//show-at-relative-position: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//show-at-relative-position: arg 2: expected native") + return env.NewError("Go(*widget.PopUp)//show-at-relative-position: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg2Val fyne.CanvasObject switch v := arg2.(type) { @@ -87237,26 +87359,26 @@ var Builtins = map[string]*env.Builtin{ arg2Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//show-at-relative-position: arg 3: " + err.Error() + "") + return env.NewError("Go(*widget.PopUp)//show-at-relative-position: arg 3: " + err.Error()) } case env.Native: - var ok bool - arg2Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//show-at-relative-position: arg 3: expected native of type fyne.CanvasObject") + return env.NewError("Go(*widget.PopUp)//show-at-relative-position: arg 3: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//show-at-relative-position: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//show-at-relative-position: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//show-at-relative-position: arg 3: expected native") + return env.NewError("Go(*widget.PopUp)//show-at-relative-position: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.ShowAtRelativePosition(*arg1Val, arg2Val) + arg0Val.ShowAtRelativePosition(arg1Val, arg2Val) return arg0 }, }, @@ -87267,21 +87389,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUp switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUp) - if !ok { + if vc, ok := v.Value.(*widget.PopUp); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//size: arg 1: expected native of type *widget.PopUp") + return env.NewError("Go(*widget.PopUp)//size: arg 1: " + "expected native of type *widget.PopUp, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//size: arg 1: expected native") + return env.NewError("Go(*widget.PopUp)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -87296,40 +87418,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUp switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUp) - if !ok { + if vc, ok := v.Value.(*widget.PopUp); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//tapped: arg 1: expected native of type *widget.PopUp") + return env.NewError("Go(*widget.PopUp)//tapped: arg 1: " + "expected native of type *widget.PopUp, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//tapped: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//tapped: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//tapped: arg 1: expected native") + return env.NewError("Go(*widget.PopUp)//tapped: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.PointEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.PointEvent) - if !ok { + if vc, ok := v.Value.(*fyne.PointEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//tapped: arg 2: expected native of type *fyne.PointEvent") + return env.NewError("Go(*widget.PopUp)//tapped: arg 2: " + "expected native of type *fyne.PointEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//tapped: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//tapped: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//tapped: arg 2: expected native") + return env.NewError("Go(*widget.PopUp)//tapped: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Tapped(arg1Val) return arg0 @@ -87342,40 +87464,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUp switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUp) - if !ok { + if vc, ok := v.Value.(*widget.PopUp); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//tapped-secondary: arg 1: expected native of type *widget.PopUp") + return env.NewError("Go(*widget.PopUp)//tapped-secondary: arg 1: " + "expected native of type *widget.PopUp, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//tapped-secondary: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//tapped-secondary: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//tapped-secondary: arg 1: expected native") + return env.NewError("Go(*widget.PopUp)//tapped-secondary: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.PointEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.PointEvent) - if !ok { + if vc, ok := v.Value.(*fyne.PointEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//tapped-secondary: arg 2: expected native of type *fyne.PointEvent") + return env.NewError("Go(*widget.PopUp)//tapped-secondary: arg 2: " + "expected native of type *fyne.PointEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//tapped-secondary: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//tapped-secondary: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//tapped-secondary: arg 2: expected native") + return env.NewError("Go(*widget.PopUp)//tapped-secondary: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TappedSecondary(arg1Val) return arg0 @@ -87388,21 +87510,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUp switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUp) - if !ok { + if vc, ok := v.Value.(*widget.PopUp); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//visible: arg 1: expected native of type *widget.PopUp") + return env.NewError("Go(*widget.PopUp)//visible: arg 1: " + "expected native of type *widget.PopUp, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUp)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUp)//visible: arg 1: expected native") + return env.NewError("Go(*widget.PopUp)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -87417,21 +87539,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//activate-last-submenu: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//activate-last-submenu: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//activate-last-submenu: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//activate-last-submenu: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//activate-last-submenu: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//activate-last-submenu: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.ActivateLastSubmenu() var res0Obj env.Object @@ -87446,21 +87568,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//activate-next: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//activate-next: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//activate-next: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//activate-next: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//activate-next: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//activate-next: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ActivateNext() return arg0 @@ -87473,26 +87595,100 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//activate-previous: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//activate-previous: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//activate-previous: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//activate-previous: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//activate-previous: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//activate-previous: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ActivatePrevious() return arg0 }, }, + "Go(*widget.PopUpMenu)//base-widget!": { + Doc: "Set *widget.PopUpMenu BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.PopUpMenu + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.PopUpMenu)//base-widget!: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.PopUpMenu)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.PopUpMenu)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.PopUpMenu)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.PopUpMenu)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.PopUpMenu)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*widget.PopUpMenu)//base-widget?": { + Doc: "Get *widget.PopUpMenu BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.PopUpMenu + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.PopUpMenu)//base-widget?: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.PopUpMenu)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.PopUpMenu)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj + }, + }, "Go(*widget.PopUpMenu)//create-renderer": { Doc: "(*widget.PopUpMenu).CreateRenderer", Argsn: 1, @@ -87500,42 +87696,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//create-renderer: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//create-renderer: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//create-renderer: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -87546,21 +87725,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//deactivate-child: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//deactivate-child: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//deactivate-child: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//deactivate-child: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//deactivate-child: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//deactivate-child: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.DeactivateChild() return arg0 @@ -87573,21 +87752,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//deactivate-last-submenu: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//deactivate-last-submenu: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//deactivate-last-submenu: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//deactivate-last-submenu: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//deactivate-last-submenu: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//deactivate-last-submenu: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.DeactivateLastSubmenu() var res0Obj env.Object @@ -87602,21 +87781,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//dismiss: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//dismiss: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//dismiss: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//dismiss: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//dismiss: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//dismiss: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Dismiss() return arg0 @@ -87629,21 +87808,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//extend-base-widget: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//extend-base-widget: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -87652,24 +87831,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.PopUpMenu)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.PopUpMenu)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.PopUpMenu)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -87682,21 +87861,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//focus-gained: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//focus-gained: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//focus-gained: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//focus-gained: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//focus-gained: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//focus-gained: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusGained() return arg0 @@ -87709,21 +87888,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//focus-lost: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//focus-lost: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//focus-lost: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//focus-lost: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//focus-lost: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//focus-lost: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusLost() return arg0 @@ -87736,28 +87915,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//hidden!: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//hidden!: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.PopUpMenu)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -87768,21 +87949,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//hidden?: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//hidden?: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -87796,21 +87977,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//hide: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//hide: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//hide: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -87823,69 +88004,64 @@ var Builtins = map[string]*env.Builtin{ var self *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//items!: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//items!: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//items!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//items!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//items!: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//items!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal []fyne.CanvasObject switch v := arg1.(type) { case env.Block: - self.Items = make([]fyne.CanvasObject, len(v.Series.S)) + newVal = make([]fyne.CanvasObject, len(v.Series.S)) for i, it := range v.Series.S { switch v := it.(type) { case env.RyeCtx: var err error - self.Items[i], err = ctxTo_fyne_CanvasObject(ps, v) + newVal[i], err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//items!: arg 2: block item: " + err.Error() + "") + return env.NewError("Go(*widget.PopUpMenu)//items!: arg 2: " + "block item: " + err.Error()) } case env.Native: - var ok bool - self.Items[i], ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + newVal[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//items!: arg 2: block item: expected native of type fyne.CanvasObject") + return env.NewError("Go(*widget.PopUpMenu)//items!: arg 2: " + "block item: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//items!: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//items!: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Items[i] = nil + newVal[i] = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//items!: arg 2: block item: expected native") + return env.NewError("Go(*widget.PopUpMenu)//items!: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - self.Items, ok = v.Value.([]fyne.CanvasObject) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//items!: arg 2: expected native of type []fyne.CanvasObject") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//items!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//items!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Items = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//items!: arg 2: expected block, native or nil") + return env.NewError("Go(*widget.PopUpMenu)//items!: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } + self.Items = newVal return arg0 }, }, @@ -87896,50 +88072,107 @@ var Builtins = map[string]*env.Builtin{ var self *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//items?: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//items?: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//items?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//items?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//items?: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//items?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object { items := make([]env.Object, len(self.Items)) for i, it := range self.Items { - { - typ := reflect.TypeOf(it) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - items[i] = *env.NewNative(ps.Idx, it, typRyeName) - } else { - items[i] = *env.NewNative(ps.Idx, it, "Go(fyne.CanvasObject)") - } - } + items[i] = ifaceToNative(ps.Idx, it, "Go(fyne.CanvasObject)") } resObj = *env.NewBlock(*env.NewTSeries(items)) } return resObj }, }, + "Go(*widget.PopUpMenu)//menu!": { + Doc: "Set *widget.PopUpMenu Menu value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.PopUpMenu + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.PopUpMenu)//menu!: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.PopUpMenu)//menu!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.PopUpMenu)//menu!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.Menu + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Menu); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.PopUpMenu)//menu!: arg 2: " + "expected native of type *widget.Menu, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.PopUpMenu)//menu!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.PopUpMenu)//menu!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.Menu = newVal + return arg0 + }, + }, + "Go(*widget.PopUpMenu)//menu?": { + Doc: "Get *widget.PopUpMenu Menu value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.PopUpMenu + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.PopUpMenu)//menu?: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.PopUpMenu)//menu?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.PopUpMenu)//menu?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, self.Menu, "Go(*widget.Menu)") + return resObj + }, + }, "Go(*widget.PopUpMenu)//min-size": { Doc: "(*widget.PopUpMenu).MinSize", Argsn: 1, @@ -87947,21 +88180,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//min-size: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//min-size: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -87976,42 +88209,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//move: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//move: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//move: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//move: arg 2: expected native") + return env.NewError("Go(*widget.PopUpMenu)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -88022,29 +88249,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//on-dismiss!: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//on-dismiss!: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//on-dismiss!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//on-dismiss!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//on-dismiss!: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//on-dismiss!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func() switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//on-dismiss!: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(*widget.PopUpMenu)//on-dismiss!: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnDismiss = func() { + newVal = func() { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, ps.Ctx) @@ -88052,13 +88280,14 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//on-dismiss!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//on-dismiss!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnDismiss = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//on-dismiss!: arg 2: expected function or nil") + return env.NewError("Go(*widget.PopUpMenu)//on-dismiss!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnDismiss = newVal return arg0 }, }, @@ -88069,24 +88298,27 @@ var Builtins = map[string]*env.Builtin{ var self *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//on-dismiss?: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//on-dismiss?: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//on-dismiss?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//on-dismiss?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//on-dismiss?: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//on-dismiss?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnDismiss, "Go(func())") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + self.OnDismiss() + return nil + }, 0, false, false, "Returned func") return resObj }, }, @@ -88097,21 +88329,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//position: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//position: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//position: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -88126,21 +88358,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//refresh: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//refresh: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -88153,42 +88385,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//resize: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//resize: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//resize: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//resize: arg 2: expected native") + return env.NewError("Go(*widget.PopUpMenu)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -88199,21 +88425,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//show: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//show: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//show: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -88226,42 +88452,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//show-at-position: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//show-at-position: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//show-at-position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//show-at-position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//show-at-position: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//show-at-position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//show-at-position: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//show-at-position: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//show-at-position: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//show-at-position: arg 2: expected native") + return env.NewError("Go(*widget.PopUpMenu)//show-at-position: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.ShowAtPosition(*arg1Val) + arg0Val.ShowAtPosition(arg1Val) return arg0 }, }, @@ -88272,40 +88492,34 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//show-at-relative-position: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//show-at-relative-position: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//show-at-relative-position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//show-at-relative-position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//show-at-relative-position: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//show-at-relative-position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//show-at-relative-position: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//show-at-relative-position: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//show-at-relative-position: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//show-at-relative-position: arg 2: expected native") + return env.NewError("Go(*widget.PopUpMenu)//show-at-relative-position: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg2Val fyne.CanvasObject switch v := arg2.(type) { @@ -88314,26 +88528,26 @@ var Builtins = map[string]*env.Builtin{ arg2Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//show-at-relative-position: arg 3: " + err.Error() + "") + return env.NewError("Go(*widget.PopUpMenu)//show-at-relative-position: arg 3: " + err.Error()) } case env.Native: - var ok bool - arg2Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//show-at-relative-position: arg 3: expected native of type fyne.CanvasObject") + return env.NewError("Go(*widget.PopUpMenu)//show-at-relative-position: arg 3: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//show-at-relative-position: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//show-at-relative-position: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//show-at-relative-position: arg 3: expected native") + return env.NewError("Go(*widget.PopUpMenu)//show-at-relative-position: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.ShowAtRelativePosition(*arg1Val, arg2Val) + arg0Val.ShowAtRelativePosition(arg1Val, arg2Val) return arg0 }, }, @@ -88344,21 +88558,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//size: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//size: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//size: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -88373,40 +88587,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//tapped: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//tapped: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//tapped: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//tapped: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//tapped: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//tapped: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.PointEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.PointEvent) - if !ok { + if vc, ok := v.Value.(*fyne.PointEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//tapped: arg 2: expected native of type *fyne.PointEvent") + return env.NewError("Go(*widget.PopUpMenu)//tapped: arg 2: " + "expected native of type *fyne.PointEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//tapped: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//tapped: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//tapped: arg 2: expected native") + return env.NewError("Go(*widget.PopUpMenu)//tapped: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Tapped(arg1Val) return arg0 @@ -88419,21 +88633,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//trigger-last: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//trigger-last: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//trigger-last: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//trigger-last: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//trigger-last: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//trigger-last: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TriggerLast() return arg0 @@ -88446,40 +88660,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//typed-key: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//typed-key: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//typed-key: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//typed-key: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//typed-key: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//typed-key: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.KeyEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.KeyEvent) - if !ok { + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//typed-key: arg 2: expected native of type *fyne.KeyEvent") + return env.NewError("Go(*widget.PopUpMenu)//typed-key: arg 2: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//typed-key: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//typed-key: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//typed-key: arg 2: expected native") + return env.NewError("Go(*widget.PopUpMenu)//typed-key: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedKey(arg1Val) return arg0 @@ -88492,34 +88706,34 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//typed-rune: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//typed-rune: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//typed-rune: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//typed-rune: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//typed-rune: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//typed-rune: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val rune switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//typed-rune: arg 2: expected native of type rune") + return env.NewError("Go(*widget.PopUpMenu)//typed-rune: arg 2: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//typed-rune: arg 2: expected native") + return env.NewError("Go(*widget.PopUpMenu)//typed-rune: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedRune(arg1Val) return arg0 @@ -88532,21 +88746,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.PopUpMenu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.PopUpMenu) - if !ok { + if vc, ok := v.Value.(*widget.PopUpMenu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//visible: arg 1: expected native of type *widget.PopUpMenu") + return env.NewError("Go(*widget.PopUpMenu)//visible: arg 1: " + "expected native of type *widget.PopUpMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.PopUpMenu)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.PopUpMenu)//visible: arg 1: expected native") + return env.NewError("Go(*widget.PopUpMenu)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -88554,6 +88768,80 @@ var Builtins = map[string]*env.Builtin{ return res0Obj }, }, + "Go(*widget.ProgressBar)//base-widget!": { + Doc: "Set *widget.ProgressBar BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.ProgressBar + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.ProgressBar); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.ProgressBar)//base-widget!: arg 1: " + "expected native of type *widget.ProgressBar, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.ProgressBar)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.ProgressBar)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.ProgressBar)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.ProgressBar)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.ProgressBar)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*widget.ProgressBar)//base-widget?": { + Doc: "Get *widget.ProgressBar BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.ProgressBar + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.ProgressBar); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.ProgressBar)//base-widget?: arg 1: " + "expected native of type *widget.ProgressBar, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.ProgressBar)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.ProgressBar)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj + }, + }, "Go(*widget.ProgressBar)//bind": { Doc: "(*widget.ProgressBar).Bind", Argsn: 2, @@ -88561,21 +88849,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ProgressBar switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ProgressBar) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBar); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//bind: arg 1: expected native of type *widget.ProgressBar") + return env.NewError("Go(*widget.ProgressBar)//bind: arg 1: " + "expected native of type *widget.ProgressBar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//bind: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBar)//bind: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//bind: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBar)//bind: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.Float switch v := arg1.(type) { @@ -88584,24 +88872,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_Float(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//bind: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.ProgressBar)//bind: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.Float) - if !ok { + if vc, ok := v.Value.(binding.Float); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//bind: arg 2: expected native of type binding.Float") + return env.NewError("Go(*widget.ProgressBar)//bind: arg 2: " + "expected native of type binding.Float, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//bind: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBar)//bind: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//bind: arg 2: expected native") + return env.NewError("Go(*widget.ProgressBar)//bind: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Bind(arg1Val) return arg0 @@ -88614,42 +88902,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ProgressBar switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ProgressBar) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBar); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//create-renderer: arg 1: expected native of type *widget.ProgressBar") + return env.NewError("Go(*widget.ProgressBar)//create-renderer: arg 1: " + "expected native of type *widget.ProgressBar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBar)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//create-renderer: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBar)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -88660,21 +88931,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ProgressBar switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ProgressBar) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBar); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//extend-base-widget: arg 1: expected native of type *widget.ProgressBar") + return env.NewError("Go(*widget.ProgressBar)//extend-base-widget: arg 1: " + "expected native of type *widget.ProgressBar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBar)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBar)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -88683,24 +88954,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.ProgressBar)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.ProgressBar)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBar)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.ProgressBar)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -88713,28 +88984,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.ProgressBar switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.ProgressBar) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBar); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//hidden!: arg 1: expected native of type *widget.ProgressBar") + return env.NewError("Go(*widget.ProgressBar)//hidden!: arg 1: " + "expected native of type *widget.ProgressBar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBar)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBar)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.ProgressBar)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -88745,21 +89018,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.ProgressBar switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.ProgressBar) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBar); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//hidden?: arg 1: expected native of type *widget.ProgressBar") + return env.NewError("Go(*widget.ProgressBar)//hidden?: arg 1: " + "expected native of type *widget.ProgressBar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBar)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBar)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -88773,21 +89046,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ProgressBar switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ProgressBar) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBar); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//hide: arg 1: expected native of type *widget.ProgressBar") + return env.NewError("Go(*widget.ProgressBar)//hide: arg 1: " + "expected native of type *widget.ProgressBar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBar)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//hide: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBar)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -88800,28 +89073,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.ProgressBar switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.ProgressBar) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBar); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//max!: arg 1: expected native of type *widget.ProgressBar") + return env.NewError("Go(*widget.ProgressBar)//max!: arg 1: " + "expected native of type *widget.ProgressBar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//max!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBar)//max!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//max!: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBar)//max!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Decimal); ok { - self.Max = float64(v.Value) + var newVal float64 + if vc, ok := arg1.(env.Decimal); ok { + newVal = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//max!: arg 2: expected decimal") + return env.NewError("Go(*widget.ProgressBar)//max!: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } + self.Max = newVal return arg0 }, }, @@ -88832,21 +89107,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.ProgressBar switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.ProgressBar) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBar); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//max?: arg 1: expected native of type *widget.ProgressBar") + return env.NewError("Go(*widget.ProgressBar)//max?: arg 1: " + "expected native of type *widget.ProgressBar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//max?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBar)//max?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//max?: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBar)//max?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewDecimal(float64(self.Max)) @@ -88860,28 +89135,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.ProgressBar switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.ProgressBar) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBar); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//min!: arg 1: expected native of type *widget.ProgressBar") + return env.NewError("Go(*widget.ProgressBar)//min!: arg 1: " + "expected native of type *widget.ProgressBar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//min!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBar)//min!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//min!: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBar)//min!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Decimal); ok { - self.Min = float64(v.Value) + var newVal float64 + if vc, ok := arg1.(env.Decimal); ok { + newVal = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//min!: arg 2: expected decimal") + return env.NewError("Go(*widget.ProgressBar)//min!: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } + self.Min = newVal return arg0 }, }, @@ -88892,21 +89169,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ProgressBar switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ProgressBar) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBar); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//min-size: arg 1: expected native of type *widget.ProgressBar") + return env.NewError("Go(*widget.ProgressBar)//min-size: arg 1: " + "expected native of type *widget.ProgressBar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBar)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBar)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -88921,21 +89198,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.ProgressBar switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.ProgressBar) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBar); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//min?: arg 1: expected native of type *widget.ProgressBar") + return env.NewError("Go(*widget.ProgressBar)//min?: arg 1: " + "expected native of type *widget.ProgressBar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//min?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBar)//min?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//min?: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBar)//min?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewDecimal(float64(self.Min)) @@ -88949,42 +89226,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ProgressBar switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ProgressBar) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBar); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//move: arg 1: expected native of type *widget.ProgressBar") + return env.NewError("Go(*widget.ProgressBar)//move: arg 1: " + "expected native of type *widget.ProgressBar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBar)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//move: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBar)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBar)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//move: arg 2: expected native") + return env.NewError("Go(*widget.ProgressBar)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -88995,21 +89266,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ProgressBar switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ProgressBar) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBar); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//position: arg 1: expected native of type *widget.ProgressBar") + return env.NewError("Go(*widget.ProgressBar)//position: arg 1: " + "expected native of type *widget.ProgressBar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBar)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//position: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBar)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -89024,21 +89295,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ProgressBar switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ProgressBar) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBar); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//refresh: arg 1: expected native of type *widget.ProgressBar") + return env.NewError("Go(*widget.ProgressBar)//refresh: arg 1: " + "expected native of type *widget.ProgressBar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBar)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBar)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -89051,42 +89322,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ProgressBar switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ProgressBar) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBar); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//resize: arg 1: expected native of type *widget.ProgressBar") + return env.NewError("Go(*widget.ProgressBar)//resize: arg 1: " + "expected native of type *widget.ProgressBar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBar)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//resize: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBar)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBar)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//resize: arg 2: expected native") + return env.NewError("Go(*widget.ProgressBar)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -89097,28 +89362,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ProgressBar switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ProgressBar) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBar); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//set-value: arg 1: expected native of type *widget.ProgressBar") + return env.NewError("Go(*widget.ProgressBar)//set-value: arg 1: " + "expected native of type *widget.ProgressBar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBar)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//set-value: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBar)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val float64 - if v, ok := arg1.(env.Decimal); ok { - arg1Val = float64(v.Value) + if vc, ok := arg1.(env.Decimal); ok { + arg1Val = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//set-value: arg 2: expected decimal") + return env.NewError("Go(*widget.ProgressBar)//set-value: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetValue(arg1Val) return arg0 @@ -89131,21 +89396,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ProgressBar switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ProgressBar) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBar); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//show: arg 1: expected native of type *widget.ProgressBar") + return env.NewError("Go(*widget.ProgressBar)//show: arg 1: " + "expected native of type *widget.ProgressBar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBar)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//show: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBar)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -89158,21 +89423,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ProgressBar switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ProgressBar) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBar); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//size: arg 1: expected native of type *widget.ProgressBar") + return env.NewError("Go(*widget.ProgressBar)//size: arg 1: " + "expected native of type *widget.ProgressBar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBar)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//size: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBar)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -89187,38 +89452,40 @@ var Builtins = map[string]*env.Builtin{ var self *widget.ProgressBar switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.ProgressBar) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBar); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//text-formatter!: arg 1: expected native of type *widget.ProgressBar") + return env.NewError("Go(*widget.ProgressBar)//text-formatter!: arg 1: " + "expected native of type *widget.ProgressBar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//text-formatter!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBar)//text-formatter!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//text-formatter!: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBar)//text-formatter!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func() string switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//text-formatter!: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(*widget.ProgressBar)//text-formatter!: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.TextFormatter = func() string { + newVal = func() string { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, ps.Ctx) var res string - if v, ok := ps.Res.(env.String); ok { - res = string(v.Value) + if vc, ok := ps.Res.(env.String); ok { + res = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.ProgressBar)//text-formatter!: arg 2: callback result: expected string", + "Go(*widget.ProgressBar)//text-formatter!: arg 2: callback result: "+"expected string, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -89229,13 +89496,14 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//text-formatter!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBar)//text-formatter!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.TextFormatter = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//text-formatter!: arg 2: expected function or nil") + return env.NewError("Go(*widget.ProgressBar)//text-formatter!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.TextFormatter = newVal return arg0 }, }, @@ -89246,24 +89514,29 @@ var Builtins = map[string]*env.Builtin{ var self *widget.ProgressBar switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.ProgressBar) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBar); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//text-formatter?: arg 1: expected native of type *widget.ProgressBar") + return env.NewError("Go(*widget.ProgressBar)//text-formatter?: arg 1: " + "expected native of type *widget.ProgressBar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//text-formatter?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBar)//text-formatter?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//text-formatter?: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBar)//text-formatter?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.TextFormatter, "Go(func() (string))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + res0 := self.TextFormatter() + var res0Obj env.Object + res0Obj = *env.NewString(res0) + return res0Obj + }, 0, false, false, "Returned func") return resObj }, }, @@ -89274,21 +89547,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ProgressBar switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ProgressBar) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBar); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//unbind: arg 1: expected native of type *widget.ProgressBar") + return env.NewError("Go(*widget.ProgressBar)//unbind: arg 1: " + "expected native of type *widget.ProgressBar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//unbind: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBar)//unbind: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//unbind: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBar)//unbind: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Unbind() return arg0 @@ -89301,28 +89574,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.ProgressBar switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.ProgressBar) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBar); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//value!: arg 1: expected native of type *widget.ProgressBar") + return env.NewError("Go(*widget.ProgressBar)//value!: arg 1: " + "expected native of type *widget.ProgressBar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//value!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBar)//value!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//value!: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBar)//value!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Decimal); ok { - self.Value = float64(v.Value) + var newVal float64 + if vc, ok := arg1.(env.Decimal); ok { + newVal = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//value!: arg 2: expected decimal") + return env.NewError("Go(*widget.ProgressBar)//value!: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } + self.Value = newVal return arg0 }, }, @@ -89333,21 +89608,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.ProgressBar switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.ProgressBar) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBar); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//value?: arg 1: expected native of type *widget.ProgressBar") + return env.NewError("Go(*widget.ProgressBar)//value?: arg 1: " + "expected native of type *widget.ProgressBar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//value?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBar)//value?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//value?: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBar)//value?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewDecimal(float64(self.Value)) @@ -89361,21 +89636,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ProgressBar switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ProgressBar) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBar); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//visible: arg 1: expected native of type *widget.ProgressBar") + return env.NewError("Go(*widget.ProgressBar)//visible: arg 1: " + "expected native of type *widget.ProgressBar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBar)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBar)//visible: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBar)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -89383,6 +89658,80 @@ var Builtins = map[string]*env.Builtin{ return res0Obj }, }, + "Go(*widget.ProgressBarInfinite)//base-widget!": { + Doc: "Set *widget.ProgressBarInfinite BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.ProgressBarInfinite + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.ProgressBarInfinite); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.ProgressBarInfinite)//base-widget!: arg 1: " + "expected native of type *widget.ProgressBarInfinite, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.ProgressBarInfinite)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.ProgressBarInfinite)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.ProgressBarInfinite)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.ProgressBarInfinite)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.ProgressBarInfinite)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*widget.ProgressBarInfinite)//base-widget?": { + Doc: "Get *widget.ProgressBarInfinite BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.ProgressBarInfinite + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.ProgressBarInfinite); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.ProgressBarInfinite)//base-widget?: arg 1: " + "expected native of type *widget.ProgressBarInfinite, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.ProgressBarInfinite)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.ProgressBarInfinite)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj + }, + }, "Go(*widget.ProgressBarInfinite)//create-renderer": { Doc: "(*widget.ProgressBarInfinite).CreateRenderer", Argsn: 1, @@ -89390,42 +89739,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ProgressBarInfinite switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ProgressBarInfinite) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBarInfinite); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//create-renderer: arg 1: expected native of type *widget.ProgressBarInfinite") + return env.NewError("Go(*widget.ProgressBarInfinite)//create-renderer: arg 1: " + "expected native of type *widget.ProgressBarInfinite, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBarInfinite)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//create-renderer: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBarInfinite)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -89436,21 +89768,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ProgressBarInfinite switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ProgressBarInfinite) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBarInfinite); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//extend-base-widget: arg 1: expected native of type *widget.ProgressBarInfinite") + return env.NewError("Go(*widget.ProgressBarInfinite)//extend-base-widget: arg 1: " + "expected native of type *widget.ProgressBarInfinite, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBarInfinite)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBarInfinite)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -89459,24 +89791,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.ProgressBarInfinite)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.ProgressBarInfinite)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBarInfinite)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.ProgressBarInfinite)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -89489,28 +89821,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.ProgressBarInfinite switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.ProgressBarInfinite) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBarInfinite); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//hidden!: arg 1: expected native of type *widget.ProgressBarInfinite") + return env.NewError("Go(*widget.ProgressBarInfinite)//hidden!: arg 1: " + "expected native of type *widget.ProgressBarInfinite, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBarInfinite)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBarInfinite)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.ProgressBarInfinite)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -89521,21 +89855,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.ProgressBarInfinite switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.ProgressBarInfinite) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBarInfinite); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//hidden?: arg 1: expected native of type *widget.ProgressBarInfinite") + return env.NewError("Go(*widget.ProgressBarInfinite)//hidden?: arg 1: " + "expected native of type *widget.ProgressBarInfinite, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBarInfinite)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBarInfinite)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -89549,21 +89883,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ProgressBarInfinite switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ProgressBarInfinite) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBarInfinite); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//hide: arg 1: expected native of type *widget.ProgressBarInfinite") + return env.NewError("Go(*widget.ProgressBarInfinite)//hide: arg 1: " + "expected native of type *widget.ProgressBarInfinite, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBarInfinite)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//hide: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBarInfinite)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -89576,21 +89910,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ProgressBarInfinite switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ProgressBarInfinite) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBarInfinite); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//min-size: arg 1: expected native of type *widget.ProgressBarInfinite") + return env.NewError("Go(*widget.ProgressBarInfinite)//min-size: arg 1: " + "expected native of type *widget.ProgressBarInfinite, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBarInfinite)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBarInfinite)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -89605,42 +89939,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ProgressBarInfinite switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ProgressBarInfinite) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBarInfinite); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//move: arg 1: expected native of type *widget.ProgressBarInfinite") + return env.NewError("Go(*widget.ProgressBarInfinite)//move: arg 1: " + "expected native of type *widget.ProgressBarInfinite, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBarInfinite)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//move: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBarInfinite)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBarInfinite)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//move: arg 2: expected native") + return env.NewError("Go(*widget.ProgressBarInfinite)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -89651,21 +89979,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ProgressBarInfinite switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ProgressBarInfinite) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBarInfinite); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//position: arg 1: expected native of type *widget.ProgressBarInfinite") + return env.NewError("Go(*widget.ProgressBarInfinite)//position: arg 1: " + "expected native of type *widget.ProgressBarInfinite, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBarInfinite)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//position: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBarInfinite)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -89680,21 +90008,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ProgressBarInfinite switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ProgressBarInfinite) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBarInfinite); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//refresh: arg 1: expected native of type *widget.ProgressBarInfinite") + return env.NewError("Go(*widget.ProgressBarInfinite)//refresh: arg 1: " + "expected native of type *widget.ProgressBarInfinite, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBarInfinite)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBarInfinite)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -89707,42 +90035,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ProgressBarInfinite switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ProgressBarInfinite) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBarInfinite); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//resize: arg 1: expected native of type *widget.ProgressBarInfinite") + return env.NewError("Go(*widget.ProgressBarInfinite)//resize: arg 1: " + "expected native of type *widget.ProgressBarInfinite, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBarInfinite)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//resize: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBarInfinite)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBarInfinite)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//resize: arg 2: expected native") + return env.NewError("Go(*widget.ProgressBarInfinite)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -89753,21 +90075,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ProgressBarInfinite switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ProgressBarInfinite) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBarInfinite); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//running: arg 1: expected native of type *widget.ProgressBarInfinite") + return env.NewError("Go(*widget.ProgressBarInfinite)//running: arg 1: " + "expected native of type *widget.ProgressBarInfinite, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//running: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBarInfinite)//running: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//running: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBarInfinite)//running: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Running() var res0Obj env.Object @@ -89782,21 +90104,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ProgressBarInfinite switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ProgressBarInfinite) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBarInfinite); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//show: arg 1: expected native of type *widget.ProgressBarInfinite") + return env.NewError("Go(*widget.ProgressBarInfinite)//show: arg 1: " + "expected native of type *widget.ProgressBarInfinite, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBarInfinite)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//show: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBarInfinite)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -89809,21 +90131,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ProgressBarInfinite switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ProgressBarInfinite) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBarInfinite); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//size: arg 1: expected native of type *widget.ProgressBarInfinite") + return env.NewError("Go(*widget.ProgressBarInfinite)//size: arg 1: " + "expected native of type *widget.ProgressBarInfinite, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBarInfinite)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//size: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBarInfinite)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -89838,21 +90160,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ProgressBarInfinite switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ProgressBarInfinite) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBarInfinite); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//start: arg 1: expected native of type *widget.ProgressBarInfinite") + return env.NewError("Go(*widget.ProgressBarInfinite)//start: arg 1: " + "expected native of type *widget.ProgressBarInfinite, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//start: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBarInfinite)//start: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//start: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBarInfinite)//start: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Start() return arg0 @@ -89865,21 +90187,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ProgressBarInfinite switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ProgressBarInfinite) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBarInfinite); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//stop: arg 1: expected native of type *widget.ProgressBarInfinite") + return env.NewError("Go(*widget.ProgressBarInfinite)//stop: arg 1: " + "expected native of type *widget.ProgressBarInfinite, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//stop: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBarInfinite)//stop: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//stop: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBarInfinite)//stop: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Stop() return arg0 @@ -89892,21 +90214,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ProgressBarInfinite switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ProgressBarInfinite) - if !ok { + if vc, ok := v.Value.(*widget.ProgressBarInfinite); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//visible: arg 1: expected native of type *widget.ProgressBarInfinite") + return env.NewError("Go(*widget.ProgressBarInfinite)//visible: arg 1: " + "expected native of type *widget.ProgressBarInfinite, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ProgressBarInfinite)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ProgressBarInfinite)//visible: arg 1: expected native") + return env.NewError("Go(*widget.ProgressBarInfinite)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -89921,33 +90243,107 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.RadioGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.RadioGroup) - if !ok { + if vc, ok := v.Value.(*widget.RadioGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//append: arg 1: expected native of type *widget.RadioGroup") + return env.NewError("Go(*widget.RadioGroup)//append: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//append: arg 1: expected native") + return env.NewError("Go(*widget.RadioGroup)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//append: arg 2: expected string") + return env.NewError("Go(*widget.RadioGroup)//append: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.Append(arg1Val) return arg0 }, }, + "Go(*widget.RadioGroup)//base-widget!": { + Doc: "Set *widget.RadioGroup BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.RadioGroup + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.RadioGroup); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.RadioGroup)//base-widget!: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.RadioGroup)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.RadioGroup)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.RadioGroup)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.RadioGroup)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.RadioGroup)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*widget.RadioGroup)//base-widget?": { + Doc: "Get *widget.RadioGroup BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.RadioGroup + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.RadioGroup); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.RadioGroup)//base-widget?: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.RadioGroup)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.RadioGroup)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj + }, + }, "Go(*widget.RadioGroup)//create-renderer": { Doc: "(*widget.RadioGroup).CreateRenderer", Argsn: 1, @@ -89955,42 +90351,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.RadioGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.RadioGroup) - if !ok { + if vc, ok := v.Value.(*widget.RadioGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//create-renderer: arg 1: expected native of type *widget.RadioGroup") + return env.NewError("Go(*widget.RadioGroup)//create-renderer: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//create-renderer: arg 1: expected native") + return env.NewError("Go(*widget.RadioGroup)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -90001,26 +90380,100 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.RadioGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.RadioGroup) - if !ok { + if vc, ok := v.Value.(*widget.RadioGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//disable: arg 1: expected native of type *widget.RadioGroup") + return env.NewError("Go(*widget.RadioGroup)//disable: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//disable: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//disable: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//disable: arg 1: expected native") + return env.NewError("Go(*widget.RadioGroup)//disable: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Disable() return arg0 }, }, + "Go(*widget.RadioGroup)//disableable-widget!": { + Doc: "Set *widget.RadioGroup DisableableWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.RadioGroup + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.RadioGroup); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.RadioGroup)//disableable-widget!: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.RadioGroup)//disableable-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.RadioGroup)//disableable-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.DisableableWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.DisableableWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.RadioGroup)//disableable-widget!: arg 2: " + "expected native of type *widget.DisableableWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.RadioGroup)//disableable-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.RadioGroup)//disableable-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.DisableableWidget = *newVal + return arg0 + }, + }, + "Go(*widget.RadioGroup)//disableable-widget?": { + Doc: "Get *widget.RadioGroup DisableableWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.RadioGroup + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.RadioGroup); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.RadioGroup)//disableable-widget?: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.RadioGroup)//disableable-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.RadioGroup)//disableable-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.DisableableWidget, "Go(*widget.DisableableWidget)") + return resObj + }, + }, "Go(*widget.RadioGroup)//disabled": { Doc: "(*widget.RadioGroup).Disabled", Argsn: 1, @@ -90028,21 +90481,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.RadioGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.RadioGroup) - if !ok { + if vc, ok := v.Value.(*widget.RadioGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//disabled: arg 1: expected native of type *widget.RadioGroup") + return env.NewError("Go(*widget.RadioGroup)//disabled: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//disabled: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//disabled: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//disabled: arg 1: expected native") + return env.NewError("Go(*widget.RadioGroup)//disabled: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Disabled() var res0Obj env.Object @@ -90057,21 +90510,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.RadioGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.RadioGroup) - if !ok { + if vc, ok := v.Value.(*widget.RadioGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//enable: arg 1: expected native of type *widget.RadioGroup") + return env.NewError("Go(*widget.RadioGroup)//enable: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//enable: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//enable: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//enable: arg 1: expected native") + return env.NewError("Go(*widget.RadioGroup)//enable: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Enable() return arg0 @@ -90084,21 +90537,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.RadioGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.RadioGroup) - if !ok { + if vc, ok := v.Value.(*widget.RadioGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//extend-base-widget: arg 1: expected native of type *widget.RadioGroup") + return env.NewError("Go(*widget.RadioGroup)//extend-base-widget: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.RadioGroup)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -90107,24 +90560,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.RadioGroup)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.RadioGroup)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.RadioGroup)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -90137,28 +90590,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RadioGroup switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RadioGroup) - if !ok { + if vc, ok := v.Value.(*widget.RadioGroup); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//hidden!: arg 1: expected native of type *widget.RadioGroup") + return env.NewError("Go(*widget.RadioGroup)//hidden!: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.RadioGroup)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.RadioGroup)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -90169,21 +90624,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RadioGroup switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RadioGroup) - if !ok { + if vc, ok := v.Value.(*widget.RadioGroup); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//hidden?: arg 1: expected native of type *widget.RadioGroup") + return env.NewError("Go(*widget.RadioGroup)//hidden?: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.RadioGroup)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -90197,21 +90652,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.RadioGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.RadioGroup) - if !ok { + if vc, ok := v.Value.(*widget.RadioGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//hide: arg 1: expected native of type *widget.RadioGroup") + return env.NewError("Go(*widget.RadioGroup)//hide: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//hide: arg 1: expected native") + return env.NewError("Go(*widget.RadioGroup)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -90224,28 +90679,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RadioGroup switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RadioGroup) - if !ok { + if vc, ok := v.Value.(*widget.RadioGroup); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//horizontal!: arg 1: expected native of type *widget.RadioGroup") + return env.NewError("Go(*widget.RadioGroup)//horizontal!: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//horizontal!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//horizontal!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//horizontal!: arg 1: expected native") + return env.NewError("Go(*widget.RadioGroup)//horizontal!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Horizontal = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//horizontal!: arg 2: expected integer") + return env.NewError("Go(*widget.RadioGroup)//horizontal!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Horizontal = newVal return arg0 }, }, @@ -90256,21 +90713,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RadioGroup switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RadioGroup) - if !ok { + if vc, ok := v.Value.(*widget.RadioGroup); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//horizontal?: arg 1: expected native of type *widget.RadioGroup") + return env.NewError("Go(*widget.RadioGroup)//horizontal?: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//horizontal?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//horizontal?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//horizontal?: arg 1: expected native") + return env.NewError("Go(*widget.RadioGroup)//horizontal?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Horizontal)) @@ -90284,21 +90741,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.RadioGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.RadioGroup) - if !ok { + if vc, ok := v.Value.(*widget.RadioGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//min-size: arg 1: expected native of type *widget.RadioGroup") + return env.NewError("Go(*widget.RadioGroup)//min-size: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.RadioGroup)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -90313,42 +90770,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.RadioGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.RadioGroup) - if !ok { + if vc, ok := v.Value.(*widget.RadioGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//move: arg 1: expected native of type *widget.RadioGroup") + return env.NewError("Go(*widget.RadioGroup)//move: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//move: arg 1: expected native") + return env.NewError("Go(*widget.RadioGroup)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//move: arg 2: expected native") + return env.NewError("Go(*widget.RadioGroup)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -90359,45 +90810,47 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RadioGroup switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RadioGroup) - if !ok { + if vc, ok := v.Value.(*widget.RadioGroup); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//on-changed!: arg 1: expected native of type *widget.RadioGroup") + return env.NewError("Go(*widget.RadioGroup)//on-changed!: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//on-changed!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//on-changed!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//on-changed!: arg 1: expected native") + return env.NewError("Go(*widget.RadioGroup)//on-changed!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(string) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//on-changed!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*widget.RadioGroup)//on-changed!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnChanged = func(arg0 string) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + newVal = func(farg0 string) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//on-changed!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//on-changed!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnChanged = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//on-changed!: arg 2: expected function or nil") + return env.NewError("Go(*widget.RadioGroup)//on-changed!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnChanged = newVal return arg0 }, }, @@ -90408,24 +90861,34 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RadioGroup switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RadioGroup) - if !ok { + if vc, ok := v.Value.(*widget.RadioGroup); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//on-changed?: arg 1: expected native of type *widget.RadioGroup") + return env.NewError("Go(*widget.RadioGroup)//on-changed?: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//on-changed?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//on-changed?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//on-changed?: arg 1: expected native") + return env.NewError("Go(*widget.RadioGroup)//on-changed?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnChanged, "Go(func(string))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val string + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.RadioGroup)//on-changed?: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) + } + self.OnChanged(arg0Val) + return nil + }, 1, false, false, "Returned func") return resObj }, }, @@ -90436,50 +90899,45 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RadioGroup switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RadioGroup) - if !ok { + if vc, ok := v.Value.(*widget.RadioGroup); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//options!: arg 1: expected native of type *widget.RadioGroup") + return env.NewError("Go(*widget.RadioGroup)//options!: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//options!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//options!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//options!: arg 1: expected native") + return env.NewError("Go(*widget.RadioGroup)//options!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal []string switch v := arg1.(type) { case env.Block: - self.Options = make([]string, len(v.Series.S)) + newVal = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - self.Options[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + newVal[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//options!: arg 2: block item: expected string") + return env.NewError("Go(*widget.RadioGroup)//options!: arg 2: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - self.Options, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//options!: arg 2: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//options!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//options!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Options = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//options!: arg 2: expected block, native or nil") + return env.NewError("Go(*widget.RadioGroup)//options!: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } + self.Options = newVal return arg0 }, }, @@ -90490,21 +90948,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RadioGroup switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RadioGroup) - if !ok { + if vc, ok := v.Value.(*widget.RadioGroup); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//options?: arg 1: expected native of type *widget.RadioGroup") + return env.NewError("Go(*widget.RadioGroup)//options?: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//options?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//options?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//options?: arg 1: expected native") + return env.NewError("Go(*widget.RadioGroup)//options?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object { @@ -90524,21 +90982,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.RadioGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.RadioGroup) - if !ok { + if vc, ok := v.Value.(*widget.RadioGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//position: arg 1: expected native of type *widget.RadioGroup") + return env.NewError("Go(*widget.RadioGroup)//position: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//position: arg 1: expected native") + return env.NewError("Go(*widget.RadioGroup)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -90553,21 +91011,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.RadioGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.RadioGroup) - if !ok { + if vc, ok := v.Value.(*widget.RadioGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//refresh: arg 1: expected native of type *widget.RadioGroup") + return env.NewError("Go(*widget.RadioGroup)//refresh: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.RadioGroup)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -90580,28 +91038,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RadioGroup switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RadioGroup) - if !ok { + if vc, ok := v.Value.(*widget.RadioGroup); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//required!: arg 1: expected native of type *widget.RadioGroup") + return env.NewError("Go(*widget.RadioGroup)//required!: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//required!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//required!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//required!: arg 1: expected native") + return env.NewError("Go(*widget.RadioGroup)//required!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Required = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//required!: arg 2: expected integer") + return env.NewError("Go(*widget.RadioGroup)//required!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Required = newVal return arg0 }, }, @@ -90612,21 +91072,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RadioGroup switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RadioGroup) - if !ok { + if vc, ok := v.Value.(*widget.RadioGroup); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//required?: arg 1: expected native of type *widget.RadioGroup") + return env.NewError("Go(*widget.RadioGroup)//required?: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//required?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//required?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//required?: arg 1: expected native") + return env.NewError("Go(*widget.RadioGroup)//required?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Required)) @@ -90640,42 +91100,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.RadioGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.RadioGroup) - if !ok { + if vc, ok := v.Value.(*widget.RadioGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//resize: arg 1: expected native of type *widget.RadioGroup") + return env.NewError("Go(*widget.RadioGroup)//resize: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//resize: arg 1: expected native") + return env.NewError("Go(*widget.RadioGroup)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//resize: arg 2: expected native") + return env.NewError("Go(*widget.RadioGroup)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -90686,28 +91140,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RadioGroup switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RadioGroup) - if !ok { + if vc, ok := v.Value.(*widget.RadioGroup); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//selected!: arg 1: expected native of type *widget.RadioGroup") + return env.NewError("Go(*widget.RadioGroup)//selected!: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//selected!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//selected!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//selected!: arg 1: expected native") + return env.NewError("Go(*widget.RadioGroup)//selected!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.Selected = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//selected!: arg 2: expected string") + return env.NewError("Go(*widget.RadioGroup)//selected!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.Selected = newVal return arg0 }, }, @@ -90718,21 +91174,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RadioGroup switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RadioGroup) - if !ok { + if vc, ok := v.Value.(*widget.RadioGroup); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//selected?: arg 1: expected native of type *widget.RadioGroup") + return env.NewError("Go(*widget.RadioGroup)//selected?: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//selected?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//selected?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//selected?: arg 1: expected native") + return env.NewError("Go(*widget.RadioGroup)//selected?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.Selected) @@ -90746,28 +91202,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.RadioGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.RadioGroup) - if !ok { + if vc, ok := v.Value.(*widget.RadioGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//set-selected: arg 1: expected native of type *widget.RadioGroup") + return env.NewError("Go(*widget.RadioGroup)//set-selected: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//set-selected: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//set-selected: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//set-selected: arg 1: expected native") + return env.NewError("Go(*widget.RadioGroup)//set-selected: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//set-selected: arg 2: expected string") + return env.NewError("Go(*widget.RadioGroup)//set-selected: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetSelected(arg1Val) return arg0 @@ -90780,21 +91236,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.RadioGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.RadioGroup) - if !ok { + if vc, ok := v.Value.(*widget.RadioGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//show: arg 1: expected native of type *widget.RadioGroup") + return env.NewError("Go(*widget.RadioGroup)//show: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//show: arg 1: expected native") + return env.NewError("Go(*widget.RadioGroup)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -90807,21 +91263,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.RadioGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.RadioGroup) - if !ok { + if vc, ok := v.Value.(*widget.RadioGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//size: arg 1: expected native of type *widget.RadioGroup") + return env.NewError("Go(*widget.RadioGroup)//size: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//size: arg 1: expected native") + return env.NewError("Go(*widget.RadioGroup)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -90836,21 +91292,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.RadioGroup switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.RadioGroup) - if !ok { + if vc, ok := v.Value.(*widget.RadioGroup); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//visible: arg 1: expected native of type *widget.RadioGroup") + return env.NewError("Go(*widget.RadioGroup)//visible: arg 1: " + "expected native of type *widget.RadioGroup, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RadioGroup)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RadioGroup)//visible: arg 1: expected native") + return env.NewError("Go(*widget.RadioGroup)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -90858,6 +91314,80 @@ var Builtins = map[string]*env.Builtin{ return res0Obj }, }, + "Go(*widget.RichText)//base-widget!": { + Doc: "Set *widget.RichText BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.RichText + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.RichText); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.RichText)//base-widget!: arg 1: " + "expected native of type *widget.RichText, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.RichText)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.RichText)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.RichText)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.RichText)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.RichText)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*widget.RichText)//base-widget?": { + Doc: "Get *widget.RichText BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.RichText + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.RichText); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.RichText)//base-widget?: arg 1: " + "expected native of type *widget.RichText, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.RichText)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.RichText)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj + }, + }, "Go(*widget.RichText)//create-renderer": { Doc: "(*widget.RichText).CreateRenderer", Argsn: 1, @@ -90865,42 +91395,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.RichText switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.RichText) - if !ok { + if vc, ok := v.Value.(*widget.RichText); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//create-renderer: arg 1: expected native of type *widget.RichText") + return env.NewError("Go(*widget.RichText)//create-renderer: arg 1: " + "expected native of type *widget.RichText, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichText)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//create-renderer: arg 1: expected native") + return env.NewError("Go(*widget.RichText)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -90911,21 +91424,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.RichText switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.RichText) - if !ok { + if vc, ok := v.Value.(*widget.RichText); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//extend-base-widget: arg 1: expected native of type *widget.RichText") + return env.NewError("Go(*widget.RichText)//extend-base-widget: arg 1: " + "expected native of type *widget.RichText, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichText)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.RichText)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -90934,24 +91447,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.RichText)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.RichText)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichText)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.RichText)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -90964,28 +91477,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RichText switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RichText) - if !ok { + if vc, ok := v.Value.(*widget.RichText); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//hidden!: arg 1: expected native of type *widget.RichText") + return env.NewError("Go(*widget.RichText)//hidden!: arg 1: " + "expected native of type *widget.RichText, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichText)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.RichText)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.RichText)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -90996,21 +91511,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RichText switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RichText) - if !ok { + if vc, ok := v.Value.(*widget.RichText); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//hidden?: arg 1: expected native of type *widget.RichText") + return env.NewError("Go(*widget.RichText)//hidden?: arg 1: " + "expected native of type *widget.RichText, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichText)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.RichText)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -91024,21 +91539,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.RichText switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.RichText) - if !ok { + if vc, ok := v.Value.(*widget.RichText); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//hide: arg 1: expected native of type *widget.RichText") + return env.NewError("Go(*widget.RichText)//hide: arg 1: " + "expected native of type *widget.RichText, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichText)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//hide: arg 1: expected native") + return env.NewError("Go(*widget.RichText)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -91051,21 +91566,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.RichText switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.RichText) - if !ok { + if vc, ok := v.Value.(*widget.RichText); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//min-size: arg 1: expected native of type *widget.RichText") + return env.NewError("Go(*widget.RichText)//min-size: arg 1: " + "expected native of type *widget.RichText, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichText)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.RichText)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -91080,42 +91595,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.RichText switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.RichText) - if !ok { + if vc, ok := v.Value.(*widget.RichText); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//move: arg 1: expected native of type *widget.RichText") + return env.NewError("Go(*widget.RichText)//move: arg 1: " + "expected native of type *widget.RichText, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichText)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//move: arg 1: expected native") + return env.NewError("Go(*widget.RichText)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichText)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//move: arg 2: expected native") + return env.NewError("Go(*widget.RichText)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -91126,28 +91635,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.RichText switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.RichText) - if !ok { + if vc, ok := v.Value.(*widget.RichText); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//parse-markdown: arg 1: expected native of type *widget.RichText") + return env.NewError("Go(*widget.RichText)//parse-markdown: arg 1: " + "expected native of type *widget.RichText, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//parse-markdown: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichText)//parse-markdown: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//parse-markdown: arg 1: expected native") + return env.NewError("Go(*widget.RichText)//parse-markdown: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//parse-markdown: arg 2: expected string") + return env.NewError("Go(*widget.RichText)//parse-markdown: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.ParseMarkdown(arg1Val) return arg0 @@ -91160,21 +91669,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.RichText switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.RichText) - if !ok { + if vc, ok := v.Value.(*widget.RichText); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//position: arg 1: expected native of type *widget.RichText") + return env.NewError("Go(*widget.RichText)//position: arg 1: " + "expected native of type *widget.RichText, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichText)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//position: arg 1: expected native") + return env.NewError("Go(*widget.RichText)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -91189,21 +91698,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.RichText switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.RichText) - if !ok { + if vc, ok := v.Value.(*widget.RichText); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//refresh: arg 1: expected native of type *widget.RichText") + return env.NewError("Go(*widget.RichText)//refresh: arg 1: " + "expected native of type *widget.RichText, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichText)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.RichText)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -91216,123 +91725,37 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.RichText switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.RichText) - if !ok { + if vc, ok := v.Value.(*widget.RichText); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//resize: arg 1: expected native of type *widget.RichText") + return env.NewError("Go(*widget.RichText)//resize: arg 1: " + "expected native of type *widget.RichText, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichText)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//resize: arg 1: expected native") + return env.NewError("Go(*widget.RichText)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//resize: arg 2: expected integer to be 0 or nil") - } - arg1Val = nil - default: - ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//resize: arg 2: expected native") - } - arg0Val.Resize(*arg1Val) - return arg0 - }, - }, - "Go(*widget.RichText)//scroll!": { - Doc: "Set *widget.RichText Scroll value", - Argsn: 2, - Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var self *widget.RichText - switch v := arg0.(type) { - case env.Native: - var ok bool - self, ok = v.Value.(*widget.RichText) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//scroll!: arg 1: expected native of type *widget.RichText") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//scroll!: arg 1: expected integer to be 0 or nil") - } - self = nil - default: - ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//scroll!: arg 1: expected native") - } - { - nat, natOk := arg1.(env.Native) - var natValOk bool - var rOut, rIn reflect.Value - if natOk { - // HACK: self.Scroll, natValOk = internal_widget.ScrollDirection(u) - rOut = reflect.ValueOf(&self.Scroll).Elem() - rIn = reflect.ValueOf(nat.Value) - natValOk = rIn.CanConvert(rOut.Type()) - } - if natValOk { - rOut.Set(rIn.Convert(rOut.Type())) + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc } else { - var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) - } else { - ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//scroll!: arg 2: expected integer") - } - // HACK: self.Scroll = internal_widget.ScrollDirection(u) - rOut := reflect.ValueOf(&self.Scroll).Elem() - rIn := reflect.ValueOf(u) - rOut.Set(rIn.Convert(rOut.Type())) - } - } - return arg0 - }, - }, - "Go(*widget.RichText)//scroll?": { - Doc: "Get *widget.RichText Scroll value", - Argsn: 1, - Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var self *widget.RichText - switch v := arg0.(type) { - case env.Native: - var ok bool - self, ok = v.Value.(*widget.RichText) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//scroll?: arg 1: expected native of type *widget.RichText") - } - case env.Integer: - if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//scroll?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichText)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//scroll?: arg 1: expected native") + return env.NewError("Go(*widget.RichText)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var resObj env.Object - resObj = *env.NewInteger(int64(int(self.Scroll))) - return resObj + arg0Val.Resize(arg1Val) + return arg0 }, }, "Go(*widget.RichText)//segments!": { @@ -91342,69 +91765,64 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RichText switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RichText) - if !ok { + if vc, ok := v.Value.(*widget.RichText); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//segments!: arg 1: expected native of type *widget.RichText") + return env.NewError("Go(*widget.RichText)//segments!: arg 1: " + "expected native of type *widget.RichText, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//segments!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichText)//segments!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//segments!: arg 1: expected native") + return env.NewError("Go(*widget.RichText)//segments!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal []widget.RichTextSegment switch v := arg1.(type) { case env.Block: - self.Segments = make([]widget.RichTextSegment, len(v.Series.S)) + newVal = make([]widget.RichTextSegment, len(v.Series.S)) for i, it := range v.Series.S { switch v := it.(type) { case env.RyeCtx: var err error - self.Segments[i], err = ctxTo_widget_RichTextSegment(ps, v) + newVal[i], err = ctxTo_widget_RichTextSegment(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//segments!: arg 2: block item: " + err.Error() + "") + return env.NewError("Go(*widget.RichText)//segments!: arg 2: " + "block item: " + err.Error()) } case env.Native: - var ok bool - self.Segments[i], ok = v.Value.(widget.RichTextSegment) - if !ok { + if vc, ok := v.Value.(widget.RichTextSegment); ok { + newVal[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//segments!: arg 2: block item: expected native of type widget.RichTextSegment") + return env.NewError("Go(*widget.RichText)//segments!: arg 2: " + "block item: " + "expected native of type widget.RichTextSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//segments!: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichText)//segments!: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Segments[i] = nil + newVal[i] = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//segments!: arg 2: block item: expected native") + return env.NewError("Go(*widget.RichText)//segments!: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - self.Segments, ok = v.Value.([]widget.RichTextSegment) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//segments!: arg 2: expected native of type []widget.RichTextSegment") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//segments!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichText)//segments!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Segments = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//segments!: arg 2: expected block, native or nil") + return env.NewError("Go(*widget.RichText)//segments!: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } + self.Segments = newVal return arg0 }, }, @@ -91415,44 +91833,27 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RichText switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RichText) - if !ok { + if vc, ok := v.Value.(*widget.RichText); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//segments?: arg 1: expected native of type *widget.RichText") + return env.NewError("Go(*widget.RichText)//segments?: arg 1: " + "expected native of type *widget.RichText, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//segments?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichText)//segments?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//segments?: arg 1: expected native") + return env.NewError("Go(*widget.RichText)//segments?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object { items := make([]env.Object, len(self.Segments)) for i, it := range self.Segments { - { - typ := reflect.TypeOf(it) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - items[i] = *env.NewNative(ps.Idx, it, typRyeName) - } else { - items[i] = *env.NewNative(ps.Idx, it, "Go(widget.RichTextSegment)") - } - } + items[i] = ifaceToNative(ps.Idx, it, "Go(widget.RichTextSegment)") } resObj = *env.NewBlock(*env.NewTSeries(items)) } @@ -91466,21 +91867,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.RichText switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.RichText) - if !ok { + if vc, ok := v.Value.(*widget.RichText); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//show: arg 1: expected native of type *widget.RichText") + return env.NewError("Go(*widget.RichText)//show: arg 1: " + "expected native of type *widget.RichText, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichText)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//show: arg 1: expected native") + return env.NewError("Go(*widget.RichText)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -91493,21 +91894,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.RichText switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.RichText) - if !ok { + if vc, ok := v.Value.(*widget.RichText); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//size: arg 1: expected native of type *widget.RichText") + return env.NewError("Go(*widget.RichText)//size: arg 1: " + "expected native of type *widget.RichText, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichText)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//size: arg 1: expected native") + return env.NewError("Go(*widget.RichText)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -91522,21 +91923,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.RichText switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.RichText) - if !ok { + if vc, ok := v.Value.(*widget.RichText); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//string: arg 1: expected native of type *widget.RichText") + return env.NewError("Go(*widget.RichText)//string: arg 1: " + "expected native of type *widget.RichText, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//string: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichText)//string: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//string: arg 1: expected native") + return env.NewError("Go(*widget.RichText)//string: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.String() var res0Obj env.Object @@ -91551,22 +91952,23 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RichText switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RichText) - if !ok { + if vc, ok := v.Value.(*widget.RichText); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//truncation!: arg 1: expected native of type *widget.RichText") + return env.NewError("Go(*widget.RichText)//truncation!: arg 1: " + "expected native of type *widget.RichText, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//truncation!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichText)//truncation!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//truncation!: arg 1: expected native") + return env.NewError("Go(*widget.RichText)//truncation!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.TextTruncation { nat, natOk := arg1.(env.Native) var natValOk bool @@ -91575,18 +91977,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(fyne.TextTruncation) } if natValOk { - self.Truncation = natVal + newVal = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//truncation!: arg 2: expected integer") + return env.NewError("Go(*widget.RichText)//truncation!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } - self.Truncation = fyne.TextTruncation(u) + newVal = fyne.TextTruncation(u) } } + self.Truncation = newVal return arg0 }, }, @@ -91597,21 +92000,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RichText switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RichText) - if !ok { + if vc, ok := v.Value.(*widget.RichText); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//truncation?: arg 1: expected native of type *widget.RichText") + return env.NewError("Go(*widget.RichText)//truncation?: arg 1: " + "expected native of type *widget.RichText, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//truncation?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichText)//truncation?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//truncation?: arg 1: expected native") + return env.NewError("Go(*widget.RichText)//truncation?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(int(self.Truncation))) @@ -91625,21 +92028,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.RichText switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.RichText) - if !ok { + if vc, ok := v.Value.(*widget.RichText); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//visible: arg 1: expected native of type *widget.RichText") + return env.NewError("Go(*widget.RichText)//visible: arg 1: " + "expected native of type *widget.RichText, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichText)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//visible: arg 1: expected native") + return env.NewError("Go(*widget.RichText)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -91654,22 +92057,23 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RichText switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RichText) - if !ok { + if vc, ok := v.Value.(*widget.RichText); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//wrapping!: arg 1: expected native of type *widget.RichText") + return env.NewError("Go(*widget.RichText)//wrapping!: arg 1: " + "expected native of type *widget.RichText, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//wrapping!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichText)//wrapping!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//wrapping!: arg 1: expected native") + return env.NewError("Go(*widget.RichText)//wrapping!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.TextWrap { nat, natOk := arg1.(env.Native) var natValOk bool @@ -91678,18 +92082,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(fyne.TextWrap) } if natValOk { - self.Wrapping = natVal + newVal = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//wrapping!: arg 2: expected integer") + return env.NewError("Go(*widget.RichText)//wrapping!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } - self.Wrapping = fyne.TextWrap(u) + newVal = fyne.TextWrap(u) } } + self.Wrapping = newVal return arg0 }, }, @@ -91700,21 +92105,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RichText switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RichText) - if !ok { + if vc, ok := v.Value.(*widget.RichText); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//wrapping?: arg 1: expected native of type *widget.RichText") + return env.NewError("Go(*widget.RichText)//wrapping?: arg 1: " + "expected native of type *widget.RichText, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//wrapping?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichText)//wrapping?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichText)//wrapping?: arg 1: expected native") + return env.NewError("Go(*widget.RichText)//wrapping?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(int(self.Wrapping))) @@ -91728,22 +92133,23 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RichTextStyle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RichTextStyle) - if !ok { + if vc, ok := v.Value.(*widget.RichTextStyle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//alignment!: arg 1: expected native of type *widget.RichTextStyle") + return env.NewError("Go(*widget.RichTextStyle)//alignment!: arg 1: " + "expected native of type *widget.RichTextStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//alignment!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichTextStyle)//alignment!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//alignment!: arg 1: expected native") + return env.NewError("Go(*widget.RichTextStyle)//alignment!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.TextAlign { nat, natOk := arg1.(env.Native) var natValOk bool @@ -91752,18 +92158,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(fyne.TextAlign) } if natValOk { - self.Alignment = natVal + newVal = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//alignment!: arg 2: expected integer") + return env.NewError("Go(*widget.RichTextStyle)//alignment!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } - self.Alignment = fyne.TextAlign(u) + newVal = fyne.TextAlign(u) } } + self.Alignment = newVal return arg0 }, }, @@ -91774,21 +92181,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RichTextStyle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RichTextStyle) - if !ok { + if vc, ok := v.Value.(*widget.RichTextStyle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//alignment?: arg 1: expected native of type *widget.RichTextStyle") + return env.NewError("Go(*widget.RichTextStyle)//alignment?: arg 1: " + "expected native of type *widget.RichTextStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//alignment?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichTextStyle)//alignment?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//alignment?: arg 1: expected native") + return env.NewError("Go(*widget.RichTextStyle)//alignment?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(int(self.Alignment))) @@ -91802,22 +92209,23 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RichTextStyle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RichTextStyle) - if !ok { + if vc, ok := v.Value.(*widget.RichTextStyle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//color-name!: arg 1: expected native of type *widget.RichTextStyle") + return env.NewError("Go(*widget.RichTextStyle)//color-name!: arg 1: " + "expected native of type *widget.RichTextStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//color-name!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichTextStyle)//color-name!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//color-name!: arg 1: expected native") + return env.NewError("Go(*widget.RichTextStyle)//color-name!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.ThemeColorName { nat, natOk := arg1.(env.Native) var natValOk bool @@ -91826,18 +92234,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(fyne.ThemeColorName) } if natValOk { - self.ColorName = natVal + newVal = natVal } else { var u string - if v, ok := arg1.(env.String); ok { - u = string(v.Value) + if vc, ok := arg1.(env.String); ok { + u = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//color-name!: arg 2: expected string") + return env.NewError("Go(*widget.RichTextStyle)//color-name!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } - self.ColorName = fyne.ThemeColorName(u) + newVal = fyne.ThemeColorName(u) } } + self.ColorName = newVal return arg0 }, }, @@ -91848,21 +92257,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RichTextStyle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RichTextStyle) - if !ok { + if vc, ok := v.Value.(*widget.RichTextStyle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//color-name?: arg 1: expected native of type *widget.RichTextStyle") + return env.NewError("Go(*widget.RichTextStyle)//color-name?: arg 1: " + "expected native of type *widget.RichTextStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//color-name?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichTextStyle)//color-name?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//color-name?: arg 1: expected native") + return env.NewError("Go(*widget.RichTextStyle)//color-name?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(string(self.ColorName)) @@ -91876,28 +92285,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RichTextStyle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RichTextStyle) - if !ok { + if vc, ok := v.Value.(*widget.RichTextStyle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//inline!: arg 1: expected native of type *widget.RichTextStyle") + return env.NewError("Go(*widget.RichTextStyle)//inline!: arg 1: " + "expected native of type *widget.RichTextStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//inline!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichTextStyle)//inline!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//inline!: arg 1: expected native") + return env.NewError("Go(*widget.RichTextStyle)//inline!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Inline = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//inline!: arg 2: expected integer") + return env.NewError("Go(*widget.RichTextStyle)//inline!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Inline = newVal return arg0 }, }, @@ -91908,21 +92319,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RichTextStyle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RichTextStyle) - if !ok { + if vc, ok := v.Value.(*widget.RichTextStyle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//inline?: arg 1: expected native of type *widget.RichTextStyle") + return env.NewError("Go(*widget.RichTextStyle)//inline?: arg 1: " + "expected native of type *widget.RichTextStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//inline?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichTextStyle)//inline?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//inline?: arg 1: expected native") + return env.NewError("Go(*widget.RichTextStyle)//inline?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Inline)) @@ -91936,22 +92347,23 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RichTextStyle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RichTextStyle) - if !ok { + if vc, ok := v.Value.(*widget.RichTextStyle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//size-name!: arg 1: expected native of type *widget.RichTextStyle") + return env.NewError("Go(*widget.RichTextStyle)//size-name!: arg 1: " + "expected native of type *widget.RichTextStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//size-name!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichTextStyle)//size-name!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//size-name!: arg 1: expected native") + return env.NewError("Go(*widget.RichTextStyle)//size-name!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.ThemeSizeName { nat, natOk := arg1.(env.Native) var natValOk bool @@ -91960,18 +92372,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(fyne.ThemeSizeName) } if natValOk { - self.SizeName = natVal + newVal = natVal } else { var u string - if v, ok := arg1.(env.String); ok { - u = string(v.Value) + if vc, ok := arg1.(env.String); ok { + u = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//size-name!: arg 2: expected string") + return env.NewError("Go(*widget.RichTextStyle)//size-name!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } - self.SizeName = fyne.ThemeSizeName(u) + newVal = fyne.ThemeSizeName(u) } } + self.SizeName = newVal return arg0 }, }, @@ -91982,21 +92395,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RichTextStyle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RichTextStyle) - if !ok { + if vc, ok := v.Value.(*widget.RichTextStyle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//size-name?: arg 1: expected native of type *widget.RichTextStyle") + return env.NewError("Go(*widget.RichTextStyle)//size-name?: arg 1: " + "expected native of type *widget.RichTextStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//size-name?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichTextStyle)//size-name?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//size-name?: arg 1: expected native") + return env.NewError("Go(*widget.RichTextStyle)//size-name?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(string(self.SizeName)) @@ -92010,34 +92423,42 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RichTextStyle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RichTextStyle) - if !ok { + if vc, ok := v.Value.(*widget.RichTextStyle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//text-style!: arg 1: expected native of type *widget.RichTextStyle") + return env.NewError("Go(*widget.RichTextStyle)//text-style!: arg 1: " + "expected native of type *widget.RichTextStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//text-style!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichTextStyle)//text-style!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//text-style!: arg 1: expected native") + return env.NewError("Go(*widget.RichTextStyle)//text-style!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal *fyne.TextStyle switch v := arg1.(type) { case env.Native: - var ok bool - self.TextStyle, ok = v.Value.(fyne.TextStyle) - if !ok { + if vc, ok := v.Value.(*fyne.TextStyle); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//text-style!: arg 2: expected native of type fyne.TextStyle") + return env.NewError("Go(*widget.RichTextStyle)//text-style!: arg 2: " + "expected native of type *fyne.TextStyle, but got " + objectDebugString(ps.Idx, v)) } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.RichTextStyle)//text-style!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//text-style!: arg 2: expected native") + return env.NewError("Go(*widget.RichTextStyle)//text-style!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.TextStyle = *newVal return arg0 }, }, @@ -92048,21 +92469,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.RichTextStyle switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.RichTextStyle) - if !ok { + if vc, ok := v.Value.(*widget.RichTextStyle); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//text-style?: arg 1: expected native of type *widget.RichTextStyle") + return env.NewError("Go(*widget.RichTextStyle)//text-style?: arg 1: " + "expected native of type *widget.RichTextStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//text-style?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.RichTextStyle)//text-style?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.RichTextStyle)//text-style?: arg 1: expected native") + return env.NewError("Go(*widget.RichTextStyle)//text-style?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, &self.TextStyle, "Go(*fyne.TextStyle)") @@ -92076,22 +92497,23 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//alignment!: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//alignment!: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//alignment!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//alignment!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//alignment!: arg 1: expected native") + return env.NewError("Go(*widget.Select)//alignment!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.TextAlign { nat, natOk := arg1.(env.Native) var natValOk bool @@ -92100,18 +92522,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(fyne.TextAlign) } if natValOk { - self.Alignment = natVal + newVal = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//alignment!: arg 2: expected integer") + return env.NewError("Go(*widget.Select)//alignment!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } - self.Alignment = fyne.TextAlign(u) + newVal = fyne.TextAlign(u) } } + self.Alignment = newVal return arg0 }, }, @@ -92122,27 +92545,101 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//alignment?: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//alignment?: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//alignment?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//alignment?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//alignment?: arg 1: expected native") + return env.NewError("Go(*widget.Select)//alignment?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(int(self.Alignment))) return resObj }, }, + "Go(*widget.Select)//base-widget!": { + Doc: "Set *widget.Select BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Select + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Select); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Select)//base-widget!: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Select)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Select)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Select)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Select)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Select)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*widget.Select)//base-widget?": { + Doc: "Get *widget.Select BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Select + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Select); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Select)//base-widget?: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Select)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Select)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj + }, + }, "Go(*widget.Select)//clear-selected": { Doc: "(*widget.Select).ClearSelected", Argsn: 1, @@ -92150,21 +92647,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//clear-selected: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//clear-selected: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//clear-selected: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//clear-selected: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//clear-selected: arg 1: expected native") + return env.NewError("Go(*widget.Select)//clear-selected: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ClearSelected() return arg0 @@ -92177,42 +92674,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//create-renderer: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//create-renderer: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//create-renderer: arg 1: expected native") + return env.NewError("Go(*widget.Select)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -92223,26 +92703,100 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//disable: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//disable: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//disable: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//disable: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//disable: arg 1: expected native") + return env.NewError("Go(*widget.Select)//disable: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Disable() return arg0 }, }, + "Go(*widget.Select)//disableable-widget!": { + Doc: "Set *widget.Select DisableableWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Select + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Select); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Select)//disableable-widget!: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Select)//disableable-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Select)//disableable-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.DisableableWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.DisableableWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Select)//disableable-widget!: arg 2: " + "expected native of type *widget.DisableableWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Select)//disableable-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Select)//disableable-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.DisableableWidget = *newVal + return arg0 + }, + }, + "Go(*widget.Select)//disableable-widget?": { + Doc: "Get *widget.Select DisableableWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Select + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Select); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Select)//disableable-widget?: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Select)//disableable-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Select)//disableable-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.DisableableWidget, "Go(*widget.DisableableWidget)") + return resObj + }, + }, "Go(*widget.Select)//disabled": { Doc: "(*widget.Select).Disabled", Argsn: 1, @@ -92250,21 +92804,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//disabled: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//disabled: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//disabled: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//disabled: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//disabled: arg 1: expected native") + return env.NewError("Go(*widget.Select)//disabled: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Disabled() var res0Obj env.Object @@ -92279,21 +92833,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//enable: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//enable: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//enable: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//enable: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//enable: arg 1: expected native") + return env.NewError("Go(*widget.Select)//enable: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Enable() return arg0 @@ -92306,21 +92860,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//extend-base-widget: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//extend-base-widget: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.Select)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -92329,24 +92883,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Select)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.Select)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.Select)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -92359,21 +92913,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//focus-gained: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//focus-gained: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//focus-gained: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//focus-gained: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//focus-gained: arg 1: expected native") + return env.NewError("Go(*widget.Select)//focus-gained: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusGained() return arg0 @@ -92386,21 +92940,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//focus-lost: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//focus-lost: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//focus-lost: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//focus-lost: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//focus-lost: arg 1: expected native") + return env.NewError("Go(*widget.Select)//focus-lost: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusLost() return arg0 @@ -92413,28 +92967,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//hidden!: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//hidden!: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.Select)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.Select)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -92445,21 +93001,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//hidden?: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//hidden?: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.Select)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -92473,21 +93029,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//hide: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//hide: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//hide: arg 1: expected native") + return env.NewError("Go(*widget.Select)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -92500,21 +93056,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//min-size: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//min-size: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.Select)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -92529,40 +93085,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//mouse-in: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//mouse-in: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//mouse-in: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//mouse-in: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//mouse-in: arg 1: expected native") + return env.NewError("Go(*widget.Select)//mouse-in: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *desktop.MouseEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//mouse-in: arg 2: expected native of type *desktop.MouseEvent") + return env.NewError("Go(*widget.Select)//mouse-in: arg 2: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//mouse-in: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//mouse-in: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//mouse-in: arg 2: expected native") + return env.NewError("Go(*widget.Select)//mouse-in: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.MouseIn(arg1Val) return arg0 @@ -92575,40 +93131,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//mouse-moved: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//mouse-moved: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//mouse-moved: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//mouse-moved: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//mouse-moved: arg 1: expected native") + return env.NewError("Go(*widget.Select)//mouse-moved: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *desktop.MouseEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//mouse-moved: arg 2: expected native of type *desktop.MouseEvent") + return env.NewError("Go(*widget.Select)//mouse-moved: arg 2: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//mouse-moved: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//mouse-moved: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//mouse-moved: arg 2: expected native") + return env.NewError("Go(*widget.Select)//mouse-moved: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.MouseMoved(arg1Val) return arg0 @@ -92621,21 +93177,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//mouse-out: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//mouse-out: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//mouse-out: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//mouse-out: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//mouse-out: arg 1: expected native") + return env.NewError("Go(*widget.Select)//mouse-out: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.MouseOut() return arg0 @@ -92648,42 +93204,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//move: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//move: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//move: arg 1: expected native") + return env.NewError("Go(*widget.Select)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//move: arg 2: expected native") + return env.NewError("Go(*widget.Select)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -92694,45 +93244,47 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//on-changed!: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//on-changed!: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//on-changed!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//on-changed!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//on-changed!: arg 1: expected native") + return env.NewError("Go(*widget.Select)//on-changed!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(string) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//on-changed!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*widget.Select)//on-changed!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnChanged = func(arg0 string) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + newVal = func(farg0 string) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//on-changed!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//on-changed!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnChanged = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//on-changed!: arg 2: expected function or nil") + return env.NewError("Go(*widget.Select)//on-changed!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnChanged = newVal return arg0 }, }, @@ -92743,24 +93295,34 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//on-changed?: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//on-changed?: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//on-changed?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//on-changed?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//on-changed?: arg 1: expected native") + return env.NewError("Go(*widget.Select)//on-changed?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnChanged, "Go(func(string))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val string + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Select)//on-changed?: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) + } + self.OnChanged(arg0Val) + return nil + }, 1, false, false, "Returned func") return resObj }, }, @@ -92771,50 +93333,45 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//options!: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//options!: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//options!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//options!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//options!: arg 1: expected native") + return env.NewError("Go(*widget.Select)//options!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal []string switch v := arg1.(type) { case env.Block: - self.Options = make([]string, len(v.Series.S)) + newVal = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - self.Options[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + newVal[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//options!: arg 2: block item: expected string") + return env.NewError("Go(*widget.Select)//options!: arg 2: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - self.Options, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//options!: arg 2: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//options!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//options!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Options = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//options!: arg 2: expected block, native or nil") + return env.NewError("Go(*widget.Select)//options!: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } + self.Options = newVal return arg0 }, }, @@ -92825,21 +93382,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//options?: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//options?: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//options?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//options?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//options?: arg 1: expected native") + return env.NewError("Go(*widget.Select)//options?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object { @@ -92859,28 +93416,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//place-holder!: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//place-holder!: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//place-holder!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//place-holder!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//place-holder!: arg 1: expected native") + return env.NewError("Go(*widget.Select)//place-holder!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.PlaceHolder = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//place-holder!: arg 2: expected string") + return env.NewError("Go(*widget.Select)//place-holder!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.PlaceHolder = newVal return arg0 }, }, @@ -92891,21 +93450,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//place-holder?: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//place-holder?: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//place-holder?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//place-holder?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//place-holder?: arg 1: expected native") + return env.NewError("Go(*widget.Select)//place-holder?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.PlaceHolder) @@ -92919,21 +93478,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//position: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//position: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//position: arg 1: expected native") + return env.NewError("Go(*widget.Select)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -92948,21 +93507,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//refresh: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//refresh: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.Select)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -92975,42 +93534,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//resize: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//resize: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//resize: arg 1: expected native") + return env.NewError("Go(*widget.Select)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//resize: arg 2: expected native") + return env.NewError("Go(*widget.Select)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -93021,28 +93574,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//selected!: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//selected!: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//selected!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//selected!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//selected!: arg 1: expected native") + return env.NewError("Go(*widget.Select)//selected!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.Selected = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//selected!: arg 2: expected string") + return env.NewError("Go(*widget.Select)//selected!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.Selected = newVal return arg0 }, }, @@ -93053,21 +93608,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//selected-index: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//selected-index: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//selected-index: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//selected-index: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//selected-index: arg 1: expected native") + return env.NewError("Go(*widget.Select)//selected-index: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.SelectedIndex() var res0Obj env.Object @@ -93082,21 +93637,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//selected?: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//selected?: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//selected?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//selected?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//selected?: arg 1: expected native") + return env.NewError("Go(*widget.Select)//selected?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.Selected) @@ -93110,50 +93665,43 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//set-options: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//set-options: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//set-options: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//set-options: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//set-options: arg 1: expected native") + return env.NewError("Go(*widget.Select)//set-options: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []string switch v := arg1.(type) { case env.Block: arg1Val = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - arg1Val[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + arg1Val[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//set-options: arg 2: block item: expected string") + return env.NewError("Go(*widget.Select)//set-options: arg 2: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//set-options: arg 2: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//set-options: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//set-options: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//set-options: arg 2: expected block, native or nil") + return env.NewError("Go(*widget.Select)//set-options: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetOptions(arg1Val) return arg0 @@ -93166,28 +93714,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//set-selected: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//set-selected: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//set-selected: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//set-selected: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//set-selected: arg 1: expected native") + return env.NewError("Go(*widget.Select)//set-selected: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//set-selected: arg 2: expected string") + return env.NewError("Go(*widget.Select)//set-selected: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetSelected(arg1Val) return arg0 @@ -93200,28 +93748,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//set-selected-index: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//set-selected-index: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//set-selected-index: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//set-selected-index: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//set-selected-index: arg 1: expected native") + return env.NewError("Go(*widget.Select)//set-selected-index: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//set-selected-index: arg 2: expected integer") + return env.NewError("Go(*widget.Select)//set-selected-index: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetSelectedIndex(arg1Val) return arg0 @@ -93234,21 +93782,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//show: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//show: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//show: arg 1: expected native") + return env.NewError("Go(*widget.Select)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -93261,21 +93809,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//size: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//size: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//size: arg 1: expected native") + return env.NewError("Go(*widget.Select)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -93290,40 +93838,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//tapped: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//tapped: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//tapped: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//tapped: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//tapped: arg 1: expected native") + return env.NewError("Go(*widget.Select)//tapped: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.PointEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.PointEvent) - if !ok { + if vc, ok := v.Value.(*fyne.PointEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//tapped: arg 2: expected native of type *fyne.PointEvent") + return env.NewError("Go(*widget.Select)//tapped: arg 2: " + "expected native of type *fyne.PointEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//tapped: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//tapped: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//tapped: arg 2: expected native") + return env.NewError("Go(*widget.Select)//tapped: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Tapped(arg1Val) return arg0 @@ -93336,40 +93884,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//typed-key: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//typed-key: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//typed-key: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//typed-key: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//typed-key: arg 1: expected native") + return env.NewError("Go(*widget.Select)//typed-key: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.KeyEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.KeyEvent) - if !ok { + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//typed-key: arg 2: expected native of type *fyne.KeyEvent") + return env.NewError("Go(*widget.Select)//typed-key: arg 2: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//typed-key: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//typed-key: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//typed-key: arg 2: expected native") + return env.NewError("Go(*widget.Select)//typed-key: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedKey(arg1Val) return arg0 @@ -93382,34 +93930,34 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//typed-rune: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//typed-rune: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//typed-rune: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//typed-rune: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//typed-rune: arg 1: expected native") + return env.NewError("Go(*widget.Select)//typed-rune: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val rune switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//typed-rune: arg 2: expected native of type rune") + return env.NewError("Go(*widget.Select)//typed-rune: arg 2: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//typed-rune: arg 2: expected native") + return env.NewError("Go(*widget.Select)//typed-rune: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedRune(arg1Val) return arg0 @@ -93422,21 +93970,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Select switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Select) - if !ok { + if vc, ok := v.Value.(*widget.Select); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//visible: arg 1: expected native of type *widget.Select") + return env.NewError("Go(*widget.Select)//visible: arg 1: " + "expected native of type *widget.Select, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Select)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Select)//visible: arg 1: expected native") + return env.NewError("Go(*widget.Select)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -93451,21 +93999,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//accepts-tab: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//accepts-tab: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//accepts-tab: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//accepts-tab: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//accepts-tab: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//accepts-tab: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.AcceptsTab() var res0Obj env.Object @@ -93480,47 +94028,49 @@ var Builtins = map[string]*env.Builtin{ var self *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//action-item!: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//action-item!: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//action-item!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//action-item!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//action-item!: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//action-item!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.CanvasObject switch v := arg1.(type) { case env.RyeCtx: var err error - self.ActionItem, err = ctxTo_fyne_CanvasObject(ps, v) + newVal, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//action-item!: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.SelectEntry)//action-item!: arg 2: " + err.Error()) } case env.Native: - var ok bool - self.ActionItem, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//action-item!: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("Go(*widget.SelectEntry)//action-item!: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//action-item!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//action-item!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.ActionItem = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//action-item!: arg 2: expected native") + return env.NewError("Go(*widget.SelectEntry)//action-item!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.ActionItem = newVal return arg0 }, }, @@ -93531,41 +94081,24 @@ var Builtins = map[string]*env.Builtin{ var self *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//action-item?: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//action-item?: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//action-item?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//action-item?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//action-item?: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//action-item?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - { - typ := reflect.TypeOf(self.ActionItem) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - resObj = *env.NewNative(ps.Idx, self.ActionItem, typRyeName) - } else { - resObj = *env.NewNative(ps.Idx, self.ActionItem, "Go(fyne.CanvasObject)") - } - } + resObj = ifaceToNative(ps.Idx, self.ActionItem, "Go(fyne.CanvasObject)") return resObj }, }, @@ -93576,33 +94109,107 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//append: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//append: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//append: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//append: arg 2: expected string") + return env.NewError("Go(*widget.SelectEntry)//append: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.Append(arg1Val) return arg0 }, }, + "Go(*widget.SelectEntry)//base-widget!": { + Doc: "Set *widget.SelectEntry BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.SelectEntry + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//base-widget!: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*widget.SelectEntry)//base-widget?": { + Doc: "Get *widget.SelectEntry BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.SelectEntry + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//base-widget?: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj + }, + }, "Go(*widget.SelectEntry)//bind": { Doc: "(*widget.SelectEntry).Bind", Argsn: 2, @@ -93610,21 +94217,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//bind: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//bind: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//bind: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//bind: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//bind: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//bind: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.String switch v := arg1.(type) { @@ -93633,24 +94240,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_String(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//bind: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.SelectEntry)//bind: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.String) - if !ok { + if vc, ok := v.Value.(binding.String); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//bind: arg 2: expected native of type binding.String") + return env.NewError("Go(*widget.SelectEntry)//bind: arg 2: " + "expected native of type binding.String, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//bind: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//bind: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//bind: arg 2: expected native") + return env.NewError("Go(*widget.SelectEntry)//bind: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Bind(arg1Val) return arg0 @@ -93663,42 +94270,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//create-renderer: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//create-renderer: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//create-renderer: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -93709,42 +94299,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//cursor: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//cursor: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//cursor: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//cursor: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//cursor: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//cursor: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Cursor() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(desktop.Cursor)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(desktop.Cursor)") return res0Obj }, }, @@ -93755,28 +94328,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//cursor-column!: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//cursor-column!: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//cursor-column!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//cursor-column!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//cursor-column!: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//cursor-column!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.CursorColumn = int(v.Value) + var newVal int + if vc, ok := arg1.(env.Integer); ok { + newVal = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//cursor-column!: arg 2: expected integer") + return env.NewError("Go(*widget.SelectEntry)//cursor-column!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.CursorColumn = newVal return arg0 }, }, @@ -93787,21 +94362,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//cursor-column?: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//cursor-column?: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//cursor-column?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//cursor-column?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//cursor-column?: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//cursor-column?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(self.CursorColumn)) @@ -93815,28 +94390,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//cursor-row!: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//cursor-row!: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//cursor-row!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//cursor-row!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//cursor-row!: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//cursor-row!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.CursorRow = int(v.Value) + var newVal int + if vc, ok := arg1.(env.Integer); ok { + newVal = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//cursor-row!: arg 2: expected integer") + return env.NewError("Go(*widget.SelectEntry)//cursor-row!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.CursorRow = newVal return arg0 }, }, @@ -93847,21 +94424,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//cursor-row?: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//cursor-row?: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//cursor-row?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//cursor-row?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//cursor-row?: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//cursor-row?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(self.CursorRow)) @@ -93875,26 +94452,100 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//disable: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//disable: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//disable: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//disable: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//disable: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//disable: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Disable() return arg0 }, }, + "Go(*widget.SelectEntry)//disableable-widget!": { + Doc: "Set *widget.SelectEntry DisableableWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.SelectEntry + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//disableable-widget!: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//disableable-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//disableable-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.DisableableWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.DisableableWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//disableable-widget!: arg 2: " + "expected native of type *widget.DisableableWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//disableable-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//disableable-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.DisableableWidget = *newVal + return arg0 + }, + }, + "Go(*widget.SelectEntry)//disableable-widget?": { + Doc: "Get *widget.SelectEntry DisableableWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.SelectEntry + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//disableable-widget?: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//disableable-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//disableable-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.DisableableWidget, "Go(*widget.DisableableWidget)") + return resObj + }, + }, "Go(*widget.SelectEntry)//disabled": { Doc: "(*widget.SelectEntry).Disabled", Argsn: 1, @@ -93902,21 +94553,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//disabled: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//disabled: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//disabled: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//disabled: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//disabled: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//disabled: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Disabled() var res0Obj env.Object @@ -93931,40 +94582,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//double-tapped: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//double-tapped: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//double-tapped: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//double-tapped: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//double-tapped: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//double-tapped: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.PointEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.PointEvent) - if !ok { + if vc, ok := v.Value.(*fyne.PointEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//double-tapped: arg 2: expected native of type *fyne.PointEvent") + return env.NewError("Go(*widget.SelectEntry)//double-tapped: arg 2: " + "expected native of type *fyne.PointEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//double-tapped: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//double-tapped: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//double-tapped: arg 2: expected native") + return env.NewError("Go(*widget.SelectEntry)//double-tapped: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.DoubleTapped(arg1Val) return arg0 @@ -93977,21 +94628,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//drag-end: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//drag-end: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//drag-end: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//drag-end: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//drag-end: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//drag-end: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.DragEnd() return arg0 @@ -94004,40 +94655,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//dragged: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//dragged: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//dragged: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//dragged: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//dragged: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//dragged: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.DragEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.DragEvent) - if !ok { + if vc, ok := v.Value.(*fyne.DragEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//dragged: arg 2: expected native of type *fyne.DragEvent") + return env.NewError("Go(*widget.SelectEntry)//dragged: arg 2: " + "expected native of type *fyne.DragEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//dragged: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//dragged: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//dragged: arg 2: expected native") + return env.NewError("Go(*widget.SelectEntry)//dragged: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Dragged(arg1Val) return arg0 @@ -94050,26 +94701,100 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//enable: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//enable: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//enable: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//enable: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//enable: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//enable: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Enable() return arg0 }, }, + "Go(*widget.SelectEntry)//entry!": { + Doc: "Set *widget.SelectEntry Entry value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.SelectEntry + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//entry!: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//entry!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//entry!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.Entry + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Entry); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//entry!: arg 2: " + "expected native of type *widget.Entry, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//entry!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//entry!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.Entry = *newVal + return arg0 + }, + }, + "Go(*widget.SelectEntry)//entry?": { + Doc: "Get *widget.SelectEntry Entry value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.SelectEntry + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//entry?: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//entry?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//entry?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.Entry, "Go(*widget.Entry)") + return resObj + }, + }, "Go(*widget.SelectEntry)//extend-base-widget": { Doc: "(*widget.SelectEntry).ExtendBaseWidget", Argsn: 2, @@ -94077,21 +94802,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//extend-base-widget: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//extend-base-widget: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -94100,24 +94825,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.SelectEntry)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.SelectEntry)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.SelectEntry)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -94130,21 +94855,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//focus-gained: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//focus-gained: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//focus-gained: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//focus-gained: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//focus-gained: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//focus-gained: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusGained() return arg0 @@ -94157,21 +94882,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//focus-lost: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//focus-lost: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//focus-lost: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//focus-lost: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//focus-lost: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//focus-lost: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusLost() return arg0 @@ -94184,28 +94909,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//hidden!: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//hidden!: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.SelectEntry)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -94216,21 +94943,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//hidden?: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//hidden?: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -94244,21 +94971,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//hide: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//hide: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//hide: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -94271,40 +94998,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//key-down: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//key-down: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//key-down: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//key-down: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//key-down: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//key-down: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.KeyEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.KeyEvent) - if !ok { + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//key-down: arg 2: expected native of type *fyne.KeyEvent") + return env.NewError("Go(*widget.SelectEntry)//key-down: arg 2: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//key-down: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//key-down: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//key-down: arg 2: expected native") + return env.NewError("Go(*widget.SelectEntry)//key-down: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.KeyDown(arg1Val) return arg0 @@ -94317,40 +95044,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//key-up: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//key-up: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//key-up: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//key-up: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//key-up: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//key-up: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.KeyEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.KeyEvent) - if !ok { + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//key-up: arg 2: expected native of type *fyne.KeyEvent") + return env.NewError("Go(*widget.SelectEntry)//key-up: arg 2: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//key-up: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//key-up: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//key-up: arg 2: expected native") + return env.NewError("Go(*widget.SelectEntry)//key-up: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.KeyUp(arg1Val) return arg0 @@ -94363,21 +95090,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//keyboard: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//keyboard: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//keyboard: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//keyboard: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//keyboard: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//keyboard: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Keyboard() var res0Obj env.Object @@ -94392,21 +95119,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//min-size: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//min-size: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -94421,40 +95148,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//mouse-down: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//mouse-down: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//mouse-down: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//mouse-down: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//mouse-down: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//mouse-down: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *desktop.MouseEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//mouse-down: arg 2: expected native of type *desktop.MouseEvent") + return env.NewError("Go(*widget.SelectEntry)//mouse-down: arg 2: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//mouse-down: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//mouse-down: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//mouse-down: arg 2: expected native") + return env.NewError("Go(*widget.SelectEntry)//mouse-down: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.MouseDown(arg1Val) return arg0 @@ -94467,40 +95194,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//mouse-up: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//mouse-up: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//mouse-up: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//mouse-up: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//mouse-up: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//mouse-up: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *desktop.MouseEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//mouse-up: arg 2: expected native of type *desktop.MouseEvent") + return env.NewError("Go(*widget.SelectEntry)//mouse-up: arg 2: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//mouse-up: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//mouse-up: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//mouse-up: arg 2: expected native") + return env.NewError("Go(*widget.SelectEntry)//mouse-up: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.MouseUp(arg1Val) return arg0 @@ -94513,42 +95240,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//move: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//move: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//move: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//move: arg 2: expected native") + return env.NewError("Go(*widget.SelectEntry)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -94559,28 +95280,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//multi-line!: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//multi-line!: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//multi-line!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//multi-line!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//multi-line!: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//multi-line!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.MultiLine = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//multi-line!: arg 2: expected integer") + return env.NewError("Go(*widget.SelectEntry)//multi-line!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.MultiLine = newVal return arg0 }, }, @@ -94591,21 +95314,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//multi-line?: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//multi-line?: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//multi-line?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//multi-line?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//multi-line?: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//multi-line?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.MultiLine)) @@ -94619,45 +95342,47 @@ var Builtins = map[string]*env.Builtin{ var self *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//on-changed!: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//on-changed!: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//on-changed!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//on-changed!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//on-changed!: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//on-changed!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(string) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//on-changed!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*widget.SelectEntry)//on-changed!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnChanged = func(arg0 string) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + newVal = func(farg0 string) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//on-changed!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//on-changed!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnChanged = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//on-changed!: arg 2: expected function or nil") + return env.NewError("Go(*widget.SelectEntry)//on-changed!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnChanged = newVal return arg0 }, }, @@ -94668,24 +95393,34 @@ var Builtins = map[string]*env.Builtin{ var self *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//on-changed?: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//on-changed?: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//on-changed?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//on-changed?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//on-changed?: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//on-changed?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnChanged, "Go(func(string))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val string + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//on-changed?: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) + } + self.OnChanged(arg0Val) + return nil + }, 1, false, false, "Returned func") return resObj }, }, @@ -94696,29 +95431,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//on-cursor-changed!: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//on-cursor-changed!: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//on-cursor-changed!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//on-cursor-changed!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//on-cursor-changed!: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//on-cursor-changed!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func() switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//on-cursor-changed!: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(*widget.SelectEntry)//on-cursor-changed!: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnCursorChanged = func() { + newVal = func() { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, ps.Ctx) @@ -94726,13 +95462,14 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//on-cursor-changed!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//on-cursor-changed!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnCursorChanged = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//on-cursor-changed!: arg 2: expected function or nil") + return env.NewError("Go(*widget.SelectEntry)//on-cursor-changed!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnCursorChanged = newVal return arg0 }, }, @@ -94743,24 +95480,27 @@ var Builtins = map[string]*env.Builtin{ var self *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//on-cursor-changed?: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//on-cursor-changed?: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//on-cursor-changed?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//on-cursor-changed?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//on-cursor-changed?: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//on-cursor-changed?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnCursorChanged, "Go(func())") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + self.OnCursorChanged() + return nil + }, 0, false, false, "Returned func") return resObj }, }, @@ -94771,45 +95511,47 @@ var Builtins = map[string]*env.Builtin{ var self *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//on-submitted!: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//on-submitted!: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//on-submitted!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//on-submitted!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//on-submitted!: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//on-submitted!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(string) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//on-submitted!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*widget.SelectEntry)//on-submitted!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnSubmitted = func(arg0 string) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + newVal = func(farg0 string) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//on-submitted!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//on-submitted!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnSubmitted = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//on-submitted!: arg 2: expected function or nil") + return env.NewError("Go(*widget.SelectEntry)//on-submitted!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnSubmitted = newVal return arg0 }, }, @@ -94820,24 +95562,34 @@ var Builtins = map[string]*env.Builtin{ var self *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//on-submitted?: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//on-submitted?: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//on-submitted?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//on-submitted?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//on-submitted?: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//on-submitted?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnSubmitted, "Go(func(string))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val string + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//on-submitted?: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) + } + self.OnSubmitted(arg0Val) + return nil + }, 1, false, false, "Returned func") return resObj }, }, @@ -94848,28 +95600,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//password!: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//password!: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//password!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//password!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//password!: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//password!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Password = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//password!: arg 2: expected integer") + return env.NewError("Go(*widget.SelectEntry)//password!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Password = newVal return arg0 }, }, @@ -94880,21 +95634,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//password?: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//password?: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//password?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//password?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//password?: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//password?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Password)) @@ -94908,28 +95662,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//place-holder!: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//place-holder!: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//place-holder!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//place-holder!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//place-holder!: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//place-holder!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.PlaceHolder = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//place-holder!: arg 2: expected string") + return env.NewError("Go(*widget.SelectEntry)//place-holder!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.PlaceHolder = newVal return arg0 }, }, @@ -94940,21 +95696,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//place-holder?: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//place-holder?: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//place-holder?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//place-holder?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//place-holder?: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//place-holder?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.PlaceHolder) @@ -94968,21 +95724,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//position: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//position: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//position: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -94997,21 +95753,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//refresh: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//refresh: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -95024,123 +95780,37 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//resize: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//resize: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//resize: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//resize: arg 2: expected integer to be 0 or nil") - } - arg1Val = nil - default: - ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//resize: arg 2: expected native") - } - arg0Val.Resize(*arg1Val) - return arg0 - }, - }, - "Go(*widget.SelectEntry)//scroll!": { - Doc: "Set *widget.SelectEntry Scroll value", - Argsn: 2, - Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var self *widget.SelectEntry - switch v := arg0.(type) { - case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//scroll!: arg 1: expected native of type *widget.SelectEntry") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//scroll!: arg 1: expected integer to be 0 or nil") - } - self = nil - default: - ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//scroll!: arg 1: expected native") - } - { - nat, natOk := arg1.(env.Native) - var natValOk bool - var rOut, rIn reflect.Value - if natOk { - // HACK: self.Scroll, natValOk = internal_widget.ScrollDirection(u) - rOut = reflect.ValueOf(&self.Scroll).Elem() - rIn = reflect.ValueOf(nat.Value) - natValOk = rIn.CanConvert(rOut.Type()) - } - if natValOk { - rOut.Set(rIn.Convert(rOut.Type())) + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc } else { - var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) - } else { - ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//scroll!: arg 2: expected integer") - } - // HACK: self.Scroll = internal_widget.ScrollDirection(u) - rOut := reflect.ValueOf(&self.Scroll).Elem() - rIn := reflect.ValueOf(u) - rOut.Set(rIn.Convert(rOut.Type())) - } - } - return arg0 - }, - }, - "Go(*widget.SelectEntry)//scroll?": { - Doc: "Get *widget.SelectEntry Scroll value", - Argsn: 1, - Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var self *widget.SelectEntry - switch v := arg0.(type) { - case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//scroll?: arg 1: expected native of type *widget.SelectEntry") - } - case env.Integer: - if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//scroll?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//scroll?: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var resObj env.Object - resObj = *env.NewInteger(int64(int(self.Scroll))) - return resObj + arg0Val.Resize(arg1Val) + return arg0 }, }, "Go(*widget.SelectEntry)//selected-text": { @@ -95150,21 +95820,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//selected-text: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//selected-text: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//selected-text: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//selected-text: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//selected-text: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//selected-text: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.SelectedText() var res0Obj env.Object @@ -95179,28 +95849,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-min-rows-visible: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//set-min-rows-visible: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-min-rows-visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//set-min-rows-visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-min-rows-visible: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//set-min-rows-visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-min-rows-visible: arg 2: expected integer") + return env.NewError("Go(*widget.SelectEntry)//set-min-rows-visible: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetMinRowsVisible(arg1Val) return arg0 @@ -95213,47 +95883,47 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-on-validation-changed: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//set-on-validation-changed: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-on-validation-changed: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//set-on-validation-changed: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-on-validation-changed: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//set-on-validation-changed: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func(error) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-on-validation-changed: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*widget.SelectEntry)//set-on-validation-changed: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg1Val = func(arg0 error) { - var arg0Val env.Object - if arg0 != nil { - arg0Val = env.NewError(arg0.Error()) + arg1Val = func(farg0 error) { + var farg0Val env.Object + if farg0 != nil { + farg0Val = env.NewError(farg0.Error()) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-on-validation-changed: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//set-on-validation-changed: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-on-validation-changed: arg 2: expected function or nil") + return env.NewError("Go(*widget.SelectEntry)//set-on-validation-changed: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } arg0Val.SetOnValidationChanged(arg1Val) return arg0 @@ -95266,50 +95936,43 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-options: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//set-options: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-options: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//set-options: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-options: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//set-options: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []string switch v := arg1.(type) { case env.Block: arg1Val = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - arg1Val[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + arg1Val[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-options: arg 2: block item: expected string") + return env.NewError("Go(*widget.SelectEntry)//set-options: arg 2: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-options: arg 2: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-options: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//set-options: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-options: arg 2: expected block, native or nil") + return env.NewError("Go(*widget.SelectEntry)//set-options: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetOptions(arg1Val) return arg0 @@ -95322,28 +95985,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-place-holder: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//set-place-holder: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-place-holder: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//set-place-holder: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-place-holder: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//set-place-holder: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-place-holder: arg 2: expected string") + return env.NewError("Go(*widget.SelectEntry)//set-place-holder: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetPlaceHolder(arg1Val) return arg0 @@ -95356,28 +96019,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-text: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//set-text: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-text: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//set-text: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-text: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//set-text: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-text: arg 2: expected string") + return env.NewError("Go(*widget.SelectEntry)//set-text: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetText(arg1Val) return arg0 @@ -95390,21 +96053,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-validation-error: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//set-validation-error: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-validation-error: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//set-validation-error: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-validation-error: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//set-validation-error: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val error switch v := arg1.(type) { @@ -95415,12 +96078,12 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-validation-error: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//set-validation-error: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//set-validation-error: arg 2: expected error, string or nil") + return env.NewError("Go(*widget.SelectEntry)//set-validation-error: arg 2: " + "expected error, string or nil, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetValidationError(arg1Val) return arg0 @@ -95433,21 +96096,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//show: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//show: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//show: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -95460,21 +96123,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//size: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//size: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//size: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -95489,40 +96152,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//tapped: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//tapped: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//tapped: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//tapped: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//tapped: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//tapped: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.PointEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.PointEvent) - if !ok { + if vc, ok := v.Value.(*fyne.PointEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//tapped: arg 2: expected native of type *fyne.PointEvent") + return env.NewError("Go(*widget.SelectEntry)//tapped: arg 2: " + "expected native of type *fyne.PointEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//tapped: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//tapped: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//tapped: arg 2: expected native") + return env.NewError("Go(*widget.SelectEntry)//tapped: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Tapped(arg1Val) return arg0 @@ -95535,40 +96198,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//tapped-secondary: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//tapped-secondary: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//tapped-secondary: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//tapped-secondary: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//tapped-secondary: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//tapped-secondary: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.PointEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.PointEvent) - if !ok { + if vc, ok := v.Value.(*fyne.PointEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//tapped-secondary: arg 2: expected native of type *fyne.PointEvent") + return env.NewError("Go(*widget.SelectEntry)//tapped-secondary: arg 2: " + "expected native of type *fyne.PointEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//tapped-secondary: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//tapped-secondary: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//tapped-secondary: arg 2: expected native") + return env.NewError("Go(*widget.SelectEntry)//tapped-secondary: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TappedSecondary(arg1Val) return arg0 @@ -95581,28 +96244,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//text!: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//text!: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//text!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//text!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//text!: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//text!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.Text = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//text!: arg 2: expected string") + return env.NewError("Go(*widget.SelectEntry)//text!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.Text = newVal return arg0 }, }, @@ -95613,34 +96278,42 @@ var Builtins = map[string]*env.Builtin{ var self *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//text-style!: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//text-style!: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//text-style!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//text-style!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//text-style!: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//text-style!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal *fyne.TextStyle switch v := arg1.(type) { case env.Native: - var ok bool - self.TextStyle, ok = v.Value.(fyne.TextStyle) - if !ok { + if vc, ok := v.Value.(*fyne.TextStyle); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//text-style!: arg 2: " + "expected native of type *fyne.TextStyle, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//text-style!: arg 2: expected native of type fyne.TextStyle") + return env.NewError("Go(*widget.SelectEntry)//text-style!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//text-style!: arg 2: expected native") + return env.NewError("Go(*widget.SelectEntry)//text-style!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.TextStyle = *newVal return arg0 }, }, @@ -95651,21 +96324,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//text-style?: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//text-style?: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//text-style?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//text-style?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//text-style?: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//text-style?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, &self.TextStyle, "Go(*fyne.TextStyle)") @@ -95679,21 +96352,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//text?: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//text?: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//text?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//text?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//text?: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//text?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.Text) @@ -95707,40 +96380,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//touch-cancel: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//touch-cancel: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//touch-cancel: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//touch-cancel: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//touch-cancel: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//touch-cancel: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *mobile.TouchEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*mobile.TouchEvent) - if !ok { + if vc, ok := v.Value.(*mobile.TouchEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//touch-cancel: arg 2: expected native of type *mobile.TouchEvent") + return env.NewError("Go(*widget.SelectEntry)//touch-cancel: arg 2: " + "expected native of type *mobile.TouchEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//touch-cancel: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//touch-cancel: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//touch-cancel: arg 2: expected native") + return env.NewError("Go(*widget.SelectEntry)//touch-cancel: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TouchCancel(arg1Val) return arg0 @@ -95753,40 +96426,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//touch-down: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//touch-down: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//touch-down: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//touch-down: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//touch-down: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//touch-down: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *mobile.TouchEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*mobile.TouchEvent) - if !ok { + if vc, ok := v.Value.(*mobile.TouchEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//touch-down: arg 2: expected native of type *mobile.TouchEvent") + return env.NewError("Go(*widget.SelectEntry)//touch-down: arg 2: " + "expected native of type *mobile.TouchEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//touch-down: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//touch-down: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//touch-down: arg 2: expected native") + return env.NewError("Go(*widget.SelectEntry)//touch-down: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TouchDown(arg1Val) return arg0 @@ -95799,40 +96472,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//touch-up: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//touch-up: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//touch-up: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//touch-up: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//touch-up: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//touch-up: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *mobile.TouchEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*mobile.TouchEvent) - if !ok { + if vc, ok := v.Value.(*mobile.TouchEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//touch-up: arg 2: expected native of type *mobile.TouchEvent") + return env.NewError("Go(*widget.SelectEntry)//touch-up: arg 2: " + "expected native of type *mobile.TouchEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//touch-up: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//touch-up: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//touch-up: arg 2: expected native") + return env.NewError("Go(*widget.SelectEntry)//touch-up: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TouchUp(arg1Val) return arg0 @@ -95845,40 +96518,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//typed-key: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//typed-key: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//typed-key: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//typed-key: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//typed-key: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//typed-key: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.KeyEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.KeyEvent) - if !ok { + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//typed-key: arg 2: expected native of type *fyne.KeyEvent") + return env.NewError("Go(*widget.SelectEntry)//typed-key: arg 2: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//typed-key: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//typed-key: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//typed-key: arg 2: expected native") + return env.NewError("Go(*widget.SelectEntry)//typed-key: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedKey(arg1Val) return arg0 @@ -95891,34 +96564,34 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//typed-rune: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//typed-rune: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//typed-rune: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//typed-rune: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//typed-rune: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//typed-rune: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val rune switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//typed-rune: arg 2: expected native of type rune") + return env.NewError("Go(*widget.SelectEntry)//typed-rune: arg 2: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//typed-rune: arg 2: expected native") + return env.NewError("Go(*widget.SelectEntry)//typed-rune: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedRune(arg1Val) return arg0 @@ -95931,21 +96604,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//typed-shortcut: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//typed-shortcut: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//typed-shortcut: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//typed-shortcut: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//typed-shortcut: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//typed-shortcut: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Shortcut switch v := arg1.(type) { @@ -95954,24 +96627,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Shortcut(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//typed-shortcut: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.SelectEntry)//typed-shortcut: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Shortcut) - if !ok { + if vc, ok := v.Value.(fyne.Shortcut); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//typed-shortcut: arg 2: expected native of type fyne.Shortcut") + return env.NewError("Go(*widget.SelectEntry)//typed-shortcut: arg 2: " + "expected native of type fyne.Shortcut, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//typed-shortcut: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//typed-shortcut: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//typed-shortcut: arg 2: expected native") + return env.NewError("Go(*widget.SelectEntry)//typed-shortcut: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedShortcut(arg1Val) return arg0 @@ -95984,21 +96657,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//unbind: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//unbind: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//unbind: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//unbind: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//unbind: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//unbind: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Unbind() return arg0 @@ -96011,21 +96684,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//validate: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//validate: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//validate: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//validate: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//validate: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//validate: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Validate() var resErrObj env.Object @@ -96046,22 +96719,23 @@ var Builtins = map[string]*env.Builtin{ var self *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//validator!: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//validator!: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//validator!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//validator!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//validator!: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//validator!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.StringValidator { nat, natOk := arg1.(env.Native) var natValOk bool @@ -96070,21 +96744,21 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(fyne.StringValidator) } if natValOk { - self.Validator = natVal + newVal = natVal } else { var u func(string) error switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//validator!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*widget.SelectEntry)//validator!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - u = func(arg0 string) error { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + u = func(farg0 string) error { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -96093,8 +96767,9 @@ var Builtins = map[string]*env.Builtin{ res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.SelectEntry)//validator!: arg 2: callback result: expected integer to be 0 or nil", + "Go(*widget.SelectEntry)//validator!: arg 2: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -96102,8 +96777,9 @@ var Builtins = map[string]*env.Builtin{ } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.SelectEntry)//validator!: arg 2: callback result: expected error, string or nil", + "Go(*widget.SelectEntry)//validator!: arg 2: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -96114,16 +96790,17 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//validator!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//validator!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } u = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//validator!: arg 2: expected function or nil") + return env.NewError("Go(*widget.SelectEntry)//validator!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } - self.Validator = fyne.StringValidator(u) + newVal = fyne.StringValidator(u) } } + self.Validator = newVal return arg0 }, }, @@ -96134,24 +96811,42 @@ var Builtins = map[string]*env.Builtin{ var self *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//validator?: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//validator?: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//validator?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//validator?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//validator?: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//validator?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, (func(string) error)(self.Validator), "Go(func(string) (error))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val string + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.SelectEntry)//validator?: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) + } + resErr := (func(string) error)(self.Validator)(arg0Val) + var resErrObj env.Object + if resErr != nil { + resErrObj = env.NewError(resErr.Error()) + } + if resErrObj != nil { + ps.FailureFlag = true + return resErrObj + } + return nil + }, 1, false, false, "Returned func") return resObj }, }, @@ -96162,21 +96857,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//visible: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//visible: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//visible: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -96191,22 +96886,23 @@ var Builtins = map[string]*env.Builtin{ var self *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//wrapping!: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//wrapping!: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//wrapping!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//wrapping!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//wrapping!: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//wrapping!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.TextWrap { nat, natOk := arg1.(env.Native) var natValOk bool @@ -96215,18 +96911,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(fyne.TextWrap) } if natValOk { - self.Wrapping = natVal + newVal = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//wrapping!: arg 2: expected integer") + return env.NewError("Go(*widget.SelectEntry)//wrapping!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } - self.Wrapping = fyne.TextWrap(u) + newVal = fyne.TextWrap(u) } } + self.Wrapping = newVal return arg0 }, }, @@ -96237,27 +96934,101 @@ var Builtins = map[string]*env.Builtin{ var self *widget.SelectEntry switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.SelectEntry) - if !ok { + if vc, ok := v.Value.(*widget.SelectEntry); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//wrapping?: arg 1: expected native of type *widget.SelectEntry") + return env.NewError("Go(*widget.SelectEntry)//wrapping?: arg 1: " + "expected native of type *widget.SelectEntry, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//wrapping?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SelectEntry)//wrapping?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SelectEntry)//wrapping?: arg 1: expected native") + return env.NewError("Go(*widget.SelectEntry)//wrapping?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(int(self.Wrapping))) return resObj }, }, + "Go(*widget.Separator)//base-widget!": { + Doc: "Set *widget.Separator BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Separator + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Separator); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Separator)//base-widget!: arg 1: " + "expected native of type *widget.Separator, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Separator)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Separator)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Separator)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Separator)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Separator)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*widget.Separator)//base-widget?": { + Doc: "Get *widget.Separator BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Separator + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Separator); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Separator)//base-widget?: arg 1: " + "expected native of type *widget.Separator, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Separator)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Separator)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj + }, + }, "Go(*widget.Separator)//create-renderer": { Doc: "(*widget.Separator).CreateRenderer", Argsn: 1, @@ -96265,42 +97036,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Separator switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Separator) - if !ok { + if vc, ok := v.Value.(*widget.Separator); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//create-renderer: arg 1: expected native of type *widget.Separator") + return env.NewError("Go(*widget.Separator)//create-renderer: arg 1: " + "expected native of type *widget.Separator, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Separator)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//create-renderer: arg 1: expected native") + return env.NewError("Go(*widget.Separator)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -96311,21 +97065,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Separator switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Separator) - if !ok { + if vc, ok := v.Value.(*widget.Separator); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//extend-base-widget: arg 1: expected native of type *widget.Separator") + return env.NewError("Go(*widget.Separator)//extend-base-widget: arg 1: " + "expected native of type *widget.Separator, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Separator)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.Separator)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -96334,24 +97088,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Separator)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.Separator)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Separator)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.Separator)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -96364,28 +97118,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Separator switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Separator) - if !ok { + if vc, ok := v.Value.(*widget.Separator); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//hidden!: arg 1: expected native of type *widget.Separator") + return env.NewError("Go(*widget.Separator)//hidden!: arg 1: " + "expected native of type *widget.Separator, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Separator)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.Separator)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.Separator)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -96396,21 +97152,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Separator switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Separator) - if !ok { + if vc, ok := v.Value.(*widget.Separator); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//hidden?: arg 1: expected native of type *widget.Separator") + return env.NewError("Go(*widget.Separator)//hidden?: arg 1: " + "expected native of type *widget.Separator, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Separator)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.Separator)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -96424,21 +97180,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Separator switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Separator) - if !ok { + if vc, ok := v.Value.(*widget.Separator); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//hide: arg 1: expected native of type *widget.Separator") + return env.NewError("Go(*widget.Separator)//hide: arg 1: " + "expected native of type *widget.Separator, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Separator)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//hide: arg 1: expected native") + return env.NewError("Go(*widget.Separator)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -96451,21 +97207,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Separator switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Separator) - if !ok { + if vc, ok := v.Value.(*widget.Separator); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//min-size: arg 1: expected native of type *widget.Separator") + return env.NewError("Go(*widget.Separator)//min-size: arg 1: " + "expected native of type *widget.Separator, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Separator)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.Separator)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -96480,42 +97236,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Separator switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Separator) - if !ok { + if vc, ok := v.Value.(*widget.Separator); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//move: arg 1: expected native of type *widget.Separator") + return env.NewError("Go(*widget.Separator)//move: arg 1: " + "expected native of type *widget.Separator, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Separator)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//move: arg 1: expected native") + return env.NewError("Go(*widget.Separator)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Separator)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//move: arg 2: expected native") + return env.NewError("Go(*widget.Separator)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -96526,21 +97276,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Separator switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Separator) - if !ok { + if vc, ok := v.Value.(*widget.Separator); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//position: arg 1: expected native of type *widget.Separator") + return env.NewError("Go(*widget.Separator)//position: arg 1: " + "expected native of type *widget.Separator, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Separator)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//position: arg 1: expected native") + return env.NewError("Go(*widget.Separator)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -96555,21 +97305,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Separator switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Separator) - if !ok { + if vc, ok := v.Value.(*widget.Separator); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//refresh: arg 1: expected native of type *widget.Separator") + return env.NewError("Go(*widget.Separator)//refresh: arg 1: " + "expected native of type *widget.Separator, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Separator)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.Separator)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -96582,42 +97332,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Separator switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Separator) - if !ok { + if vc, ok := v.Value.(*widget.Separator); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//resize: arg 1: expected native of type *widget.Separator") + return env.NewError("Go(*widget.Separator)//resize: arg 1: " + "expected native of type *widget.Separator, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Separator)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//resize: arg 1: expected native") + return env.NewError("Go(*widget.Separator)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Separator)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//resize: arg 2: expected native") + return env.NewError("Go(*widget.Separator)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -96628,21 +97372,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Separator switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Separator) - if !ok { + if vc, ok := v.Value.(*widget.Separator); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//show: arg 1: expected native of type *widget.Separator") + return env.NewError("Go(*widget.Separator)//show: arg 1: " + "expected native of type *widget.Separator, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Separator)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//show: arg 1: expected native") + return env.NewError("Go(*widget.Separator)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -96655,21 +97399,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Separator switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Separator) - if !ok { + if vc, ok := v.Value.(*widget.Separator); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//size: arg 1: expected native of type *widget.Separator") + return env.NewError("Go(*widget.Separator)//size: arg 1: " + "expected native of type *widget.Separator, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Separator)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//size: arg 1: expected native") + return env.NewError("Go(*widget.Separator)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -96684,21 +97428,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Separator switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Separator) - if !ok { + if vc, ok := v.Value.(*widget.Separator); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//visible: arg 1: expected native of type *widget.Separator") + return env.NewError("Go(*widget.Separator)//visible: arg 1: " + "expected native of type *widget.Separator, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Separator)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Separator)//visible: arg 1: expected native") + return env.NewError("Go(*widget.Separator)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -96713,21 +97457,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SeparatorSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SeparatorSegment) - if !ok { + if vc, ok := v.Value.(*widget.SeparatorSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//inline: arg 1: expected native of type *widget.SeparatorSegment") + return env.NewError("Go(*widget.SeparatorSegment)//inline: arg 1: " + "expected native of type *widget.SeparatorSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//inline: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SeparatorSegment)//inline: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//inline: arg 1: expected native") + return env.NewError("Go(*widget.SeparatorSegment)//inline: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Inline() var res0Obj env.Object @@ -96742,61 +97486,49 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SeparatorSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SeparatorSegment) - if !ok { + if vc, ok := v.Value.(*widget.SeparatorSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//select: arg 1: expected native of type *widget.SeparatorSegment") + return env.NewError("Go(*widget.SeparatorSegment)//select: arg 1: " + "expected native of type *widget.SeparatorSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//select: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SeparatorSegment)//select: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//select: arg 1: expected native") + return env.NewError("Go(*widget.SeparatorSegment)//select: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//select: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//select: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SeparatorSegment)//select: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//select: arg 2: expected native") + return env.NewError("Go(*widget.SeparatorSegment)//select: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg2Val *fyne.Position + var arg2Val fyne.Position switch v := arg2.(type) { case env.Native: - var ok bool - arg2Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//select: arg 3: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg2Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//select: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SeparatorSegment)//select: arg 3: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//select: arg 3: expected native") + return env.NewError("Go(*widget.SeparatorSegment)//select: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Select(*arg1Val, *arg2Val) + arg0Val.Select(arg1Val, arg2Val) return arg0 }, }, @@ -96807,21 +97539,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SeparatorSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SeparatorSegment) - if !ok { + if vc, ok := v.Value.(*widget.SeparatorSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//selected-text: arg 1: expected native of type *widget.SeparatorSegment") + return env.NewError("Go(*widget.SeparatorSegment)//selected-text: arg 1: " + "expected native of type *widget.SeparatorSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//selected-text: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SeparatorSegment)//selected-text: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//selected-text: arg 1: expected native") + return env.NewError("Go(*widget.SeparatorSegment)//selected-text: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.SelectedText() var res0Obj env.Object @@ -96836,21 +97568,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SeparatorSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SeparatorSegment) - if !ok { + if vc, ok := v.Value.(*widget.SeparatorSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//textual: arg 1: expected native of type *widget.SeparatorSegment") + return env.NewError("Go(*widget.SeparatorSegment)//textual: arg 1: " + "expected native of type *widget.SeparatorSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//textual: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SeparatorSegment)//textual: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//textual: arg 1: expected native") + return env.NewError("Go(*widget.SeparatorSegment)//textual: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Textual() var res0Obj env.Object @@ -96865,21 +97597,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SeparatorSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SeparatorSegment) - if !ok { + if vc, ok := v.Value.(*widget.SeparatorSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//unselect: arg 1: expected native of type *widget.SeparatorSegment") + return env.NewError("Go(*widget.SeparatorSegment)//unselect: arg 1: " + "expected native of type *widget.SeparatorSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//unselect: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SeparatorSegment)//unselect: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//unselect: arg 1: expected native") + return env.NewError("Go(*widget.SeparatorSegment)//unselect: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Unselect() return arg0 @@ -96892,21 +97624,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SeparatorSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SeparatorSegment) - if !ok { + if vc, ok := v.Value.(*widget.SeparatorSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//update: arg 1: expected native of type *widget.SeparatorSegment") + return env.NewError("Go(*widget.SeparatorSegment)//update: arg 1: " + "expected native of type *widget.SeparatorSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//update: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SeparatorSegment)//update: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//update: arg 1: expected native") + return env.NewError("Go(*widget.SeparatorSegment)//update: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.CanvasObject switch v := arg1.(type) { @@ -96915,24 +97647,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//update: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.SeparatorSegment)//update: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//update: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("Go(*widget.SeparatorSegment)//update: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//update: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SeparatorSegment)//update: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//update: arg 2: expected native") + return env.NewError("Go(*widget.SeparatorSegment)//update: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Update(arg1Val) return arg0 @@ -96945,43 +97677,100 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.SeparatorSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.SeparatorSegment) - if !ok { + if vc, ok := v.Value.(*widget.SeparatorSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//visual: arg 1: expected native of type *widget.SeparatorSegment") + return env.NewError("Go(*widget.SeparatorSegment)//visual: arg 1: " + "expected native of type *widget.SeparatorSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//visual: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.SeparatorSegment)//visual: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.SeparatorSegment)//visual: arg 1: expected native") + return env.NewError("Go(*widget.SeparatorSegment)//visual: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visual() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.CanvasObject)") + return res0Obj + }, + }, + "Go(*widget.Slider)//base-widget!": { + Doc: "Set *widget.Slider BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Slider + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Slider); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Slider)//base-widget!: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Slider)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Slider)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.CanvasObject)") + ps.FailureFlag = true + return env.NewError("Go(*widget.Slider)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Slider)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Slider)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - return res0Obj + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*widget.Slider)//base-widget?": { + Doc: "Get *widget.Slider BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Slider + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Slider); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Slider)//base-widget?: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Slider)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Slider)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj }, }, "Go(*widget.Slider)//bind": { @@ -96991,21 +97780,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//bind: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//bind: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//bind: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//bind: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//bind: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//bind: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.Float switch v := arg1.(type) { @@ -97014,24 +97803,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_Float(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//bind: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Slider)//bind: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.Float) - if !ok { + if vc, ok := v.Value.(binding.Float); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//bind: arg 2: expected native of type binding.Float") + return env.NewError("Go(*widget.Slider)//bind: arg 2: " + "expected native of type binding.Float, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//bind: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//bind: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//bind: arg 2: expected native") + return env.NewError("Go(*widget.Slider)//bind: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Bind(arg1Val) return arg0 @@ -97044,42 +97833,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//create-renderer: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//create-renderer: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//create-renderer: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -97090,21 +97862,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//drag-end: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//drag-end: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//drag-end: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//drag-end: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//drag-end: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//drag-end: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.DragEnd() return arg0 @@ -97117,40 +97889,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//dragged: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//dragged: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//dragged: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//dragged: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//dragged: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//dragged: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.DragEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.DragEvent) - if !ok { + if vc, ok := v.Value.(*fyne.DragEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//dragged: arg 2: expected native of type *fyne.DragEvent") + return env.NewError("Go(*widget.Slider)//dragged: arg 2: " + "expected native of type *fyne.DragEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//dragged: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//dragged: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//dragged: arg 2: expected native") + return env.NewError("Go(*widget.Slider)//dragged: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Dragged(arg1Val) return arg0 @@ -97163,21 +97935,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//extend-base-widget: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//extend-base-widget: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -97186,24 +97958,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Slider)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.Slider)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.Slider)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -97216,21 +97988,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//focus-gained: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//focus-gained: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//focus-gained: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//focus-gained: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//focus-gained: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//focus-gained: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusGained() return arg0 @@ -97243,21 +98015,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//focus-lost: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//focus-lost: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//focus-lost: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//focus-lost: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//focus-lost: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//focus-lost: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusLost() return arg0 @@ -97270,28 +98042,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//hidden!: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//hidden!: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.Slider)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -97302,21 +98076,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//hidden?: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//hidden?: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -97330,21 +98104,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//hide: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//hide: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//hide: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -97357,28 +98131,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//max!: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//max!: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//max!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//max!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//max!: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//max!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Decimal); ok { - self.Max = float64(v.Value) + var newVal float64 + if vc, ok := arg1.(env.Decimal); ok { + newVal = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//max!: arg 2: expected decimal") + return env.NewError("Go(*widget.Slider)//max!: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } + self.Max = newVal return arg0 }, }, @@ -97389,21 +98165,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//max?: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//max?: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//max?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//max?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//max?: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//max?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewDecimal(float64(self.Max)) @@ -97417,28 +98193,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//min!: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//min!: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//min!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//min!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//min!: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//min!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Decimal); ok { - self.Min = float64(v.Value) + var newVal float64 + if vc, ok := arg1.(env.Decimal); ok { + newVal = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//min!: arg 2: expected decimal") + return env.NewError("Go(*widget.Slider)//min!: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } + self.Min = newVal return arg0 }, }, @@ -97449,21 +98227,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//min-size: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//min-size: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -97478,21 +98256,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//min?: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//min?: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//min?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//min?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//min?: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//min?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewDecimal(float64(self.Min)) @@ -97506,40 +98284,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//mouse-in: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//mouse-in: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//mouse-in: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//mouse-in: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//mouse-in: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//mouse-in: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *desktop.MouseEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//mouse-in: arg 2: expected native of type *desktop.MouseEvent") + return env.NewError("Go(*widget.Slider)//mouse-in: arg 2: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//mouse-in: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//mouse-in: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//mouse-in: arg 2: expected native") + return env.NewError("Go(*widget.Slider)//mouse-in: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.MouseIn(arg1Val) return arg0 @@ -97552,40 +98330,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//mouse-moved: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//mouse-moved: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//mouse-moved: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//mouse-moved: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//mouse-moved: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//mouse-moved: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *desktop.MouseEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//mouse-moved: arg 2: expected native of type *desktop.MouseEvent") + return env.NewError("Go(*widget.Slider)//mouse-moved: arg 2: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//mouse-moved: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//mouse-moved: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//mouse-moved: arg 2: expected native") + return env.NewError("Go(*widget.Slider)//mouse-moved: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.MouseMoved(arg1Val) return arg0 @@ -97598,21 +98376,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//mouse-out: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//mouse-out: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//mouse-out: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//mouse-out: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//mouse-out: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//mouse-out: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.MouseOut() return arg0 @@ -97625,168 +98403,176 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//move: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//move: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//move: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Slider)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) + } + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Slider)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + arg0Val.Move(arg1Val) + return arg0 + }, + }, + "Go(*widget.Slider)//on-change-ended!": { + Doc: "Set *widget.Slider OnChangeEnded value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Slider + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Slider); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//move: arg 2: expected native of type *fyne.Position") + return env.NewError("Go(*widget.Slider)//on-change-ended!: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//on-change-ended!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - arg1Val = nil + self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//move: arg 2: expected native") + return env.NewError("Go(*widget.Slider)//on-change-ended!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + var newVal func(float64) + switch fn := arg1.(type) { + case env.Function: + if fn.Argsn != 1 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Slider)//on-change-ended!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) + } + newVal = func(farg0 float64) { + var farg0Val env.Object + farg0Val = *env.NewDecimal(float64(farg0)) + actualFn := fn + _ = actualFn + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) + } + case env.Integer: + if fn.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Slider)//on-change-ended!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Slider)//on-change-ended!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) + } + self.OnChangeEnded = newVal return arg0 }, }, - "Go(*widget.Slider)//on-change-ended!": { - Doc: "Set *widget.Slider OnChangeEnded value", + "Go(*widget.Slider)//on-change-ended?": { + Doc: "Get *widget.Slider OnChangeEnded value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Slider + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Slider); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Slider)//on-change-ended?: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Slider)//on-change-ended?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Slider)//on-change-ended?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val float64 + if vc, ok := arg0.(env.Decimal); ok { + arg0Val = float64(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Slider)//on-change-ended?: arg 1: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg0)) + } + self.OnChangeEnded(arg0Val) + return nil + }, 1, false, false, "Returned func") + return resObj + }, + }, + "Go(*widget.Slider)//on-changed!": { + Doc: "Set *widget.Slider OnChanged value", Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var self *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//on-change-ended!: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//on-changed!: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//on-change-ended!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//on-changed!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//on-change-ended!: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//on-changed!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(float64) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//on-change-ended!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*widget.Slider)//on-changed!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnChangeEnded = func(arg0 float64) { - var arg0Val env.Object - arg0Val = *env.NewDecimal(float64(arg0)) + newVal = func(farg0 float64) { + var farg0Val env.Object + farg0Val = *env.NewDecimal(float64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//on-change-ended!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//on-changed!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnChangeEnded = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//on-change-ended!: arg 2: expected function or nil") - } - return arg0 - }, - }, - "Go(*widget.Slider)//on-change-ended?": { - Doc: "Get *widget.Slider OnChangeEnded value", - Argsn: 1, - Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var self *widget.Slider - switch v := arg0.(type) { - case env.Native: - var ok bool - self, ok = v.Value.(*widget.Slider) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//on-change-ended?: arg 1: expected native of type *widget.Slider") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//on-change-ended?: arg 1: expected integer to be 0 or nil") - } - self = nil - default: - ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//on-change-ended?: arg 1: expected native") - } - var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnChangeEnded, "Go(func(float64))") - return resObj - }, - }, - "Go(*widget.Slider)//on-changed!": { - Doc: "Set *widget.Slider OnChanged value", - Argsn: 2, - Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var self *widget.Slider - switch v := arg0.(type) { - case env.Native: - var ok bool - self, ok = v.Value.(*widget.Slider) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//on-changed!: arg 1: expected native of type *widget.Slider") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//on-changed!: arg 1: expected integer to be 0 or nil") - } - self = nil - default: - ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//on-changed!: arg 1: expected native") - } - switch fn := arg1.(type) { - case env.Function: - if fn.Argsn != 1 { - ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//on-changed!: arg 2: function has invalid number of arguments (expected 1)") - } - self.OnChanged = func(arg0 float64) { - var arg0Val env.Object - arg0Val = *env.NewDecimal(float64(arg0)) - actualFn := fn - _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) - } - case env.Integer: - if fn.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//on-changed!: arg 2: expected integer to be 0 or nil") - } - self.OnChanged = nil - default: - ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//on-changed!: arg 2: expected function or nil") + return env.NewError("Go(*widget.Slider)//on-changed!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnChanged = newVal return arg0 }, }, @@ -97797,24 +98583,34 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//on-changed?: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//on-changed?: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//on-changed?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//on-changed?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//on-changed?: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//on-changed?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnChanged, "Go(func(float64))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val float64 + if vc, ok := arg0.(env.Decimal); ok { + arg0Val = float64(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Slider)//on-changed?: arg 1: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg0)) + } + self.OnChanged(arg0Val) + return nil + }, 1, false, false, "Returned func") return resObj }, }, @@ -97825,22 +98621,23 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//orientation!: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//orientation!: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//orientation!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//orientation!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//orientation!: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//orientation!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal widget.Orientation { nat, natOk := arg1.(env.Native) var natValOk bool @@ -97849,18 +98646,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(widget.Orientation) } if natValOk { - self.Orientation = natVal + newVal = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//orientation!: arg 2: expected integer") + return env.NewError("Go(*widget.Slider)//orientation!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } - self.Orientation = widget.Orientation(u) + newVal = widget.Orientation(u) } } + self.Orientation = newVal return arg0 }, }, @@ -97871,21 +98669,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//orientation?: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//orientation?: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//orientation?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//orientation?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//orientation?: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//orientation?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(int(self.Orientation))) @@ -97899,21 +98697,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//position: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//position: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//position: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -97928,21 +98726,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//refresh: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//refresh: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -97955,42 +98753,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//resize: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//resize: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//resize: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//resize: arg 2: expected native") + return env.NewError("Go(*widget.Slider)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -98001,28 +98793,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//set-value: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//set-value: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//set-value: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val float64 - if v, ok := arg1.(env.Decimal); ok { - arg1Val = float64(v.Value) + if vc, ok := arg1.(env.Decimal); ok { + arg1Val = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//set-value: arg 2: expected decimal") + return env.NewError("Go(*widget.Slider)//set-value: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetValue(arg1Val) return arg0 @@ -98035,21 +98827,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//show: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//show: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//show: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -98062,21 +98854,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//size: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//size: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//size: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -98091,28 +98883,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//step!: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//step!: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//step!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//step!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//step!: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//step!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Decimal); ok { - self.Step = float64(v.Value) + var newVal float64 + if vc, ok := arg1.(env.Decimal); ok { + newVal = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//step!: arg 2: expected decimal") + return env.NewError("Go(*widget.Slider)//step!: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } + self.Step = newVal return arg0 }, }, @@ -98123,21 +98917,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//step?: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//step?: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//step?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//step?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//step?: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//step?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewDecimal(float64(self.Step)) @@ -98151,40 +98945,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//tapped: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//tapped: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//tapped: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//tapped: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//tapped: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//tapped: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.PointEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.PointEvent) - if !ok { + if vc, ok := v.Value.(*fyne.PointEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//tapped: arg 2: expected native of type *fyne.PointEvent") + return env.NewError("Go(*widget.Slider)//tapped: arg 2: " + "expected native of type *fyne.PointEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//tapped: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//tapped: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//tapped: arg 2: expected native") + return env.NewError("Go(*widget.Slider)//tapped: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Tapped(arg1Val) return arg0 @@ -98197,40 +98991,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//typed-key: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//typed-key: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//typed-key: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//typed-key: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//typed-key: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//typed-key: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.KeyEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.KeyEvent) - if !ok { + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//typed-key: arg 2: expected native of type *fyne.KeyEvent") + return env.NewError("Go(*widget.Slider)//typed-key: arg 2: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//typed-key: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//typed-key: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//typed-key: arg 2: expected native") + return env.NewError("Go(*widget.Slider)//typed-key: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedKey(arg1Val) return arg0 @@ -98243,34 +99037,34 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//typed-rune: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//typed-rune: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//typed-rune: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//typed-rune: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//typed-rune: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//typed-rune: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val rune switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//typed-rune: arg 2: expected native of type rune") + return env.NewError("Go(*widget.Slider)//typed-rune: arg 2: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//typed-rune: arg 2: expected native") + return env.NewError("Go(*widget.Slider)//typed-rune: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedRune(arg1Val) return arg0 @@ -98283,21 +99077,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//unbind: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//unbind: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//unbind: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//unbind: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//unbind: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//unbind: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Unbind() return arg0 @@ -98310,28 +99104,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//value!: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//value!: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//value!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//value!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//value!: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//value!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Decimal); ok { - self.Value = float64(v.Value) + var newVal float64 + if vc, ok := arg1.(env.Decimal); ok { + newVal = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//value!: arg 2: expected decimal") + return env.NewError("Go(*widget.Slider)//value!: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } + self.Value = newVal return arg0 }, }, @@ -98342,21 +99138,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//value?: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//value?: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//value?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//value?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//value?: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//value?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewDecimal(float64(self.Value)) @@ -98370,21 +99166,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Slider switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Slider) - if !ok { + if vc, ok := v.Value.(*widget.Slider); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//visible: arg 1: expected native of type *widget.Slider") + return env.NewError("Go(*widget.Slider)//visible: arg 1: " + "expected native of type *widget.Slider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Slider)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Slider)//visible: arg 1: expected native") + return env.NewError("Go(*widget.Slider)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -98392,6 +99188,80 @@ var Builtins = map[string]*env.Builtin{ return res0Obj }, }, + "Go(*widget.Table)//base-widget!": { + Doc: "Set *widget.Table BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Table + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Table); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Table)//base-widget!: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Table)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Table)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Table)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Table)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Table)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*widget.Table)//base-widget?": { + Doc: "Get *widget.Table BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Table + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Table); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Table)//base-widget?: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Table)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Table)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj + }, + }, "Go(*widget.Table)//create-cell!": { Doc: "Set *widget.Table CreateCell value", Argsn: 2, @@ -98399,29 +99269,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//create-cell!: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//create-cell!: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//create-cell!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//create-cell!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//create-cell!: arg 1: expected native") + return env.NewError("Go(*widget.Table)//create-cell!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func() fyne.CanvasObject switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//create-cell!: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(*widget.Table)//create-cell!: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.CreateCell = func() fyne.CanvasObject { + newVal = func() fyne.CanvasObject { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, ps.Ctx) @@ -98431,19 +99302,21 @@ var Builtins = map[string]*env.Builtin{ var err error res, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.Table)//create-cell!: arg 2: callback result: "+err.Error()+"", + "Go(*widget.Table)//create-cell!: arg 2: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.Table)//create-cell!: arg 2: callback result: expected native of type fyne.CanvasObject", + "Go(*widget.Table)//create-cell!: arg 2: callback result: "+"expected native of type fyne.CanvasObject, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -98451,8 +99324,9 @@ var Builtins = map[string]*env.Builtin{ } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.Table)//create-cell!: arg 2: callback result: expected integer to be 0 or nil", + "Go(*widget.Table)//create-cell!: arg 2: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -98460,8 +99334,9 @@ var Builtins = map[string]*env.Builtin{ } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.Table)//create-cell!: arg 2: callback result: expected native", + "Go(*widget.Table)//create-cell!: arg 2: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -98472,13 +99347,14 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//create-cell!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//create-cell!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.CreateCell = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//create-cell!: arg 2: expected function or nil") + return env.NewError("Go(*widget.Table)//create-cell!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.CreateCell = newVal return arg0 }, }, @@ -98489,24 +99365,29 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//create-cell?: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//create-cell?: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//create-cell?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//create-cell?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//create-cell?: arg 1: expected native") + return env.NewError("Go(*widget.Table)//create-cell?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.CreateCell, "Go(func() (fyne.CanvasObject))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + res0 := self.CreateCell() + var res0Obj env.Object + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.CanvasObject)") + return res0Obj + }, 0, false, false, "Returned func") return resObj }, }, @@ -98517,29 +99398,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//create-header!: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//create-header!: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//create-header!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//create-header!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//create-header!: arg 1: expected native") + return env.NewError("Go(*widget.Table)//create-header!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func() fyne.CanvasObject switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//create-header!: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(*widget.Table)//create-header!: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.CreateHeader = func() fyne.CanvasObject { + newVal = func() fyne.CanvasObject { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, ps.Ctx) @@ -98549,19 +99431,21 @@ var Builtins = map[string]*env.Builtin{ var err error res, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.Table)//create-header!: arg 2: callback result: "+err.Error()+"", + "Go(*widget.Table)//create-header!: arg 2: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.Table)//create-header!: arg 2: callback result: expected native of type fyne.CanvasObject", + "Go(*widget.Table)//create-header!: arg 2: callback result: "+"expected native of type fyne.CanvasObject, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -98569,8 +99453,9 @@ var Builtins = map[string]*env.Builtin{ } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.Table)//create-header!: arg 2: callback result: expected integer to be 0 or nil", + "Go(*widget.Table)//create-header!: arg 2: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -98578,8 +99463,9 @@ var Builtins = map[string]*env.Builtin{ } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.Table)//create-header!: arg 2: callback result: expected native", + "Go(*widget.Table)//create-header!: arg 2: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -98590,13 +99476,14 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//create-header!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//create-header!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.CreateHeader = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//create-header!: arg 2: expected function or nil") + return env.NewError("Go(*widget.Table)//create-header!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.CreateHeader = newVal return arg0 }, }, @@ -98607,24 +99494,29 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//create-header?: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//create-header?: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//create-header?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//create-header?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//create-header?: arg 1: expected native") + return env.NewError("Go(*widget.Table)//create-header?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.CreateHeader, "Go(func() (fyne.CanvasObject))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + res0 := self.CreateHeader() + var res0Obj env.Object + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.CanvasObject)") + return res0Obj + }, 0, false, false, "Returned func") return resObj }, }, @@ -98635,42 +99527,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//create-renderer: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//create-renderer: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//create-renderer: arg 1: expected native") + return env.NewError("Go(*widget.Table)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -98681,42 +99556,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//cursor: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//cursor: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//cursor: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//cursor: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//cursor: arg 1: expected native") + return env.NewError("Go(*widget.Table)//cursor: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Cursor() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(desktop.Cursor)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(desktop.Cursor)") return res0Obj }, }, @@ -98727,21 +99585,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//drag-end: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//drag-end: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//drag-end: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//drag-end: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//drag-end: arg 1: expected native") + return env.NewError("Go(*widget.Table)//drag-end: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.DragEnd() return arg0 @@ -98754,40 +99612,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//dragged: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//dragged: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//dragged: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//dragged: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//dragged: arg 1: expected native") + return env.NewError("Go(*widget.Table)//dragged: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.DragEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.DragEvent) - if !ok { + if vc, ok := v.Value.(*fyne.DragEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//dragged: arg 2: expected native of type *fyne.DragEvent") + return env.NewError("Go(*widget.Table)//dragged: arg 2: " + "expected native of type *fyne.DragEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//dragged: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//dragged: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//dragged: arg 2: expected native") + return env.NewError("Go(*widget.Table)//dragged: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Dragged(arg1Val) return arg0 @@ -98800,21 +99658,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//extend-base-widget: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//extend-base-widget: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.Table)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -98823,24 +99681,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Table)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.Table)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.Table)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -98853,21 +99711,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//focus-gained: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//focus-gained: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//focus-gained: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//focus-gained: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//focus-gained: arg 1: expected native") + return env.NewError("Go(*widget.Table)//focus-gained: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusGained() return arg0 @@ -98880,21 +99738,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//focus-lost: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//focus-lost: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//focus-lost: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//focus-lost: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//focus-lost: arg 1: expected native") + return env.NewError("Go(*widget.Table)//focus-lost: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusLost() return arg0 @@ -98907,28 +99765,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//hidden!: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//hidden!: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.Table)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.Table)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -98939,21 +99799,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//hidden?: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//hidden?: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.Table)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -98967,21 +99827,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//hide: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//hide: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//hide: arg 1: expected native") + return env.NewError("Go(*widget.Table)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -98994,29 +99854,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//length!: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//length!: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//length!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//length!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//length!: arg 1: expected native") + return env.NewError("Go(*widget.Table)//length!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func() (int, int) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//length!: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(*widget.Table)//length!: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.Length = func() (int, int) { + newVal = func() (int, int) { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, ps.Ctx) @@ -99024,36 +99885,40 @@ var Builtins = map[string]*env.Builtin{ var res1 int res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.Table)//length!: arg 2: callback result: expected block for multiple return values", + "Go(*widget.Table)//length!: arg 2: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.Table)//length!: arg 2: callback result: expected block with 2 return values", + "Go(*widget.Table)//length!: arg 2: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = int(v.Value) + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.Table)//length!: arg 2: callback result: expected integer", + "Go(*widget.Table)//length!: arg 2: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[1].(env.Integer); ok { - res1 = int(v.Value) + if vc, ok := res.Series.S[1].(env.Integer); ok { + res1 = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.Table)//length!: arg 2: callback result: expected integer", + "Go(*widget.Table)//length!: arg 2: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[1]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -99064,13 +99929,14 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//length!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//length!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.Length = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//length!: arg 2: expected function or nil") + return env.NewError("Go(*widget.Table)//length!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.Length = newVal return arg0 }, }, @@ -99081,24 +99947,34 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//length?: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//length?: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//length?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//length?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//length?: arg 1: expected native") + return env.NewError("Go(*widget.Table)//length?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.Length, "Go(func() (int, int))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + res0, res1 := self.Length() + var res0Obj env.Object + res0Obj = *env.NewInteger(int64(res0)) + var res1Obj env.Object + res1Obj = *env.NewInteger(int64(res1)) + return *env.NewBlock(*env.NewTSeries([]env.Object{ + res0Obj, + res1Obj, + })) + }, 0, false, false, "Returned func") return resObj }, }, @@ -99109,21 +99985,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//min-size: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//min-size: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.Table)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -99138,40 +100014,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//mouse-down: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//mouse-down: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//mouse-down: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//mouse-down: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//mouse-down: arg 1: expected native") + return env.NewError("Go(*widget.Table)//mouse-down: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *desktop.MouseEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//mouse-down: arg 2: expected native of type *desktop.MouseEvent") + return env.NewError("Go(*widget.Table)//mouse-down: arg 2: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//mouse-down: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//mouse-down: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//mouse-down: arg 2: expected native") + return env.NewError("Go(*widget.Table)//mouse-down: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.MouseDown(arg1Val) return arg0 @@ -99184,40 +100060,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//mouse-in: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//mouse-in: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//mouse-in: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//mouse-in: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//mouse-in: arg 1: expected native") + return env.NewError("Go(*widget.Table)//mouse-in: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *desktop.MouseEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//mouse-in: arg 2: expected native of type *desktop.MouseEvent") + return env.NewError("Go(*widget.Table)//mouse-in: arg 2: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//mouse-in: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//mouse-in: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//mouse-in: arg 2: expected native") + return env.NewError("Go(*widget.Table)//mouse-in: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.MouseIn(arg1Val) return arg0 @@ -99230,40 +100106,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//mouse-moved: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//mouse-moved: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//mouse-moved: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//mouse-moved: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//mouse-moved: arg 1: expected native") + return env.NewError("Go(*widget.Table)//mouse-moved: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *desktop.MouseEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//mouse-moved: arg 2: expected native of type *desktop.MouseEvent") + return env.NewError("Go(*widget.Table)//mouse-moved: arg 2: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//mouse-moved: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//mouse-moved: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//mouse-moved: arg 2: expected native") + return env.NewError("Go(*widget.Table)//mouse-moved: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.MouseMoved(arg1Val) return arg0 @@ -99276,21 +100152,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//mouse-out: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//mouse-out: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//mouse-out: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//mouse-out: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//mouse-out: arg 1: expected native") + return env.NewError("Go(*widget.Table)//mouse-out: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.MouseOut() return arg0 @@ -99303,40 +100179,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//mouse-up: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//mouse-up: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//mouse-up: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//mouse-up: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//mouse-up: arg 1: expected native") + return env.NewError("Go(*widget.Table)//mouse-up: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *desktop.MouseEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//mouse-up: arg 2: expected native of type *desktop.MouseEvent") + return env.NewError("Go(*widget.Table)//mouse-up: arg 2: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//mouse-up: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//mouse-up: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//mouse-up: arg 2: expected native") + return env.NewError("Go(*widget.Table)//mouse-up: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.MouseUp(arg1Val) return arg0 @@ -99349,42 +100225,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//move: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//move: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//move: arg 1: expected native") + return env.NewError("Go(*widget.Table)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//move: arg 2: expected native") + return env.NewError("Go(*widget.Table)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -99395,45 +100265,47 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//on-selected!: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//on-selected!: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//on-selected!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//on-selected!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//on-selected!: arg 1: expected native") + return env.NewError("Go(*widget.Table)//on-selected!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(widget.TableCellID) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//on-selected!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*widget.Table)//on-selected!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnSelected = func(arg0 widget.TableCellID) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, &arg0, "Go(*widget.TableCellID)") + newVal = func(farg0 widget.TableCellID) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, &farg0, "Go(*widget.TableCellID)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//on-selected!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//on-selected!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnSelected = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//on-selected!: arg 2: expected function or nil") + return env.NewError("Go(*widget.Table)//on-selected!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnSelected = newVal return arg0 }, }, @@ -99444,24 +100316,40 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//on-selected?: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//on-selected?: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//on-selected?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//on-selected?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//on-selected?: arg 1: expected native") + return env.NewError("Go(*widget.Table)//on-selected?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnSelected, "Go(func(widget.TableCellID))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val widget.TableCellID + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.TableCellID); ok { + arg0Val = *vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Table)//on-selected?: arg 1: " + "expected native of type *widget.TableCellID, but got " + objectDebugString(ps.Idx, v)) + } + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Table)//on-selected?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.OnSelected(arg0Val) + return nil + }, 1, false, false, "Returned func") return resObj }, }, @@ -99472,45 +100360,47 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//on-unselected!: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//on-unselected!: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//on-unselected!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//on-unselected!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//on-unselected!: arg 1: expected native") + return env.NewError("Go(*widget.Table)//on-unselected!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(widget.TableCellID) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//on-unselected!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*widget.Table)//on-unselected!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnUnselected = func(arg0 widget.TableCellID) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, &arg0, "Go(*widget.TableCellID)") + newVal = func(farg0 widget.TableCellID) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, &farg0, "Go(*widget.TableCellID)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//on-unselected!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//on-unselected!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnUnselected = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//on-unselected!: arg 2: expected function or nil") + return env.NewError("Go(*widget.Table)//on-unselected!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnUnselected = newVal return arg0 }, }, @@ -99521,24 +100411,40 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//on-unselected?: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//on-unselected?: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//on-unselected?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//on-unselected?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//on-unselected?: arg 1: expected native") + return env.NewError("Go(*widget.Table)//on-unselected?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnUnselected, "Go(func(widget.TableCellID))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val widget.TableCellID + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.TableCellID); ok { + arg0Val = *vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Table)//on-unselected?: arg 1: " + "expected native of type *widget.TableCellID, but got " + objectDebugString(ps.Idx, v)) + } + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Table)//on-unselected?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.OnUnselected(arg0Val) + return nil + }, 1, false, false, "Returned func") return resObj }, }, @@ -99549,21 +100455,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//position: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//position: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//position: arg 1: expected native") + return env.NewError("Go(*widget.Table)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -99578,21 +100484,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//refresh: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//refresh: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.Table)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -99605,42 +100511,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//refresh-item: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//refresh-item: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//refresh-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//refresh-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//refresh-item: arg 1: expected native") + return env.NewError("Go(*widget.Table)//refresh-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *widget.TableCellID + var arg1Val widget.TableCellID switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*widget.TableCellID) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//refresh-item: arg 2: expected native of type *widget.TableCellID") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*widget.TableCellID); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//refresh-item: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//refresh-item: arg 2: " + "expected native of type *widget.TableCellID, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//refresh-item: arg 2: expected native") + return env.NewError("Go(*widget.Table)//refresh-item: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.RefreshItem(*arg1Val) + arg0Val.RefreshItem(arg1Val) return arg0 }, }, @@ -99651,42 +100551,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//resize: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//resize: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//resize: arg 1: expected native") + return env.NewError("Go(*widget.Table)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//resize: arg 2: expected native") + return env.NewError("Go(*widget.Table)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -99697,42 +100591,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//scroll-to: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//scroll-to: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//scroll-to: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//scroll-to: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//scroll-to: arg 1: expected native") + return env.NewError("Go(*widget.Table)//scroll-to: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *widget.TableCellID + var arg1Val widget.TableCellID switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*widget.TableCellID) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//scroll-to: arg 2: expected native of type *widget.TableCellID") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*widget.TableCellID); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//scroll-to: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//scroll-to: arg 2: " + "expected native of type *widget.TableCellID, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//scroll-to: arg 2: expected native") + return env.NewError("Go(*widget.Table)//scroll-to: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.ScrollTo(*arg1Val) + arg0Val.ScrollTo(arg1Val) return arg0 }, }, @@ -99743,21 +100631,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//scroll-to-bottom: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//scroll-to-bottom: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//scroll-to-bottom: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//scroll-to-bottom: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//scroll-to-bottom: arg 1: expected native") + return env.NewError("Go(*widget.Table)//scroll-to-bottom: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ScrollToBottom() return arg0 @@ -99770,21 +100658,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//scroll-to-leading: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//scroll-to-leading: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//scroll-to-leading: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//scroll-to-leading: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//scroll-to-leading: arg 1: expected native") + return env.NewError("Go(*widget.Table)//scroll-to-leading: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ScrollToLeading() return arg0 @@ -99797,21 +100685,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//scroll-to-top: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//scroll-to-top: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//scroll-to-top: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//scroll-to-top: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//scroll-to-top: arg 1: expected native") + return env.NewError("Go(*widget.Table)//scroll-to-top: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ScrollToTop() return arg0 @@ -99824,21 +100712,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//scroll-to-trailing: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//scroll-to-trailing: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//scroll-to-trailing: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//scroll-to-trailing: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//scroll-to-trailing: arg 1: expected native") + return env.NewError("Go(*widget.Table)//scroll-to-trailing: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ScrollToTrailing() return arg0 @@ -99851,42 +100739,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//select: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//select: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//select: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//select: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//select: arg 1: expected native") + return env.NewError("Go(*widget.Table)//select: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *widget.TableCellID + var arg1Val widget.TableCellID switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*widget.TableCellID) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//select: arg 2: expected native of type *widget.TableCellID") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*widget.TableCellID); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//select: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//select: arg 2: " + "expected native of type *widget.TableCellID, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//select: arg 2: expected native") + return env.NewError("Go(*widget.Table)//select: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Select(*arg1Val) + arg0Val.Select(arg1Val) return arg0 }, }, @@ -99897,35 +100779,35 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//set-column-width: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//set-column-width: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//set-column-width: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//set-column-width: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//set-column-width: arg 1: expected native") + return env.NewError("Go(*widget.Table)//set-column-width: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//set-column-width: arg 2: expected integer") + return env.NewError("Go(*widget.Table)//set-column-width: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val float32 - if v, ok := arg2.(env.Decimal); ok { - arg2Val = float32(v.Value) + if vc, ok := arg2.(env.Decimal); ok { + arg2Val = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//set-column-width: arg 3: expected decimal") + return env.NewError("Go(*widget.Table)//set-column-width: arg 3: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg2)) } arg0Val.SetColumnWidth(arg1Val, arg2Val) return arg0 @@ -99938,35 +100820,35 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//set-row-height: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//set-row-height: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//set-row-height: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//set-row-height: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//set-row-height: arg 1: expected native") + return env.NewError("Go(*widget.Table)//set-row-height: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//set-row-height: arg 2: expected integer") + return env.NewError("Go(*widget.Table)//set-row-height: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val float32 - if v, ok := arg2.(env.Decimal); ok { - arg2Val = float32(v.Value) + if vc, ok := arg2.(env.Decimal); ok { + arg2Val = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//set-row-height: arg 3: expected decimal") + return env.NewError("Go(*widget.Table)//set-row-height: arg 3: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg2)) } arg0Val.SetRowHeight(arg1Val, arg2Val) return arg0 @@ -99979,21 +100861,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//show: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//show: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//show: arg 1: expected native") + return env.NewError("Go(*widget.Table)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -100006,28 +100888,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//show-header-column!: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//show-header-column!: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//show-header-column!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//show-header-column!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//show-header-column!: arg 1: expected native") + return env.NewError("Go(*widget.Table)//show-header-column!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.ShowHeaderColumn = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//show-header-column!: arg 2: expected integer") + return env.NewError("Go(*widget.Table)//show-header-column!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.ShowHeaderColumn = newVal return arg0 }, }, @@ -100038,21 +100922,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//show-header-column?: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//show-header-column?: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//show-header-column?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//show-header-column?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//show-header-column?: arg 1: expected native") + return env.NewError("Go(*widget.Table)//show-header-column?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.ShowHeaderColumn)) @@ -100066,28 +100950,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//show-header-row!: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//show-header-row!: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//show-header-row!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//show-header-row!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//show-header-row!: arg 1: expected native") + return env.NewError("Go(*widget.Table)//show-header-row!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.ShowHeaderRow = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//show-header-row!: arg 2: expected integer") + return env.NewError("Go(*widget.Table)//show-header-row!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.ShowHeaderRow = newVal return arg0 }, }, @@ -100098,21 +100984,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//show-header-row?: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//show-header-row?: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//show-header-row?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//show-header-row?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//show-header-row?: arg 1: expected native") + return env.NewError("Go(*widget.Table)//show-header-row?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.ShowHeaderRow)) @@ -100126,21 +101012,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//size: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//size: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//size: arg 1: expected native") + return env.NewError("Go(*widget.Table)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -100155,28 +101041,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//sticky-column-count!: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//sticky-column-count!: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//sticky-column-count!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//sticky-column-count!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//sticky-column-count!: arg 1: expected native") + return env.NewError("Go(*widget.Table)//sticky-column-count!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.StickyColumnCount = int(v.Value) + var newVal int + if vc, ok := arg1.(env.Integer); ok { + newVal = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//sticky-column-count!: arg 2: expected integer") + return env.NewError("Go(*widget.Table)//sticky-column-count!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.StickyColumnCount = newVal return arg0 }, }, @@ -100187,21 +101075,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//sticky-column-count?: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//sticky-column-count?: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//sticky-column-count?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//sticky-column-count?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//sticky-column-count?: arg 1: expected native") + return env.NewError("Go(*widget.Table)//sticky-column-count?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(self.StickyColumnCount)) @@ -100215,28 +101103,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//sticky-row-count!: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//sticky-row-count!: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//sticky-row-count!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//sticky-row-count!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//sticky-row-count!: arg 1: expected native") + return env.NewError("Go(*widget.Table)//sticky-row-count!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.StickyRowCount = int(v.Value) + var newVal int + if vc, ok := arg1.(env.Integer); ok { + newVal = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//sticky-row-count!: arg 2: expected integer") + return env.NewError("Go(*widget.Table)//sticky-row-count!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.StickyRowCount = newVal return arg0 }, }, @@ -100247,21 +101137,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//sticky-row-count?: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//sticky-row-count?: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//sticky-row-count?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//sticky-row-count?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//sticky-row-count?: arg 1: expected native") + return env.NewError("Go(*widget.Table)//sticky-row-count?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(self.StickyRowCount)) @@ -100275,40 +101165,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//tapped: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//tapped: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//tapped: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//tapped: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//tapped: arg 1: expected native") + return env.NewError("Go(*widget.Table)//tapped: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.PointEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.PointEvent) - if !ok { + if vc, ok := v.Value.(*fyne.PointEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//tapped: arg 2: expected native of type *fyne.PointEvent") + return env.NewError("Go(*widget.Table)//tapped: arg 2: " + "expected native of type *fyne.PointEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//tapped: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//tapped: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//tapped: arg 2: expected native") + return env.NewError("Go(*widget.Table)//tapped: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Tapped(arg1Val) return arg0 @@ -100321,40 +101211,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//touch-cancel: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//touch-cancel: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//touch-cancel: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//touch-cancel: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//touch-cancel: arg 1: expected native") + return env.NewError("Go(*widget.Table)//touch-cancel: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *mobile.TouchEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*mobile.TouchEvent) - if !ok { + if vc, ok := v.Value.(*mobile.TouchEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//touch-cancel: arg 2: expected native of type *mobile.TouchEvent") + return env.NewError("Go(*widget.Table)//touch-cancel: arg 2: " + "expected native of type *mobile.TouchEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//touch-cancel: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//touch-cancel: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//touch-cancel: arg 2: expected native") + return env.NewError("Go(*widget.Table)//touch-cancel: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TouchCancel(arg1Val) return arg0 @@ -100367,40 +101257,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//touch-down: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//touch-down: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//touch-down: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//touch-down: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//touch-down: arg 1: expected native") + return env.NewError("Go(*widget.Table)//touch-down: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *mobile.TouchEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*mobile.TouchEvent) - if !ok { + if vc, ok := v.Value.(*mobile.TouchEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//touch-down: arg 2: expected native of type *mobile.TouchEvent") + return env.NewError("Go(*widget.Table)//touch-down: arg 2: " + "expected native of type *mobile.TouchEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//touch-down: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//touch-down: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//touch-down: arg 2: expected native") + return env.NewError("Go(*widget.Table)//touch-down: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TouchDown(arg1Val) return arg0 @@ -100413,40 +101303,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//touch-up: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//touch-up: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//touch-up: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//touch-up: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//touch-up: arg 1: expected native") + return env.NewError("Go(*widget.Table)//touch-up: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *mobile.TouchEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*mobile.TouchEvent) - if !ok { + if vc, ok := v.Value.(*mobile.TouchEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//touch-up: arg 2: expected native of type *mobile.TouchEvent") + return env.NewError("Go(*widget.Table)//touch-up: arg 2: " + "expected native of type *mobile.TouchEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//touch-up: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//touch-up: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//touch-up: arg 2: expected native") + return env.NewError("Go(*widget.Table)//touch-up: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TouchUp(arg1Val) return arg0 @@ -100459,40 +101349,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//typed-key: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//typed-key: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//typed-key: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//typed-key: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//typed-key: arg 1: expected native") + return env.NewError("Go(*widget.Table)//typed-key: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.KeyEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.KeyEvent) - if !ok { + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//typed-key: arg 2: expected native of type *fyne.KeyEvent") + return env.NewError("Go(*widget.Table)//typed-key: arg 2: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//typed-key: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//typed-key: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//typed-key: arg 2: expected native") + return env.NewError("Go(*widget.Table)//typed-key: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedKey(arg1Val) return arg0 @@ -100505,34 +101395,34 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//typed-rune: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//typed-rune: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//typed-rune: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//typed-rune: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//typed-rune: arg 1: expected native") + return env.NewError("Go(*widget.Table)//typed-rune: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val rune switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//typed-rune: arg 2: expected native of type rune") + return env.NewError("Go(*widget.Table)//typed-rune: arg 2: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//typed-rune: arg 2: expected native") + return env.NewError("Go(*widget.Table)//typed-rune: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedRune(arg1Val) return arg0 @@ -100545,42 +101435,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//unselect: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//unselect: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//unselect: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//unselect: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//unselect: arg 1: expected native") + return env.NewError("Go(*widget.Table)//unselect: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *widget.TableCellID + var arg1Val widget.TableCellID switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*widget.TableCellID) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//unselect: arg 2: expected native of type *widget.TableCellID") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*widget.TableCellID); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//unselect: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//unselect: arg 2: " + "expected native of type *widget.TableCellID, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//unselect: arg 2: expected native") + return env.NewError("Go(*widget.Table)//unselect: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Unselect(*arg1Val) + arg0Val.Unselect(arg1Val) return arg0 }, }, @@ -100591,21 +101475,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//unselect-all: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//unselect-all: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//unselect-all: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//unselect-all: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//unselect-all: arg 1: expected native") + return env.NewError("Go(*widget.Table)//unselect-all: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.UnselectAll() return arg0 @@ -100618,63 +101502,48 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//update-cell!: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//update-cell!: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//update-cell!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//update-cell!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//update-cell!: arg 1: expected native") + return env.NewError("Go(*widget.Table)//update-cell!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(widget.TableCellID, fyne.CanvasObject) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 2 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//update-cell!: arg 2: function has invalid number of arguments (expected 2)") + return env.NewError("Go(*widget.Table)//update-cell!: arg 2: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.UpdateCell = func(arg0 widget.TableCellID, arg1 fyne.CanvasObject) { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewNative(ps.Idx, &arg0, "Go(*widget.TableCellID)") - { - typ := reflect.TypeOf(arg1) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg1Val = *env.NewNative(ps.Idx, arg1, typRyeName) - } else { - arg1Val = *env.NewNative(ps.Idx, arg1, "Go(fyne.CanvasObject)") - } - } + newVal = func(farg0 widget.TableCellID, farg1 fyne.CanvasObject) { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewNative(ps.Idx, &farg0, "Go(*widget.TableCellID)") + farg1Val = ifaceToNative(ps.Idx, farg1, "Go(fyne.CanvasObject)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val, farg1Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//update-cell!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//update-cell!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.UpdateCell = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//update-cell!: arg 2: expected function or nil") + return env.NewError("Go(*widget.Table)//update-cell!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.UpdateCell = newVal return arg0 }, }, @@ -100685,24 +101554,66 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//update-cell?: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//update-cell?: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//update-cell?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//update-cell?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//update-cell?: arg 1: expected native") + return env.NewError("Go(*widget.Table)//update-cell?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.UpdateCell, "Go(func(widget.TableCellID, fyne.CanvasObject))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val widget.TableCellID + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.TableCellID); ok { + arg0Val = *vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Table)//update-cell?: arg 1: " + "expected native of type *widget.TableCellID, but got " + objectDebugString(ps.Idx, v)) + } + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Table)//update-cell?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var arg1Val fyne.CanvasObject + switch v := arg1.(type) { + case env.RyeCtx: + var err error + arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) + if err != nil { + ps.FailureFlag = true + return env.NewError("Go(*widget.Table)//update-cell?: arg 2: " + err.Error()) + } + case env.Native: + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Table)//update-cell?: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Table)//update-cell?: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg1Val = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Table)//update-cell?: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.UpdateCell(arg0Val, arg1Val) + return nil + }, 2, false, false, "Returned func") return resObj }, }, @@ -100713,63 +101624,48 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//update-header!: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//update-header!: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//update-header!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//update-header!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//update-header!: arg 1: expected native") + return env.NewError("Go(*widget.Table)//update-header!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(widget.TableCellID, fyne.CanvasObject) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 2 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//update-header!: arg 2: function has invalid number of arguments (expected 2)") + return env.NewError("Go(*widget.Table)//update-header!: arg 2: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.UpdateHeader = func(arg0 widget.TableCellID, arg1 fyne.CanvasObject) { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewNative(ps.Idx, &arg0, "Go(*widget.TableCellID)") - { - typ := reflect.TypeOf(arg1) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg1Val = *env.NewNative(ps.Idx, arg1, typRyeName) - } else { - arg1Val = *env.NewNative(ps.Idx, arg1, "Go(fyne.CanvasObject)") - } - } + newVal = func(farg0 widget.TableCellID, farg1 fyne.CanvasObject) { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewNative(ps.Idx, &farg0, "Go(*widget.TableCellID)") + farg1Val = ifaceToNative(ps.Idx, farg1, "Go(fyne.CanvasObject)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val, farg1Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//update-header!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//update-header!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.UpdateHeader = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//update-header!: arg 2: expected function or nil") + return env.NewError("Go(*widget.Table)//update-header!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.UpdateHeader = newVal return arg0 }, }, @@ -100780,24 +101676,66 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//update-header?: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//update-header?: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//update-header?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//update-header?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//update-header?: arg 1: expected native") + return env.NewError("Go(*widget.Table)//update-header?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.UpdateHeader, "Go(func(widget.TableCellID, fyne.CanvasObject))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val widget.TableCellID + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.TableCellID); ok { + arg0Val = *vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Table)//update-header?: arg 1: " + "expected native of type *widget.TableCellID, but got " + objectDebugString(ps.Idx, v)) + } + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Table)//update-header?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var arg1Val fyne.CanvasObject + switch v := arg1.(type) { + case env.RyeCtx: + var err error + arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) + if err != nil { + ps.FailureFlag = true + return env.NewError("Go(*widget.Table)//update-header?: arg 2: " + err.Error()) + } + case env.Native: + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Table)//update-header?: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Table)//update-header?: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg1Val = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Table)//update-header?: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.UpdateHeader(arg0Val, arg1Val) + return nil + }, 2, false, false, "Returned func") return resObj }, }, @@ -100808,21 +101746,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Table switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Table) - if !ok { + if vc, ok := v.Value.(*widget.Table); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//visible: arg 1: expected native of type *widget.Table") + return env.NewError("Go(*widget.Table)//visible: arg 1: " + "expected native of type *widget.Table, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Table)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Table)//visible: arg 1: expected native") + return env.NewError("Go(*widget.Table)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -100837,28 +101775,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.TableCellID switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.TableCellID) - if !ok { + if vc, ok := v.Value.(*widget.TableCellID); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TableCellID)//col!: arg 1: expected native of type *widget.TableCellID") + return env.NewError("Go(*widget.TableCellID)//col!: arg 1: " + "expected native of type *widget.TableCellID, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TableCellID)//col!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TableCellID)//col!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TableCellID)//col!: arg 1: expected native") + return env.NewError("Go(*widget.TableCellID)//col!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Col = int(v.Value) + var newVal int + if vc, ok := arg1.(env.Integer); ok { + newVal = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TableCellID)//col!: arg 2: expected integer") + return env.NewError("Go(*widget.TableCellID)//col!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Col = newVal return arg0 }, }, @@ -100869,21 +101809,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.TableCellID switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.TableCellID) - if !ok { + if vc, ok := v.Value.(*widget.TableCellID); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TableCellID)//col?: arg 1: expected native of type *widget.TableCellID") + return env.NewError("Go(*widget.TableCellID)//col?: arg 1: " + "expected native of type *widget.TableCellID, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TableCellID)//col?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TableCellID)//col?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TableCellID)//col?: arg 1: expected native") + return env.NewError("Go(*widget.TableCellID)//col?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(self.Col)) @@ -100897,28 +101837,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.TableCellID switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.TableCellID) - if !ok { + if vc, ok := v.Value.(*widget.TableCellID); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TableCellID)//row!: arg 1: expected native of type *widget.TableCellID") + return env.NewError("Go(*widget.TableCellID)//row!: arg 1: " + "expected native of type *widget.TableCellID, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TableCellID)//row!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TableCellID)//row!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TableCellID)//row!: arg 1: expected native") + return env.NewError("Go(*widget.TableCellID)//row!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Row = int(v.Value) + var newVal int + if vc, ok := arg1.(env.Integer); ok { + newVal = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TableCellID)//row!: arg 2: expected integer") + return env.NewError("Go(*widget.TableCellID)//row!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Row = newVal return arg0 }, }, @@ -100929,27 +101871,101 @@ var Builtins = map[string]*env.Builtin{ var self *widget.TableCellID switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.TableCellID) - if !ok { + if vc, ok := v.Value.(*widget.TableCellID); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TableCellID)//row?: arg 1: expected native of type *widget.TableCellID") + return env.NewError("Go(*widget.TableCellID)//row?: arg 1: " + "expected native of type *widget.TableCellID, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TableCellID)//row?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TableCellID)//row?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TableCellID)//row?: arg 1: expected native") + return env.NewError("Go(*widget.TableCellID)//row?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(self.Row)) return resObj }, }, + "Go(*widget.TextGrid)//base-widget!": { + Doc: "Set *widget.TextGrid BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.TextGrid + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.TextGrid); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.TextGrid)//base-widget!: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.TextGrid)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.TextGrid)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.TextGrid)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.TextGrid)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.TextGrid)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*widget.TextGrid)//base-widget?": { + Doc: "Get *widget.TextGrid BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.TextGrid + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.TextGrid); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.TextGrid)//base-widget?: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.TextGrid)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.TextGrid)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj + }, + }, "Go(*widget.TextGrid)//create-renderer": { Doc: "(*widget.TextGrid).CreateRenderer", Argsn: 1, @@ -100957,42 +101973,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//create-renderer: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//create-renderer: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//create-renderer: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -101003,21 +102002,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//extend-base-widget: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//extend-base-widget: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -101026,24 +102025,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.TextGrid)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.TextGrid)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.TextGrid)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -101056,28 +102055,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//hidden!: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//hidden!: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.TextGrid)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -101088,21 +102089,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//hidden?: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//hidden?: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -101116,21 +102117,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//hide: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//hide: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//hide: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -101143,21 +102144,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//min-size: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//min-size: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -101172,42 +102173,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//move: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//move: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//move: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//move: arg 2: expected native") + return env.NewError("Go(*widget.TextGrid)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -101218,21 +102213,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//position: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//position: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//position: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -101247,21 +102242,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//refresh: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//refresh: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -101274,42 +102269,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//resize: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//resize: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//resize: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//resize: arg 2: expected native") + return env.NewError("Go(*widget.TextGrid)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -101320,28 +102309,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//row: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//row: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//row: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//row: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//row: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//row: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//row: arg 2: expected integer") + return env.NewError("Go(*widget.TextGrid)//row: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0 := arg0Val.Row(arg1Val) var res0Obj env.Object @@ -101356,28 +102345,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//row-text: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//row-text: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//row-text: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//row-text: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//row-text: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//row-text: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//row-text: arg 2: expected integer") + return env.NewError("Go(*widget.TextGrid)//row-text: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0 := arg0Val.RowText(arg1Val) var res0Obj env.Object @@ -101392,56 +102381,51 @@ var Builtins = map[string]*env.Builtin{ var self *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//rows!: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//rows!: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//rows!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//rows!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//rows!: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//rows!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal []widget.TextGridRow switch v := arg1.(type) { case env.Block: - self.Rows = make([]widget.TextGridRow, len(v.Series.S)) + newVal = make([]widget.TextGridRow, len(v.Series.S)) for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - self.Rows[i], ok = v.Value.(widget.TextGridRow) - if !ok { + if vc, ok := v.Value.(*widget.TextGridRow); ok { + newVal[i] = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//rows!: arg 2: block item: expected native of type widget.TextGridRow") + return env.NewError("Go(*widget.TextGrid)//rows!: arg 2: " + "block item: " + "expected native of type *widget.TextGridRow, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//rows!: arg 2: block item: expected native") + return env.NewError("Go(*widget.TextGrid)//rows!: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - self.Rows, ok = v.Value.([]widget.TextGridRow) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//rows!: arg 2: expected native of type []widget.TextGridRow") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//rows!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//rows!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Rows = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//rows!: arg 2: expected block, native or nil") + return env.NewError("Go(*widget.TextGrid)//rows!: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } + self.Rows = newVal return arg0 }, }, @@ -101452,27 +102436,27 @@ var Builtins = map[string]*env.Builtin{ var self *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//rows?: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//rows?: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//rows?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//rows?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//rows?: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//rows?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object { items := make([]env.Object, len(self.Rows)) for i, it := range self.Rows { - items[i] = *env.NewNative(ps.Idx, it, "Go(widget.TextGridRow)") + items[i] = *env.NewNative(ps.Idx, &it, "Go(*widget.TextGridRow)") } resObj = *env.NewBlock(*env.NewTSeries(items)) } @@ -101486,56 +102470,50 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-cell: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//set-cell: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-cell: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//set-cell: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-cell: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//set-cell: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-cell: arg 2: expected integer") + return env.NewError("Go(*widget.TextGrid)//set-cell: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val int - if v, ok := arg2.(env.Integer); ok { - arg2Val = int(v.Value) + if vc, ok := arg2.(env.Integer); ok { + arg2Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-cell: arg 3: expected integer") + return env.NewError("Go(*widget.TextGrid)//set-cell: arg 3: " + "expected integer, but got " + objectDebugString(ps.Idx, arg2)) } - var arg3Val *widget.TextGridCell + var arg3Val widget.TextGridCell switch v := arg3.(type) { case env.Native: - var ok bool - arg3Val, ok = v.Value.(*widget.TextGridCell) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-cell: arg 4: expected native of type *widget.TextGridCell") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*widget.TextGridCell); ok { + arg3Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-cell: arg 4: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//set-cell: arg 4: " + "expected native of type *widget.TextGridCell, but got " + objectDebugString(ps.Idx, v)) } - arg3Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-cell: arg 4: expected native") + return env.NewError("Go(*widget.TextGrid)//set-cell: arg 4: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.SetCell(arg1Val, arg2Val, *arg3Val) + arg0Val.SetCell(arg1Val, arg2Val, arg3Val) return arg0 }, }, @@ -101546,49 +102524,43 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-row: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//set-row: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-row: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//set-row: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-row: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//set-row: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-row: arg 2: expected integer") + return env.NewError("Go(*widget.TextGrid)//set-row: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } - var arg2Val *widget.TextGridRow + var arg2Val widget.TextGridRow switch v := arg2.(type) { case env.Native: - var ok bool - arg2Val, ok = v.Value.(*widget.TextGridRow) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-row: arg 3: expected native of type *widget.TextGridRow") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*widget.TextGridRow); ok { + arg2Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-row: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//set-row: arg 3: " + "expected native of type *widget.TextGridRow, but got " + objectDebugString(ps.Idx, v)) } - arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-row: arg 3: expected native") + return env.NewError("Go(*widget.TextGrid)//set-row: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.SetRow(arg1Val, *arg2Val) + arg0Val.SetRow(arg1Val, arg2Val) return arg0 }, }, @@ -101599,28 +102571,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-row-style: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//set-row-style: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-row-style: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//set-row-style: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-row-style: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//set-row-style: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-row-style: arg 2: expected integer") + return env.NewError("Go(*widget.TextGrid)//set-row-style: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val widget.TextGridStyle switch v := arg2.(type) { @@ -101629,24 +102601,24 @@ var Builtins = map[string]*env.Builtin{ arg2Val, err = ctxTo_widget_TextGridStyle(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-row-style: arg 3: " + err.Error() + "") + return env.NewError("Go(*widget.TextGrid)//set-row-style: arg 3: " + err.Error()) } case env.Native: - var ok bool - arg2Val, ok = v.Value.(widget.TextGridStyle) - if !ok { + if vc, ok := v.Value.(widget.TextGridStyle); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-row-style: arg 3: expected native of type widget.TextGridStyle") + return env.NewError("Go(*widget.TextGrid)//set-row-style: arg 3: " + "expected native of type widget.TextGridStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-row-style: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//set-row-style: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-row-style: arg 3: expected native") + return env.NewError("Go(*widget.TextGrid)//set-row-style: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetRowStyle(arg1Val, arg2Val) return arg0 @@ -101659,48 +102631,48 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-rune: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//set-rune: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-rune: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//set-rune: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-rune: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//set-rune: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-rune: arg 2: expected integer") + return env.NewError("Go(*widget.TextGrid)//set-rune: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val int - if v, ok := arg2.(env.Integer); ok { - arg2Val = int(v.Value) + if vc, ok := arg2.(env.Integer); ok { + arg2Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-rune: arg 3: expected integer") + return env.NewError("Go(*widget.TextGrid)//set-rune: arg 3: " + "expected integer, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val rune switch v := arg3.(type) { case env.Native: - var ok bool - arg3Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg3Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-rune: arg 4: expected native of type rune") + return env.NewError("Go(*widget.TextGrid)//set-rune: arg 4: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-rune: arg 4: expected native") + return env.NewError("Go(*widget.TextGrid)//set-rune: arg 4: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetRune(arg1Val, arg2Val, arg3Val) return arg0 @@ -101713,35 +102685,35 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-style: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//set-style: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-style: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//set-style: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-style: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//set-style: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-style: arg 2: expected integer") + return env.NewError("Go(*widget.TextGrid)//set-style: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val int - if v, ok := arg2.(env.Integer); ok { - arg2Val = int(v.Value) + if vc, ok := arg2.(env.Integer); ok { + arg2Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-style: arg 3: expected integer") + return env.NewError("Go(*widget.TextGrid)//set-style: arg 3: " + "expected integer, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val widget.TextGridStyle switch v := arg3.(type) { @@ -101750,24 +102722,24 @@ var Builtins = map[string]*env.Builtin{ arg3Val, err = ctxTo_widget_TextGridStyle(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-style: arg 4: " + err.Error() + "") + return env.NewError("Go(*widget.TextGrid)//set-style: arg 4: " + err.Error()) } case env.Native: - var ok bool - arg3Val, ok = v.Value.(widget.TextGridStyle) - if !ok { + if vc, ok := v.Value.(widget.TextGridStyle); ok { + arg3Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-style: arg 4: expected native of type widget.TextGridStyle") + return env.NewError("Go(*widget.TextGrid)//set-style: arg 4: " + "expected native of type widget.TextGridStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-style: arg 4: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//set-style: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-style: arg 4: expected native") + return env.NewError("Go(*widget.TextGrid)//set-style: arg 4: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetStyle(arg1Val, arg2Val, arg3Val) return arg0 @@ -101780,28 +102752,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-text: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//set-text: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-text: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//set-text: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-text: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//set-text: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//set-text: arg 2: expected string") + return env.NewError("Go(*widget.TextGrid)//set-text: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetText(arg1Val) return arg0 @@ -101814,21 +102786,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//show: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//show: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//show: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -101841,28 +102813,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//show-line-numbers!: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//show-line-numbers!: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//show-line-numbers!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//show-line-numbers!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//show-line-numbers!: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//show-line-numbers!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.ShowLineNumbers = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//show-line-numbers!: arg 2: expected integer") + return env.NewError("Go(*widget.TextGrid)//show-line-numbers!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.ShowLineNumbers = newVal return arg0 }, }, @@ -101873,21 +102847,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//show-line-numbers?: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//show-line-numbers?: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//show-line-numbers?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//show-line-numbers?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//show-line-numbers?: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//show-line-numbers?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.ShowLineNumbers)) @@ -101901,28 +102875,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//show-whitespace!: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//show-whitespace!: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//show-whitespace!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//show-whitespace!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//show-whitespace!: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//show-whitespace!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.ShowWhitespace = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//show-whitespace!: arg 2: expected integer") + return env.NewError("Go(*widget.TextGrid)//show-whitespace!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.ShowWhitespace = newVal return arg0 }, }, @@ -101933,21 +102909,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//show-whitespace?: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//show-whitespace?: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//show-whitespace?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//show-whitespace?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//show-whitespace?: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//show-whitespace?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.ShowWhitespace)) @@ -101961,21 +102937,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//size: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//size: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//size: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -101990,28 +102966,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//tab-width!: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//tab-width!: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//tab-width!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//tab-width!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//tab-width!: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//tab-width!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.TabWidth = int(v.Value) + var newVal int + if vc, ok := arg1.(env.Integer); ok { + newVal = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//tab-width!: arg 2: expected integer") + return env.NewError("Go(*widget.TextGrid)//tab-width!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.TabWidth = newVal return arg0 }, }, @@ -102022,21 +103000,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//tab-width?: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//tab-width?: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//tab-width?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//tab-width?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//tab-width?: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//tab-width?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(int64(self.TabWidth)) @@ -102050,21 +103028,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//text: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//text: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//text: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//text: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//text: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//text: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Text() var res0Obj env.Object @@ -102079,21 +103057,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.TextGrid switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.TextGrid) - if !ok { + if vc, ok := v.Value.(*widget.TextGrid); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//visible: arg 1: expected native of type *widget.TextGrid") + return env.NewError("Go(*widget.TextGrid)//visible: arg 1: " + "expected native of type *widget.TextGrid, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGrid)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGrid)//visible: arg 1: expected native") + return env.NewError("Go(*widget.TextGrid)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -102108,34 +103086,36 @@ var Builtins = map[string]*env.Builtin{ var self *widget.TextGridCell switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.TextGridCell) - if !ok { + if vc, ok := v.Value.(*widget.TextGridCell); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridCell)//rune!: arg 1: expected native of type *widget.TextGridCell") + return env.NewError("Go(*widget.TextGridCell)//rune!: arg 1: " + "expected native of type *widget.TextGridCell, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridCell)//rune!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGridCell)//rune!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridCell)//rune!: arg 1: expected native") + return env.NewError("Go(*widget.TextGridCell)//rune!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal rune switch v := arg1.(type) { case env.Native: - var ok bool - self.Rune, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridCell)//rune!: arg 2: expected native of type rune") + return env.NewError("Go(*widget.TextGridCell)//rune!: arg 2: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridCell)//rune!: arg 2: expected native") + return env.NewError("Go(*widget.TextGridCell)//rune!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Rune = newVal return arg0 }, }, @@ -102146,21 +103126,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.TextGridCell switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.TextGridCell) - if !ok { + if vc, ok := v.Value.(*widget.TextGridCell); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridCell)//rune?: arg 1: expected native of type *widget.TextGridCell") + return env.NewError("Go(*widget.TextGridCell)//rune?: arg 1: " + "expected native of type *widget.TextGridCell, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridCell)//rune?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGridCell)//rune?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridCell)//rune?: arg 1: expected native") + return env.NewError("Go(*widget.TextGridCell)//rune?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, self.Rune, "Go(rune)") @@ -102174,47 +103154,49 @@ var Builtins = map[string]*env.Builtin{ var self *widget.TextGridCell switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.TextGridCell) - if !ok { + if vc, ok := v.Value.(*widget.TextGridCell); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridCell)//style!: arg 1: expected native of type *widget.TextGridCell") + return env.NewError("Go(*widget.TextGridCell)//style!: arg 1: " + "expected native of type *widget.TextGridCell, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridCell)//style!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGridCell)//style!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridCell)//style!: arg 1: expected native") + return env.NewError("Go(*widget.TextGridCell)//style!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal widget.TextGridStyle switch v := arg1.(type) { case env.RyeCtx: var err error - self.Style, err = ctxTo_widget_TextGridStyle(ps, v) + newVal, err = ctxTo_widget_TextGridStyle(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridCell)//style!: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.TextGridCell)//style!: arg 2: " + err.Error()) } case env.Native: - var ok bool - self.Style, ok = v.Value.(widget.TextGridStyle) - if !ok { + if vc, ok := v.Value.(widget.TextGridStyle); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridCell)//style!: arg 2: expected native of type widget.TextGridStyle") + return env.NewError("Go(*widget.TextGridCell)//style!: arg 2: " + "expected native of type widget.TextGridStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridCell)//style!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGridCell)//style!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Style = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridCell)//style!: arg 2: expected native") + return env.NewError("Go(*widget.TextGridCell)//style!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Style = newVal return arg0 }, }, @@ -102225,41 +103207,24 @@ var Builtins = map[string]*env.Builtin{ var self *widget.TextGridCell switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.TextGridCell) - if !ok { + if vc, ok := v.Value.(*widget.TextGridCell); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridCell)//style?: arg 1: expected native of type *widget.TextGridCell") + return env.NewError("Go(*widget.TextGridCell)//style?: arg 1: " + "expected native of type *widget.TextGridCell, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridCell)//style?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGridCell)//style?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridCell)//style?: arg 1: expected native") + return env.NewError("Go(*widget.TextGridCell)//style?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - { - typ := reflect.TypeOf(self.Style) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - resObj = *env.NewNative(ps.Idx, self.Style, typRyeName) - } else { - resObj = *env.NewNative(ps.Idx, self.Style, "Go(widget.TextGridStyle)") - } - } + resObj = ifaceToNative(ps.Idx, self.Style, "Go(widget.TextGridStyle)") return resObj }, }, @@ -102270,56 +103235,51 @@ var Builtins = map[string]*env.Builtin{ var self *widget.TextGridRow switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.TextGridRow) - if !ok { + if vc, ok := v.Value.(*widget.TextGridRow); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridRow)//cells!: arg 1: expected native of type *widget.TextGridRow") + return env.NewError("Go(*widget.TextGridRow)//cells!: arg 1: " + "expected native of type *widget.TextGridRow, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridRow)//cells!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGridRow)//cells!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridRow)//cells!: arg 1: expected native") + return env.NewError("Go(*widget.TextGridRow)//cells!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal []widget.TextGridCell switch v := arg1.(type) { case env.Block: - self.Cells = make([]widget.TextGridCell, len(v.Series.S)) + newVal = make([]widget.TextGridCell, len(v.Series.S)) for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - self.Cells[i], ok = v.Value.(widget.TextGridCell) - if !ok { + if vc, ok := v.Value.(*widget.TextGridCell); ok { + newVal[i] = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridRow)//cells!: arg 2: block item: expected native of type widget.TextGridCell") + return env.NewError("Go(*widget.TextGridRow)//cells!: arg 2: " + "block item: " + "expected native of type *widget.TextGridCell, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridRow)//cells!: arg 2: block item: expected native") + return env.NewError("Go(*widget.TextGridRow)//cells!: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - self.Cells, ok = v.Value.([]widget.TextGridCell) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridRow)//cells!: arg 2: expected native of type []widget.TextGridCell") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridRow)//cells!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGridRow)//cells!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Cells = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridRow)//cells!: arg 2: expected block, native or nil") + return env.NewError("Go(*widget.TextGridRow)//cells!: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } + self.Cells = newVal return arg0 }, }, @@ -102330,27 +103290,27 @@ var Builtins = map[string]*env.Builtin{ var self *widget.TextGridRow switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.TextGridRow) - if !ok { + if vc, ok := v.Value.(*widget.TextGridRow); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridRow)//cells?: arg 1: expected native of type *widget.TextGridRow") + return env.NewError("Go(*widget.TextGridRow)//cells?: arg 1: " + "expected native of type *widget.TextGridRow, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridRow)//cells?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGridRow)//cells?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridRow)//cells?: arg 1: expected native") + return env.NewError("Go(*widget.TextGridRow)//cells?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object { items := make([]env.Object, len(self.Cells)) for i, it := range self.Cells { - items[i] = *env.NewNative(ps.Idx, it, "Go(widget.TextGridCell)") + items[i] = *env.NewNative(ps.Idx, &it, "Go(*widget.TextGridCell)") } resObj = *env.NewBlock(*env.NewTSeries(items)) } @@ -102364,47 +103324,49 @@ var Builtins = map[string]*env.Builtin{ var self *widget.TextGridRow switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.TextGridRow) - if !ok { + if vc, ok := v.Value.(*widget.TextGridRow); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridRow)//style!: arg 1: expected native of type *widget.TextGridRow") + return env.NewError("Go(*widget.TextGridRow)//style!: arg 1: " + "expected native of type *widget.TextGridRow, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridRow)//style!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGridRow)//style!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridRow)//style!: arg 1: expected native") + return env.NewError("Go(*widget.TextGridRow)//style!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal widget.TextGridStyle switch v := arg1.(type) { case env.RyeCtx: var err error - self.Style, err = ctxTo_widget_TextGridStyle(ps, v) + newVal, err = ctxTo_widget_TextGridStyle(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridRow)//style!: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.TextGridRow)//style!: arg 2: " + err.Error()) } case env.Native: - var ok bool - self.Style, ok = v.Value.(widget.TextGridStyle) - if !ok { + if vc, ok := v.Value.(widget.TextGridStyle); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridRow)//style!: arg 2: expected native of type widget.TextGridStyle") + return env.NewError("Go(*widget.TextGridRow)//style!: arg 2: " + "expected native of type widget.TextGridStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridRow)//style!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGridRow)//style!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Style = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridRow)//style!: arg 2: expected native") + return env.NewError("Go(*widget.TextGridRow)//style!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Style = newVal return arg0 }, }, @@ -102415,41 +103377,24 @@ var Builtins = map[string]*env.Builtin{ var self *widget.TextGridRow switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.TextGridRow) - if !ok { + if vc, ok := v.Value.(*widget.TextGridRow); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridRow)//style?: arg 1: expected native of type *widget.TextGridRow") + return env.NewError("Go(*widget.TextGridRow)//style?: arg 1: " + "expected native of type *widget.TextGridRow, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridRow)//style?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextGridRow)//style?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextGridRow)//style?: arg 1: expected native") + return env.NewError("Go(*widget.TextGridRow)//style?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - { - typ := reflect.TypeOf(self.Style) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - resObj = *env.NewNative(ps.Idx, self.Style, typRyeName) - } else { - resObj = *env.NewNative(ps.Idx, self.Style, "Go(widget.TextGridStyle)") - } - } + resObj = ifaceToNative(ps.Idx, self.Style, "Go(widget.TextGridStyle)") return resObj }, }, @@ -102460,21 +103405,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.TextSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.TextSegment) - if !ok { + if vc, ok := v.Value.(*widget.TextSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//inline: arg 1: expected native of type *widget.TextSegment") + return env.NewError("Go(*widget.TextSegment)//inline: arg 1: " + "expected native of type *widget.TextSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//inline: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextSegment)//inline: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//inline: arg 1: expected native") + return env.NewError("Go(*widget.TextSegment)//inline: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Inline() var res0Obj env.Object @@ -102489,61 +103434,49 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.TextSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.TextSegment) - if !ok { + if vc, ok := v.Value.(*widget.TextSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//select: arg 1: expected native of type *widget.TextSegment") + return env.NewError("Go(*widget.TextSegment)//select: arg 1: " + "expected native of type *widget.TextSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//select: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextSegment)//select: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//select: arg 1: expected native") + return env.NewError("Go(*widget.TextSegment)//select: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//select: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//select: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextSegment)//select: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//select: arg 2: expected native") + return env.NewError("Go(*widget.TextSegment)//select: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg2Val *fyne.Position + var arg2Val fyne.Position switch v := arg2.(type) { case env.Native: - var ok bool - arg2Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//select: arg 3: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg2Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//select: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextSegment)//select: arg 3: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//select: arg 3: expected native") + return env.NewError("Go(*widget.TextSegment)//select: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Select(*arg1Val, *arg2Val) + arg0Val.Select(arg1Val, arg2Val) return arg0 }, }, @@ -102554,21 +103487,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.TextSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.TextSegment) - if !ok { + if vc, ok := v.Value.(*widget.TextSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//selected-text: arg 1: expected native of type *widget.TextSegment") + return env.NewError("Go(*widget.TextSegment)//selected-text: arg 1: " + "expected native of type *widget.TextSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//selected-text: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextSegment)//selected-text: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//selected-text: arg 1: expected native") + return env.NewError("Go(*widget.TextSegment)//selected-text: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.SelectedText() var res0Obj env.Object @@ -102583,34 +103516,42 @@ var Builtins = map[string]*env.Builtin{ var self *widget.TextSegment switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.TextSegment) - if !ok { + if vc, ok := v.Value.(*widget.TextSegment); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//style!: arg 1: expected native of type *widget.TextSegment") + return env.NewError("Go(*widget.TextSegment)//style!: arg 1: " + "expected native of type *widget.TextSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//style!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextSegment)//style!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//style!: arg 1: expected native") + return env.NewError("Go(*widget.TextSegment)//style!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal *widget.RichTextStyle switch v := arg1.(type) { case env.Native: - var ok bool - self.Style, ok = v.Value.(widget.RichTextStyle) - if !ok { + if vc, ok := v.Value.(*widget.RichTextStyle); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.TextSegment)//style!: arg 2: " + "expected native of type *widget.RichTextStyle, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//style!: arg 2: expected native of type widget.RichTextStyle") + return env.NewError("Go(*widget.TextSegment)//style!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//style!: arg 2: expected native") + return env.NewError("Go(*widget.TextSegment)//style!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Style = *newVal return arg0 }, }, @@ -102621,21 +103562,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.TextSegment switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.TextSegment) - if !ok { + if vc, ok := v.Value.(*widget.TextSegment); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//style?: arg 1: expected native of type *widget.TextSegment") + return env.NewError("Go(*widget.TextSegment)//style?: arg 1: " + "expected native of type *widget.TextSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//style?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextSegment)//style?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//style?: arg 1: expected native") + return env.NewError("Go(*widget.TextSegment)//style?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewNative(ps.Idx, &self.Style, "Go(*widget.RichTextStyle)") @@ -102649,28 +103590,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.TextSegment switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.TextSegment) - if !ok { + if vc, ok := v.Value.(*widget.TextSegment); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//text!: arg 1: expected native of type *widget.TextSegment") + return env.NewError("Go(*widget.TextSegment)//text!: arg 1: " + "expected native of type *widget.TextSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//text!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextSegment)//text!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//text!: arg 1: expected native") + return env.NewError("Go(*widget.TextSegment)//text!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.String); ok { - self.Text = string(v.Value) + var newVal string + if vc, ok := arg1.(env.String); ok { + newVal = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//text!: arg 2: expected string") + return env.NewError("Go(*widget.TextSegment)//text!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } + self.Text = newVal return arg0 }, }, @@ -102681,21 +103624,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.TextSegment switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.TextSegment) - if !ok { + if vc, ok := v.Value.(*widget.TextSegment); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//text?: arg 1: expected native of type *widget.TextSegment") + return env.NewError("Go(*widget.TextSegment)//text?: arg 1: " + "expected native of type *widget.TextSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//text?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextSegment)//text?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//text?: arg 1: expected native") + return env.NewError("Go(*widget.TextSegment)//text?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(self.Text) @@ -102709,21 +103652,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.TextSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.TextSegment) - if !ok { + if vc, ok := v.Value.(*widget.TextSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//textual: arg 1: expected native of type *widget.TextSegment") + return env.NewError("Go(*widget.TextSegment)//textual: arg 1: " + "expected native of type *widget.TextSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//textual: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextSegment)//textual: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//textual: arg 1: expected native") + return env.NewError("Go(*widget.TextSegment)//textual: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Textual() var res0Obj env.Object @@ -102738,21 +103681,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.TextSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.TextSegment) - if !ok { + if vc, ok := v.Value.(*widget.TextSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//unselect: arg 1: expected native of type *widget.TextSegment") + return env.NewError("Go(*widget.TextSegment)//unselect: arg 1: " + "expected native of type *widget.TextSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//unselect: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextSegment)//unselect: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//unselect: arg 1: expected native") + return env.NewError("Go(*widget.TextSegment)//unselect: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Unselect() return arg0 @@ -102765,21 +103708,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.TextSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.TextSegment) - if !ok { + if vc, ok := v.Value.(*widget.TextSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//update: arg 1: expected native of type *widget.TextSegment") + return env.NewError("Go(*widget.TextSegment)//update: arg 1: " + "expected native of type *widget.TextSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//update: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextSegment)//update: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//update: arg 1: expected native") + return env.NewError("Go(*widget.TextSegment)//update: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.CanvasObject switch v := arg1.(type) { @@ -102788,24 +103731,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//update: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.TextSegment)//update: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//update: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("Go(*widget.TextSegment)//update: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//update: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextSegment)//update: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//update: arg 2: expected native") + return env.NewError("Go(*widget.TextSegment)//update: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Update(arg1Val) return arg0 @@ -102818,42 +103761,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.TextSegment switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.TextSegment) - if !ok { + if vc, ok := v.Value.(*widget.TextSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//visual: arg 1: expected native of type *widget.TextSegment") + return env.NewError("Go(*widget.TextSegment)//visual: arg 1: " + "expected native of type *widget.TextSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//visual: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.TextSegment)//visual: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.TextSegment)//visual: arg 1: expected native") + return env.NewError("Go(*widget.TextSegment)//visual: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visual() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.CanvasObject)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.CanvasObject)") return res0Obj }, }, @@ -102864,21 +103790,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Toolbar switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Toolbar) - if !ok { + if vc, ok := v.Value.(*widget.Toolbar); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//append: arg 1: expected native of type *widget.Toolbar") + return env.NewError("Go(*widget.Toolbar)//append: arg 1: " + "expected native of type *widget.Toolbar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Toolbar)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//append: arg 1: expected native") + return env.NewError("Go(*widget.Toolbar)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val widget.ToolbarItem switch v := arg1.(type) { @@ -102887,29 +103813,103 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_widget_ToolbarItem(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//append: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Toolbar)//append: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(widget.ToolbarItem) - if !ok { + if vc, ok := v.Value.(widget.ToolbarItem); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//append: arg 2: expected native of type widget.ToolbarItem") + return env.NewError("Go(*widget.Toolbar)//append: arg 2: " + "expected native of type widget.ToolbarItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//append: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Toolbar)//append: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//append: arg 2: expected native") + return env.NewError("Go(*widget.Toolbar)//append: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Append(arg1Val) return arg0 }, }, + "Go(*widget.Toolbar)//base-widget!": { + Doc: "Set *widget.Toolbar BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Toolbar + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Toolbar); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Toolbar)//base-widget!: arg 1: " + "expected native of type *widget.Toolbar, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Toolbar)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Toolbar)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Toolbar)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Toolbar)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Toolbar)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*widget.Toolbar)//base-widget?": { + Doc: "Get *widget.Toolbar BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Toolbar + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Toolbar); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Toolbar)//base-widget?: arg 1: " + "expected native of type *widget.Toolbar, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Toolbar)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Toolbar)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj + }, + }, "Go(*widget.Toolbar)//create-renderer": { Doc: "(*widget.Toolbar).CreateRenderer", Argsn: 1, @@ -102917,42 +103917,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Toolbar switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Toolbar) - if !ok { + if vc, ok := v.Value.(*widget.Toolbar); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//create-renderer: arg 1: expected native of type *widget.Toolbar") + return env.NewError("Go(*widget.Toolbar)//create-renderer: arg 1: " + "expected native of type *widget.Toolbar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Toolbar)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//create-renderer: arg 1: expected native") + return env.NewError("Go(*widget.Toolbar)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -102963,21 +103946,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Toolbar switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Toolbar) - if !ok { + if vc, ok := v.Value.(*widget.Toolbar); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//extend-base-widget: arg 1: expected native of type *widget.Toolbar") + return env.NewError("Go(*widget.Toolbar)//extend-base-widget: arg 1: " + "expected native of type *widget.Toolbar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Toolbar)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.Toolbar)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -102986,24 +103969,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Toolbar)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.Toolbar)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Toolbar)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.Toolbar)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -103016,28 +103999,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Toolbar switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Toolbar) - if !ok { + if vc, ok := v.Value.(*widget.Toolbar); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//hidden!: arg 1: expected native of type *widget.Toolbar") + return env.NewError("Go(*widget.Toolbar)//hidden!: arg 1: " + "expected native of type *widget.Toolbar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Toolbar)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.Toolbar)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.Toolbar)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -103048,21 +104033,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Toolbar switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Toolbar) - if !ok { + if vc, ok := v.Value.(*widget.Toolbar); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//hidden?: arg 1: expected native of type *widget.Toolbar") + return env.NewError("Go(*widget.Toolbar)//hidden?: arg 1: " + "expected native of type *widget.Toolbar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Toolbar)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.Toolbar)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -103076,21 +104061,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Toolbar switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Toolbar) - if !ok { + if vc, ok := v.Value.(*widget.Toolbar); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//hide: arg 1: expected native of type *widget.Toolbar") + return env.NewError("Go(*widget.Toolbar)//hide: arg 1: " + "expected native of type *widget.Toolbar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Toolbar)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//hide: arg 1: expected native") + return env.NewError("Go(*widget.Toolbar)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -103103,69 +104088,64 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Toolbar switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Toolbar) - if !ok { + if vc, ok := v.Value.(*widget.Toolbar); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//items!: arg 1: expected native of type *widget.Toolbar") + return env.NewError("Go(*widget.Toolbar)//items!: arg 1: " + "expected native of type *widget.Toolbar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//items!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Toolbar)//items!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//items!: arg 1: expected native") + return env.NewError("Go(*widget.Toolbar)//items!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal []widget.ToolbarItem switch v := arg1.(type) { case env.Block: - self.Items = make([]widget.ToolbarItem, len(v.Series.S)) + newVal = make([]widget.ToolbarItem, len(v.Series.S)) for i, it := range v.Series.S { switch v := it.(type) { case env.RyeCtx: var err error - self.Items[i], err = ctxTo_widget_ToolbarItem(ps, v) + newVal[i], err = ctxTo_widget_ToolbarItem(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//items!: arg 2: block item: " + err.Error() + "") + return env.NewError("Go(*widget.Toolbar)//items!: arg 2: " + "block item: " + err.Error()) } case env.Native: - var ok bool - self.Items[i], ok = v.Value.(widget.ToolbarItem) - if !ok { + if vc, ok := v.Value.(widget.ToolbarItem); ok { + newVal[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//items!: arg 2: block item: expected native of type widget.ToolbarItem") + return env.NewError("Go(*widget.Toolbar)//items!: arg 2: " + "block item: " + "expected native of type widget.ToolbarItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//items!: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Toolbar)//items!: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Items[i] = nil + newVal[i] = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//items!: arg 2: block item: expected native") + return env.NewError("Go(*widget.Toolbar)//items!: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - self.Items, ok = v.Value.([]widget.ToolbarItem) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//items!: arg 2: expected native of type []widget.ToolbarItem") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//items!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Toolbar)//items!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Items = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//items!: arg 2: expected block, native or nil") + return env.NewError("Go(*widget.Toolbar)//items!: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } + self.Items = newVal return arg0 }, }, @@ -103176,44 +104156,27 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Toolbar switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Toolbar) - if !ok { + if vc, ok := v.Value.(*widget.Toolbar); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//items?: arg 1: expected native of type *widget.Toolbar") + return env.NewError("Go(*widget.Toolbar)//items?: arg 1: " + "expected native of type *widget.Toolbar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//items?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Toolbar)//items?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//items?: arg 1: expected native") + return env.NewError("Go(*widget.Toolbar)//items?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object { items := make([]env.Object, len(self.Items)) for i, it := range self.Items { - { - typ := reflect.TypeOf(it) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - items[i] = *env.NewNative(ps.Idx, it, typRyeName) - } else { - items[i] = *env.NewNative(ps.Idx, it, "Go(widget.ToolbarItem)") - } - } + items[i] = ifaceToNative(ps.Idx, it, "Go(widget.ToolbarItem)") } resObj = *env.NewBlock(*env.NewTSeries(items)) } @@ -103227,21 +104190,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Toolbar switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Toolbar) - if !ok { + if vc, ok := v.Value.(*widget.Toolbar); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//min-size: arg 1: expected native of type *widget.Toolbar") + return env.NewError("Go(*widget.Toolbar)//min-size: arg 1: " + "expected native of type *widget.Toolbar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Toolbar)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.Toolbar)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -103256,42 +104219,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Toolbar switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Toolbar) - if !ok { + if vc, ok := v.Value.(*widget.Toolbar); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//move: arg 1: expected native of type *widget.Toolbar") + return env.NewError("Go(*widget.Toolbar)//move: arg 1: " + "expected native of type *widget.Toolbar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Toolbar)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//move: arg 1: expected native") + return env.NewError("Go(*widget.Toolbar)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Toolbar)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//move: arg 2: expected native") + return env.NewError("Go(*widget.Toolbar)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -103302,21 +104259,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Toolbar switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Toolbar) - if !ok { + if vc, ok := v.Value.(*widget.Toolbar); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//position: arg 1: expected native of type *widget.Toolbar") + return env.NewError("Go(*widget.Toolbar)//position: arg 1: " + "expected native of type *widget.Toolbar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Toolbar)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//position: arg 1: expected native") + return env.NewError("Go(*widget.Toolbar)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -103331,21 +104288,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Toolbar switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Toolbar) - if !ok { + if vc, ok := v.Value.(*widget.Toolbar); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//prepend: arg 1: expected native of type *widget.Toolbar") + return env.NewError("Go(*widget.Toolbar)//prepend: arg 1: " + "expected native of type *widget.Toolbar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Toolbar)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//prepend: arg 1: expected native") + return env.NewError("Go(*widget.Toolbar)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val widget.ToolbarItem switch v := arg1.(type) { @@ -103354,24 +104311,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_widget_ToolbarItem(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//prepend: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Toolbar)//prepend: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(widget.ToolbarItem) - if !ok { + if vc, ok := v.Value.(widget.ToolbarItem); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//prepend: arg 2: expected native of type widget.ToolbarItem") + return env.NewError("Go(*widget.Toolbar)//prepend: arg 2: " + "expected native of type widget.ToolbarItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//prepend: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Toolbar)//prepend: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//prepend: arg 2: expected native") + return env.NewError("Go(*widget.Toolbar)//prepend: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Prepend(arg1Val) return arg0 @@ -103384,21 +104341,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Toolbar switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Toolbar) - if !ok { + if vc, ok := v.Value.(*widget.Toolbar); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//refresh: arg 1: expected native of type *widget.Toolbar") + return env.NewError("Go(*widget.Toolbar)//refresh: arg 1: " + "expected native of type *widget.Toolbar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Toolbar)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.Toolbar)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -103411,42 +104368,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Toolbar switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Toolbar) - if !ok { + if vc, ok := v.Value.(*widget.Toolbar); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//resize: arg 1: expected native of type *widget.Toolbar") + return env.NewError("Go(*widget.Toolbar)//resize: arg 1: " + "expected native of type *widget.Toolbar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Toolbar)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//resize: arg 1: expected native") + return env.NewError("Go(*widget.Toolbar)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Toolbar)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//resize: arg 2: expected native") + return env.NewError("Go(*widget.Toolbar)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -103457,21 +104408,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Toolbar switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Toolbar) - if !ok { + if vc, ok := v.Value.(*widget.Toolbar); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//show: arg 1: expected native of type *widget.Toolbar") + return env.NewError("Go(*widget.Toolbar)//show: arg 1: " + "expected native of type *widget.Toolbar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Toolbar)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//show: arg 1: expected native") + return env.NewError("Go(*widget.Toolbar)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -103484,21 +104435,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Toolbar switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Toolbar) - if !ok { + if vc, ok := v.Value.(*widget.Toolbar); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//size: arg 1: expected native of type *widget.Toolbar") + return env.NewError("Go(*widget.Toolbar)//size: arg 1: " + "expected native of type *widget.Toolbar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Toolbar)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//size: arg 1: expected native") + return env.NewError("Go(*widget.Toolbar)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -103513,21 +104464,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Toolbar switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Toolbar) - if !ok { + if vc, ok := v.Value.(*widget.Toolbar); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//visible: arg 1: expected native of type *widget.Toolbar") + return env.NewError("Go(*widget.Toolbar)//visible: arg 1: " + "expected native of type *widget.Toolbar, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Toolbar)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Toolbar)//visible: arg 1: expected native") + return env.NewError("Go(*widget.Toolbar)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -103542,47 +104493,49 @@ var Builtins = map[string]*env.Builtin{ var self *widget.ToolbarAction switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.ToolbarAction) - if !ok { + if vc, ok := v.Value.(*widget.ToolbarAction); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarAction)//icon!: arg 1: expected native of type *widget.ToolbarAction") + return env.NewError("Go(*widget.ToolbarAction)//icon!: arg 1: " + "expected native of type *widget.ToolbarAction, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarAction)//icon!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ToolbarAction)//icon!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarAction)//icon!: arg 1: expected native") + return env.NewError("Go(*widget.ToolbarAction)//icon!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal fyne.Resource switch v := arg1.(type) { case env.RyeCtx: var err error - self.Icon, err = ctxTo_fyne_Resource(ps, v) + newVal, err = ctxTo_fyne_Resource(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarAction)//icon!: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.ToolbarAction)//icon!: arg 2: " + err.Error()) } case env.Native: - var ok bool - self.Icon, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + newVal = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarAction)//icon!: arg 2: expected native of type fyne.Resource") + return env.NewError("Go(*widget.ToolbarAction)//icon!: arg 2: " + "expected native of type fyne.Resource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarAction)//icon!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ToolbarAction)//icon!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } - self.Icon = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarAction)//icon!: arg 2: expected native") + return env.NewError("Go(*widget.ToolbarAction)//icon!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + self.Icon = newVal return arg0 }, }, @@ -103593,41 +104546,24 @@ var Builtins = map[string]*env.Builtin{ var self *widget.ToolbarAction switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.ToolbarAction) - if !ok { + if vc, ok := v.Value.(*widget.ToolbarAction); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarAction)//icon?: arg 1: expected native of type *widget.ToolbarAction") + return env.NewError("Go(*widget.ToolbarAction)//icon?: arg 1: " + "expected native of type *widget.ToolbarAction, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarAction)//icon?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ToolbarAction)//icon?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarAction)//icon?: arg 1: expected native") + return env.NewError("Go(*widget.ToolbarAction)//icon?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - { - typ := reflect.TypeOf(self.Icon) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - resObj = *env.NewNative(ps.Idx, self.Icon, typRyeName) - } else { - resObj = *env.NewNative(ps.Idx, self.Icon, "Go(fyne.Resource)") - } - } + resObj = ifaceToNative(ps.Idx, self.Icon, "Go(fyne.Resource)") return resObj }, }, @@ -103638,29 +104574,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.ToolbarAction switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.ToolbarAction) - if !ok { + if vc, ok := v.Value.(*widget.ToolbarAction); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarAction)//on-activated!: arg 1: expected native of type *widget.ToolbarAction") + return env.NewError("Go(*widget.ToolbarAction)//on-activated!: arg 1: " + "expected native of type *widget.ToolbarAction, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarAction)//on-activated!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ToolbarAction)//on-activated!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarAction)//on-activated!: arg 1: expected native") + return env.NewError("Go(*widget.ToolbarAction)//on-activated!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func() switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarAction)//on-activated!: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(*widget.ToolbarAction)//on-activated!: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnActivated = func() { + newVal = func() { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, ps.Ctx) @@ -103668,13 +104605,14 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarAction)//on-activated!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ToolbarAction)//on-activated!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnActivated = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarAction)//on-activated!: arg 2: expected function or nil") + return env.NewError("Go(*widget.ToolbarAction)//on-activated!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnActivated = newVal return arg0 }, }, @@ -103685,24 +104623,27 @@ var Builtins = map[string]*env.Builtin{ var self *widget.ToolbarAction switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.ToolbarAction) - if !ok { + if vc, ok := v.Value.(*widget.ToolbarAction); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarAction)//on-activated?: arg 1: expected native of type *widget.ToolbarAction") + return env.NewError("Go(*widget.ToolbarAction)//on-activated?: arg 1: " + "expected native of type *widget.ToolbarAction, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarAction)//on-activated?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ToolbarAction)//on-activated?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarAction)//on-activated?: arg 1: expected native") + return env.NewError("Go(*widget.ToolbarAction)//on-activated?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnActivated, "Go(func())") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + self.OnActivated() + return nil + }, 0, false, false, "Returned func") return resObj }, }, @@ -103713,21 +104654,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ToolbarAction switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ToolbarAction) - if !ok { + if vc, ok := v.Value.(*widget.ToolbarAction); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarAction)//set-icon: arg 1: expected native of type *widget.ToolbarAction") + return env.NewError("Go(*widget.ToolbarAction)//set-icon: arg 1: " + "expected native of type *widget.ToolbarAction, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarAction)//set-icon: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ToolbarAction)//set-icon: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarAction)//set-icon: arg 1: expected native") + return env.NewError("Go(*widget.ToolbarAction)//set-icon: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Resource switch v := arg1.(type) { @@ -103736,24 +104677,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Resource(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarAction)//set-icon: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.ToolbarAction)//set-icon: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarAction)//set-icon: arg 2: expected native of type fyne.Resource") + return env.NewError("Go(*widget.ToolbarAction)//set-icon: arg 2: " + "expected native of type fyne.Resource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarAction)//set-icon: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ToolbarAction)//set-icon: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarAction)//set-icon: arg 2: expected native") + return env.NewError("Go(*widget.ToolbarAction)//set-icon: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetIcon(arg1Val) return arg0 @@ -103766,42 +104707,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ToolbarAction switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ToolbarAction) - if !ok { + if vc, ok := v.Value.(*widget.ToolbarAction); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarAction)//toolbar-object: arg 1: expected native of type *widget.ToolbarAction") + return env.NewError("Go(*widget.ToolbarAction)//toolbar-object: arg 1: " + "expected native of type *widget.ToolbarAction, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarAction)//toolbar-object: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ToolbarAction)//toolbar-object: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarAction)//toolbar-object: arg 1: expected native") + return env.NewError("Go(*widget.ToolbarAction)//toolbar-object: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.ToolbarObject() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.CanvasObject)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.CanvasObject)") return res0Obj }, }, @@ -103812,42 +104736,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ToolbarSeparator switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ToolbarSeparator) - if !ok { + if vc, ok := v.Value.(*widget.ToolbarSeparator); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarSeparator)//toolbar-object: arg 1: expected native of type *widget.ToolbarSeparator") + return env.NewError("Go(*widget.ToolbarSeparator)//toolbar-object: arg 1: " + "expected native of type *widget.ToolbarSeparator, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarSeparator)//toolbar-object: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ToolbarSeparator)//toolbar-object: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarSeparator)//toolbar-object: arg 1: expected native") + return env.NewError("Go(*widget.ToolbarSeparator)//toolbar-object: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.ToolbarObject() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.CanvasObject)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.CanvasObject)") return res0Obj }, }, @@ -103858,43 +104765,100 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.ToolbarSpacer switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.ToolbarSpacer) - if !ok { + if vc, ok := v.Value.(*widget.ToolbarSpacer); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarSpacer)//toolbar-object: arg 1: expected native of type *widget.ToolbarSpacer") + return env.NewError("Go(*widget.ToolbarSpacer)//toolbar-object: arg 1: " + "expected native of type *widget.ToolbarSpacer, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarSpacer)//toolbar-object: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.ToolbarSpacer)//toolbar-object: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.ToolbarSpacer)//toolbar-object: arg 1: expected native") + return env.NewError("Go(*widget.ToolbarSpacer)//toolbar-object: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.ToolbarObject() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.CanvasObject)") + return res0Obj + }, + }, + "Go(*widget.Tree)//base-widget!": { + Doc: "Set *widget.Tree BaseWidget value", + Argsn: 2, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Tree + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Tree); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Tree)//base-widget!: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Tree)//base-widget!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Tree)//base-widget!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var newVal *widget.BaseWidget + switch v := arg1.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.BaseWidget); ok { + newVal = vc } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.CanvasObject)") + ps.FailureFlag = true + return env.NewError("Go(*widget.Tree)//base-widget!: arg 2: " + "expected native of type *widget.BaseWidget, but got " + objectDebugString(ps.Idx, v)) } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Tree)//base-widget!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + newVal = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Tree)//base-widget!: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - return res0Obj + self.BaseWidget = *newVal + return arg0 + }, + }, + "Go(*widget.Tree)//base-widget?": { + Doc: "Get *widget.Tree BaseWidget value", + Argsn: 1, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var self *widget.Tree + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*widget.Tree); ok { + self = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Tree)//base-widget?: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Tree)//base-widget?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + self = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Tree)//base-widget?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + var resObj env.Object + resObj = *env.NewNative(ps.Idx, &self.BaseWidget, "Go(*widget.BaseWidget)") + return resObj }, }, "Go(*widget.Tree)//child-ui-ds!": { @@ -103904,34 +104868,35 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//child-ui-ds!: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//child-ui-ds!: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//child-ui-ds!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//child-ui-ds!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//child-ui-ds!: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//child-ui-ds!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(widget.TreeNodeID) []widget.TreeNodeID switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//child-ui-ds!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*widget.Tree)//child-ui-ds!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.ChildUIDs = func(arg0 widget.TreeNodeID) []widget.TreeNodeID { - var arg0Val env.Object - arg0Val = *env.NewString(string(arg0)) + newVal = func(farg0 widget.TreeNodeID) []widget.TreeNodeID { + var farg0Val env.Object + farg0Val = *env.NewString(string(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) var res []widget.TreeNodeID switch v := ps.Res.(type) { case env.Block: @@ -103948,11 +104913,12 @@ var Builtins = map[string]*env.Builtin{ res[i] = natVal } else { var u string - if v, ok := it.(env.String); ok { - u = string(v.Value) + if vc, ok := it.(env.String); ok { + u = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.Tree)//child-ui-ds!: arg 2: callback result: block item: expected string", + "Go(*widget.Tree)//child-ui-ds!: arg 2: callback result: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -103962,21 +104928,11 @@ var Builtins = map[string]*env.Builtin{ } } } - case env.Native: - var ok bool - res, ok = v.Value.([]widget.TreeNodeID) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.Tree)//child-ui-ds!: arg 2: callback result: expected native of type []widget.TreeNodeID", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.Tree)//child-ui-ds!: arg 2: callback result: expected integer to be 0 or nil", + "Go(*widget.Tree)//child-ui-ds!: arg 2: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -103984,8 +104940,9 @@ var Builtins = map[string]*env.Builtin{ } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.Tree)//child-ui-ds!: arg 2: callback result: expected block, native or nil", + "Go(*widget.Tree)//child-ui-ds!: arg 2: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -103996,13 +104953,14 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//child-ui-ds!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//child-ui-ds!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.ChildUIDs = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//child-ui-ds!: arg 2: expected function or nil") + return env.NewError("Go(*widget.Tree)//child-ui-ds!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.ChildUIDs = newVal return arg0 }, }, @@ -104013,24 +104971,56 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//child-ui-ds?: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//child-ui-ds?: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//child-ui-ds?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//child-ui-ds?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//child-ui-ds?: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//child-ui-ds?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.ChildUIDs, "Go(func(widget.TreeNodeID) ([]widget.TreeNodeID))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val widget.TreeNodeID + { + nat, natOk := arg0.(env.Native) + var natValOk bool + var natVal widget.TreeNodeID + if natOk { + natVal, natValOk = nat.Value.(widget.TreeNodeID) + } + if natValOk { + arg0Val = natVal + } else { + var u string + if vc, ok := arg0.(env.String); ok { + u = string(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Tree)//child-ui-ds?: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) + } + arg0Val = widget.TreeNodeID(u) + } + } + res0 := self.ChildUIDs(arg0Val) + var res0Obj env.Object + { + items := make([]env.Object, len(res0)) + for i, it := range res0 { + items[i] = *env.NewString(string(it)) + } + res0Obj = *env.NewBlock(*env.NewTSeries(items)) + } + return res0Obj + }, 1, false, false, "Returned func") return resObj }, }, @@ -104041,21 +105031,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//close-all-branches: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//close-all-branches: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//close-all-branches: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//close-all-branches: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//close-all-branches: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//close-all-branches: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.CloseAllBranches() return arg0 @@ -104068,21 +105058,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//close-branch: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//close-branch: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//close-branch: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//close-branch: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//close-branch: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//close-branch: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val widget.TreeNodeID { @@ -104096,11 +105086,11 @@ var Builtins = map[string]*env.Builtin{ arg1Val = natVal } else { var u string - if v, ok := arg1.(env.String); ok { - u = string(v.Value) + if vc, ok := arg1.(env.String); ok { + u = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//close-branch: arg 2: expected string") + return env.NewError("Go(*widget.Tree)//close-branch: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg1Val = widget.TreeNodeID(u) } @@ -104116,53 +105106,56 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//create-node!: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//create-node!: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//create-node!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//create-node!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//create-node!: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//create-node!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(bool) fyne.CanvasObject switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//create-node!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*widget.Tree)//create-node!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.CreateNode = func(arg0 bool) fyne.CanvasObject { - var arg0Val env.Object - arg0Val = *env.NewInteger(boolToInt64(arg0)) + newVal = func(farg0 bool) fyne.CanvasObject { + var farg0Val env.Object + farg0Val = *env.NewInteger(boolToInt64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) var res fyne.CanvasObject switch v := ps.Res.(type) { case env.RyeCtx: var err error res, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.Tree)//create-node!: arg 2: callback result: "+err.Error()+"", + "Go(*widget.Tree)//create-node!: arg 2: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.Tree)//create-node!: arg 2: callback result: expected native of type fyne.CanvasObject", + "Go(*widget.Tree)//create-node!: arg 2: callback result: "+"expected native of type fyne.CanvasObject, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -104170,8 +105163,9 @@ var Builtins = map[string]*env.Builtin{ } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.Tree)//create-node!: arg 2: callback result: expected integer to be 0 or nil", + "Go(*widget.Tree)//create-node!: arg 2: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -104179,8 +105173,9 @@ var Builtins = map[string]*env.Builtin{ } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.Tree)//create-node!: arg 2: callback result: expected native", + "Go(*widget.Tree)//create-node!: arg 2: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -104191,13 +105186,14 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//create-node!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//create-node!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.CreateNode = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//create-node!: arg 2: expected function or nil") + return env.NewError("Go(*widget.Tree)//create-node!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.CreateNode = newVal return arg0 }, }, @@ -104208,24 +105204,36 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//create-node?: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//create-node?: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//create-node?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//create-node?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//create-node?: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//create-node?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.CreateNode, "Go(func(bool) (fyne.CanvasObject))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val bool + if vc, ok := arg0.(env.Integer); ok { + arg0Val = vc.Value != 0 + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Tree)//create-node?: arg 1: " + "expected integer, but got " + objectDebugString(ps.Idx, arg0)) + } + res0 := self.CreateNode(arg0Val) + var res0Obj env.Object + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.CanvasObject)") + return res0Obj + }, 1, false, false, "Returned func") return resObj }, }, @@ -104236,42 +105244,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//create-renderer: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//create-renderer: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//create-renderer: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -104282,21 +105273,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//extend-base-widget: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//extend-base-widget: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//extend-base-widget: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//extend-base-widget: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//extend-base-widget: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//extend-base-widget: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Widget switch v := arg1.(type) { @@ -104305,24 +105296,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//extend-base-widget: arg 2: " + err.Error() + "") + return env.NewError("Go(*widget.Tree)//extend-base-widget: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//extend-base-widget: arg 2: expected native of type fyne.Widget") + return env.NewError("Go(*widget.Tree)//extend-base-widget: arg 2: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//extend-base-widget: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//extend-base-widget: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//extend-base-widget: arg 2: expected native") + return env.NewError("Go(*widget.Tree)//extend-base-widget: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ExtendBaseWidget(arg1Val) return arg0 @@ -104335,21 +105326,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//focus-gained: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//focus-gained: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//focus-gained: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//focus-gained: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//focus-gained: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//focus-gained: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusGained() return arg0 @@ -104362,21 +105353,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//focus-lost: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//focus-lost: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//focus-lost: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//focus-lost: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//focus-lost: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//focus-lost: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusLost() return arg0 @@ -104389,28 +105380,30 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//hidden!: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//hidden!: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//hidden!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//hidden!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//hidden!: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//hidden!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - if v, ok := arg1.(env.Integer); ok { - self.Hidden = v.Value != 0 + var newVal bool + if vc, ok := arg1.(env.Integer); ok { + newVal = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//hidden!: arg 2: expected integer") + return env.NewError("Go(*widget.Tree)//hidden!: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } + self.Hidden = newVal return arg0 }, }, @@ -104421,21 +105414,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//hidden?: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//hidden?: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//hidden?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//hidden?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//hidden?: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//hidden?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewInteger(boolToInt64(self.Hidden)) @@ -104449,21 +105442,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//hide: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//hide: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//hide: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -104476,40 +105469,42 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//is-branch!: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//is-branch!: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//is-branch!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//is-branch!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//is-branch!: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//is-branch!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(widget.TreeNodeID) bool switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//is-branch!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*widget.Tree)//is-branch!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.IsBranch = func(arg0 widget.TreeNodeID) bool { - var arg0Val env.Object - arg0Val = *env.NewString(string(arg0)) + newVal = func(farg0 widget.TreeNodeID) bool { + var farg0Val env.Object + farg0Val = *env.NewString(string(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) var res bool - if v, ok := ps.Res.(env.Integer); ok { - res = v.Value != 0 + if vc, ok := ps.Res.(env.Integer); ok { + res = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "Go(*widget.Tree)//is-branch!: arg 2: callback result: expected integer", + "Go(*widget.Tree)//is-branch!: arg 2: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -104520,13 +105515,14 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//is-branch!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//is-branch!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.IsBranch = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//is-branch!: arg 2: expected function or nil") + return env.NewError("Go(*widget.Tree)//is-branch!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.IsBranch = newVal return arg0 }, }, @@ -104537,21 +105533,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//is-branch-open: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//is-branch-open: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//is-branch-open: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//is-branch-open: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//is-branch-open: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//is-branch-open: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val widget.TreeNodeID { @@ -104565,11 +105561,11 @@ var Builtins = map[string]*env.Builtin{ arg1Val = natVal } else { var u string - if v, ok := arg1.(env.String); ok { - u = string(v.Value) + if vc, ok := arg1.(env.String); ok { + u = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//is-branch-open: arg 2: expected string") + return env.NewError("Go(*widget.Tree)//is-branch-open: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg1Val = widget.TreeNodeID(u) } @@ -104587,24 +105583,50 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//is-branch?: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//is-branch?: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//is-branch?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//is-branch?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//is-branch?: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//is-branch?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.IsBranch, "Go(func(widget.TreeNodeID) (bool))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val widget.TreeNodeID + { + nat, natOk := arg0.(env.Native) + var natValOk bool + var natVal widget.TreeNodeID + if natOk { + natVal, natValOk = nat.Value.(widget.TreeNodeID) + } + if natValOk { + arg0Val = natVal + } else { + var u string + if vc, ok := arg0.(env.String); ok { + u = string(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Tree)//is-branch?: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) + } + arg0Val = widget.TreeNodeID(u) + } + } + res0 := self.IsBranch(arg0Val) + var res0Obj env.Object + res0Obj = *env.NewInteger(boolToInt64(res0)) + return res0Obj + }, 1, false, false, "Returned func") return resObj }, }, @@ -104615,21 +105637,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//min-size: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//min-size: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//min-size: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -104644,42 +105666,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//move: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//move: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//move: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//move: arg 2: expected native") + return env.NewError("Go(*widget.Tree)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -104690,45 +105706,47 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-branch-closed!: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//on-branch-closed!: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-branch-closed!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//on-branch-closed!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-branch-closed!: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//on-branch-closed!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(widget.TreeNodeID) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-branch-closed!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*widget.Tree)//on-branch-closed!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnBranchClosed = func(arg0 widget.TreeNodeID) { - var arg0Val env.Object - arg0Val = *env.NewString(string(arg0)) + newVal = func(farg0 widget.TreeNodeID) { + var farg0Val env.Object + farg0Val = *env.NewString(string(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-branch-closed!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//on-branch-closed!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnBranchClosed = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-branch-closed!: arg 2: expected function or nil") + return env.NewError("Go(*widget.Tree)//on-branch-closed!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnBranchClosed = newVal return arg0 }, }, @@ -104739,24 +105757,48 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-branch-closed?: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//on-branch-closed?: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-branch-closed?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//on-branch-closed?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-branch-closed?: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//on-branch-closed?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnBranchClosed, "Go(func(widget.TreeNodeID))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val widget.TreeNodeID + { + nat, natOk := arg0.(env.Native) + var natValOk bool + var natVal widget.TreeNodeID + if natOk { + natVal, natValOk = nat.Value.(widget.TreeNodeID) + } + if natValOk { + arg0Val = natVal + } else { + var u string + if vc, ok := arg0.(env.String); ok { + u = string(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Tree)//on-branch-closed?: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) + } + arg0Val = widget.TreeNodeID(u) + } + } + self.OnBranchClosed(arg0Val) + return nil + }, 1, false, false, "Returned func") return resObj }, }, @@ -104767,45 +105809,47 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-branch-opened!: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//on-branch-opened!: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-branch-opened!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//on-branch-opened!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-branch-opened!: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//on-branch-opened!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(widget.TreeNodeID) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-branch-opened!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*widget.Tree)//on-branch-opened!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnBranchOpened = func(arg0 widget.TreeNodeID) { - var arg0Val env.Object - arg0Val = *env.NewString(string(arg0)) + newVal = func(farg0 widget.TreeNodeID) { + var farg0Val env.Object + farg0Val = *env.NewString(string(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-branch-opened!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//on-branch-opened!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnBranchOpened = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-branch-opened!: arg 2: expected function or nil") + return env.NewError("Go(*widget.Tree)//on-branch-opened!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnBranchOpened = newVal return arg0 }, }, @@ -104816,24 +105860,48 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-branch-opened?: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//on-branch-opened?: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-branch-opened?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//on-branch-opened?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-branch-opened?: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//on-branch-opened?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnBranchOpened, "Go(func(widget.TreeNodeID))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val widget.TreeNodeID + { + nat, natOk := arg0.(env.Native) + var natValOk bool + var natVal widget.TreeNodeID + if natOk { + natVal, natValOk = nat.Value.(widget.TreeNodeID) + } + if natValOk { + arg0Val = natVal + } else { + var u string + if vc, ok := arg0.(env.String); ok { + u = string(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Tree)//on-branch-opened?: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) + } + arg0Val = widget.TreeNodeID(u) + } + } + self.OnBranchOpened(arg0Val) + return nil + }, 1, false, false, "Returned func") return resObj }, }, @@ -104844,45 +105912,47 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-selected!: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//on-selected!: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-selected!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//on-selected!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-selected!: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//on-selected!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(widget.TreeNodeID) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-selected!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*widget.Tree)//on-selected!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnSelected = func(arg0 widget.TreeNodeID) { - var arg0Val env.Object - arg0Val = *env.NewString(string(arg0)) + newVal = func(farg0 widget.TreeNodeID) { + var farg0Val env.Object + farg0Val = *env.NewString(string(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-selected!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//on-selected!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnSelected = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-selected!: arg 2: expected function or nil") + return env.NewError("Go(*widget.Tree)//on-selected!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnSelected = newVal return arg0 }, }, @@ -104893,24 +105963,48 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-selected?: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//on-selected?: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-selected?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//on-selected?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-selected?: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//on-selected?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnSelected, "Go(func(widget.TreeNodeID))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val widget.TreeNodeID + { + nat, natOk := arg0.(env.Native) + var natValOk bool + var natVal widget.TreeNodeID + if natOk { + natVal, natValOk = nat.Value.(widget.TreeNodeID) + } + if natValOk { + arg0Val = natVal + } else { + var u string + if vc, ok := arg0.(env.String); ok { + u = string(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Tree)//on-selected?: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) + } + arg0Val = widget.TreeNodeID(u) + } + } + self.OnSelected(arg0Val) + return nil + }, 1, false, false, "Returned func") return resObj }, }, @@ -104921,45 +106015,47 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-unselected!: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//on-unselected!: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-unselected!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//on-unselected!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-unselected!: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//on-unselected!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(widget.TreeNodeID) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-unselected!: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(*widget.Tree)//on-unselected!: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.OnUnselected = func(arg0 widget.TreeNodeID) { - var arg0Val env.Object - arg0Val = *env.NewString(string(arg0)) + newVal = func(farg0 widget.TreeNodeID) { + var farg0Val env.Object + farg0Val = *env.NewString(string(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-unselected!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//on-unselected!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.OnUnselected = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-unselected!: arg 2: expected function or nil") + return env.NewError("Go(*widget.Tree)//on-unselected!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.OnUnselected = newVal return arg0 }, }, @@ -104970,24 +106066,48 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-unselected?: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//on-unselected?: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-unselected?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//on-unselected?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//on-unselected?: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//on-unselected?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.OnUnselected, "Go(func(widget.TreeNodeID))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val widget.TreeNodeID + { + nat, natOk := arg0.(env.Native) + var natValOk bool + var natVal widget.TreeNodeID + if natOk { + natVal, natValOk = nat.Value.(widget.TreeNodeID) + } + if natValOk { + arg0Val = natVal + } else { + var u string + if vc, ok := arg0.(env.String); ok { + u = string(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Tree)//on-unselected?: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) + } + arg0Val = widget.TreeNodeID(u) + } + } + self.OnUnselected(arg0Val) + return nil + }, 1, false, false, "Returned func") return resObj }, }, @@ -104998,21 +106118,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//open-all-branches: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//open-all-branches: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//open-all-branches: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//open-all-branches: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//open-all-branches: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//open-all-branches: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.OpenAllBranches() return arg0 @@ -105025,21 +106145,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//open-branch: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//open-branch: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//open-branch: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//open-branch: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//open-branch: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//open-branch: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val widget.TreeNodeID { @@ -105053,11 +106173,11 @@ var Builtins = map[string]*env.Builtin{ arg1Val = natVal } else { var u string - if v, ok := arg1.(env.String); ok { - u = string(v.Value) + if vc, ok := arg1.(env.String); ok { + u = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//open-branch: arg 2: expected string") + return env.NewError("Go(*widget.Tree)//open-branch: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg1Val = widget.TreeNodeID(u) } @@ -105073,21 +106193,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//position: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//position: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//position: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -105102,21 +106222,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//refresh: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//refresh: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//refresh: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -105129,21 +106249,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//refresh-item: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//refresh-item: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//refresh-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//refresh-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//refresh-item: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//refresh-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val widget.TreeNodeID { @@ -105157,11 +106277,11 @@ var Builtins = map[string]*env.Builtin{ arg1Val = natVal } else { var u string - if v, ok := arg1.(env.String); ok { - u = string(v.Value) + if vc, ok := arg1.(env.String); ok { + u = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//refresh-item: arg 2: expected string") + return env.NewError("Go(*widget.Tree)//refresh-item: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg1Val = widget.TreeNodeID(u) } @@ -105177,42 +106297,36 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//resize: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//resize: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//resize: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//resize: arg 2: expected native") + return env.NewError("Go(*widget.Tree)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -105223,22 +106337,23 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//root!: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//root!: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//root!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//root!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//root!: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//root!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal widget.TreeNodeID { nat, natOk := arg1.(env.Native) var natValOk bool @@ -105247,18 +106362,19 @@ var Builtins = map[string]*env.Builtin{ natVal, natValOk = nat.Value.(widget.TreeNodeID) } if natValOk { - self.Root = natVal + newVal = natVal } else { var u string - if v, ok := arg1.(env.String); ok { - u = string(v.Value) + if vc, ok := arg1.(env.String); ok { + u = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//root!: arg 2: expected string") + return env.NewError("Go(*widget.Tree)//root!: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } - self.Root = widget.TreeNodeID(u) + newVal = widget.TreeNodeID(u) } } + self.Root = newVal return arg0 }, }, @@ -105269,21 +106385,21 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//root?: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//root?: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//root?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//root?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//root?: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//root?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object resObj = *env.NewString(string(self.Root)) @@ -105297,21 +106413,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//scroll-to: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//scroll-to: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//scroll-to: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//scroll-to: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//scroll-to: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//scroll-to: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val widget.TreeNodeID { @@ -105325,11 +106441,11 @@ var Builtins = map[string]*env.Builtin{ arg1Val = natVal } else { var u string - if v, ok := arg1.(env.String); ok { - u = string(v.Value) + if vc, ok := arg1.(env.String); ok { + u = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//scroll-to: arg 2: expected string") + return env.NewError("Go(*widget.Tree)//scroll-to: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg1Val = widget.TreeNodeID(u) } @@ -105345,21 +106461,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//scroll-to-bottom: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//scroll-to-bottom: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//scroll-to-bottom: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//scroll-to-bottom: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//scroll-to-bottom: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//scroll-to-bottom: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ScrollToBottom() return arg0 @@ -105372,21 +106488,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//scroll-to-top: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//scroll-to-top: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//scroll-to-top: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//scroll-to-top: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//scroll-to-top: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//scroll-to-top: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ScrollToTop() return arg0 @@ -105399,21 +106515,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//select: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//select: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//select: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//select: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//select: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//select: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val widget.TreeNodeID { @@ -105427,11 +106543,11 @@ var Builtins = map[string]*env.Builtin{ arg1Val = natVal } else { var u string - if v, ok := arg1.(env.String); ok { - u = string(v.Value) + if vc, ok := arg1.(env.String); ok { + u = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//select: arg 2: expected string") + return env.NewError("Go(*widget.Tree)//select: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg1Val = widget.TreeNodeID(u) } @@ -105447,21 +106563,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//show: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//show: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//show: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -105474,21 +106590,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//size: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//size: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//size: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -105503,28 +106619,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//toggle-branch: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//toggle-branch: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//toggle-branch: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//toggle-branch: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//toggle-branch: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//toggle-branch: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//toggle-branch: arg 2: expected string") + return env.NewError("Go(*widget.Tree)//toggle-branch: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.ToggleBranch(arg1Val) return arg0 @@ -105537,40 +106653,40 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//typed-key: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//typed-key: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//typed-key: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//typed-key: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//typed-key: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//typed-key: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.KeyEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.KeyEvent) - if !ok { + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//typed-key: arg 2: expected native of type *fyne.KeyEvent") + return env.NewError("Go(*widget.Tree)//typed-key: arg 2: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//typed-key: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//typed-key: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//typed-key: arg 2: expected native") + return env.NewError("Go(*widget.Tree)//typed-key: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedKey(arg1Val) return arg0 @@ -105583,34 +106699,34 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//typed-rune: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//typed-rune: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//typed-rune: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//typed-rune: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//typed-rune: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//typed-rune: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val rune switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//typed-rune: arg 2: expected native of type rune") + return env.NewError("Go(*widget.Tree)//typed-rune: arg 2: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//typed-rune: arg 2: expected native") + return env.NewError("Go(*widget.Tree)//typed-rune: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedRune(arg1Val) return arg0 @@ -105623,21 +106739,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//unselect: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//unselect: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//unselect: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//unselect: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//unselect: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//unselect: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val widget.TreeNodeID { @@ -105651,11 +106767,11 @@ var Builtins = map[string]*env.Builtin{ arg1Val = natVal } else { var u string - if v, ok := arg1.(env.String); ok { - u = string(v.Value) + if vc, ok := arg1.(env.String); ok { + u = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//unselect: arg 2: expected string") + return env.NewError("Go(*widget.Tree)//unselect: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg1Val = widget.TreeNodeID(u) } @@ -105671,21 +106787,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//unselect-all: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//unselect-all: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//unselect-all: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//unselect-all: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//unselect-all: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//unselect-all: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.UnselectAll() return arg0 @@ -105698,64 +106814,49 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//update-node!: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//update-node!: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//update-node!: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//update-node!: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//update-node!: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//update-node!: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } + var newVal func(widget.TreeNodeID, bool, fyne.CanvasObject) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 3 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//update-node!: arg 2: function has invalid number of arguments (expected 3)") + return env.NewError("Go(*widget.Tree)//update-node!: arg 2: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - self.UpdateNode = func(arg0 widget.TreeNodeID, arg1 bool, arg2 fyne.CanvasObject) { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(string(arg0)) - arg1Val = *env.NewInteger(boolToInt64(arg1)) - { - typ := reflect.TypeOf(arg2) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg2Val = *env.NewNative(ps.Idx, arg2, typRyeName) - } else { - arg2Val = *env.NewNative(ps.Idx, arg2, "Go(fyne.CanvasObject)") - } - } + newVal = func(farg0 widget.TreeNodeID, farg1 bool, farg2 fyne.CanvasObject) { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(string(farg0)) + farg1Val = *env.NewInteger(boolToInt64(farg1)) + farg2Val = ifaceToNative(ps.Idx, farg2, "Go(fyne.CanvasObject)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val, farg1Val, farg2Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//update-node!: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//update-node!: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } - self.UpdateNode = nil + newVal = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//update-node!: arg 2: expected function or nil") + return env.NewError("Go(*widget.Tree)//update-node!: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } + self.UpdateNode = newVal return arg0 }, }, @@ -105766,24 +106867,81 @@ var Builtins = map[string]*env.Builtin{ var self *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - self, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + self = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//update-node?: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//update-node?: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//update-node?: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//update-node?: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } self = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//update-node?: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//update-node?: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var resObj env.Object - resObj = *env.NewNative(ps.Idx, self.UpdateNode, "Go(func(widget.TreeNodeID, bool, fyne.CanvasObject))") + resObj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val widget.TreeNodeID + { + nat, natOk := arg0.(env.Native) + var natValOk bool + var natVal widget.TreeNodeID + if natOk { + natVal, natValOk = nat.Value.(widget.TreeNodeID) + } + if natValOk { + arg0Val = natVal + } else { + var u string + if vc, ok := arg0.(env.String); ok { + u = string(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Tree)//update-node?: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) + } + arg0Val = widget.TreeNodeID(u) + } + } + var arg1Val bool + if vc, ok := arg1.(env.Integer); ok { + arg1Val = vc.Value != 0 + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Tree)//update-node?: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) + } + var arg2Val fyne.CanvasObject + switch v := arg2.(type) { + case env.RyeCtx: + var err error + arg2Val, err = ctxTo_fyne_CanvasObject(ps, v) + if err != nil { + ps.FailureFlag = true + return env.NewError("Go(*widget.Tree)//update-node?: arg 3: " + err.Error()) + } + case env.Native: + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg2Val = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(*widget.Tree)//update-node?: arg 3: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(*widget.Tree)//update-node?: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg2Val = nil + default: + ps.FailureFlag = true + return env.NewError("Go(*widget.Tree)//update-node?: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + self.UpdateNode(arg0Val, arg1Val, arg2Val) + return nil + }, 3, false, false, "Returned func") return resObj }, }, @@ -105794,21 +106952,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *widget.Tree switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*widget.Tree) - if !ok { + if vc, ok := v.Value.(*widget.Tree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//visible: arg 1: expected native of type *widget.Tree") + return env.NewError("Go(*widget.Tree)//visible: arg 1: " + "expected native of type *widget.Tree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(*widget.Tree)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(*widget.Tree)//visible: arg 1: expected native") + return env.NewError("Go(*widget.Tree)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -105827,24 +106985,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Bool(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Bool)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Bool)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Bool) - if !ok { + if vc, ok := v.Value.(binding.Bool); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Bool)//add-listener: arg 1: expected native of type binding.Bool") + return env.NewError("Go(binding.Bool)//add-listener: arg 1: " + "expected native of type binding.Bool, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Bool)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Bool)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Bool)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.Bool)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -105853,24 +107011,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Bool)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.Bool)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Bool)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.Bool)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Bool)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.Bool)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Bool)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.Bool)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -105887,24 +107045,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Bool(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Bool)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Bool)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Bool) - if !ok { + if vc, ok := v.Value.(binding.Bool); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Bool)//get: arg 1: expected native of type binding.Bool") + return env.NewError("Go(binding.Bool)//get: arg 1: " + "expected native of type binding.Bool, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Bool)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Bool)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Bool)//get: arg 1: expected native") + return env.NewError("Go(binding.Bool)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object @@ -105931,24 +107089,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Bool(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Bool)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Bool)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Bool) - if !ok { + if vc, ok := v.Value.(binding.Bool); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Bool)//remove-listener: arg 1: expected native of type binding.Bool") + return env.NewError("Go(binding.Bool)//remove-listener: arg 1: " + "expected native of type binding.Bool, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Bool)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Bool)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Bool)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.Bool)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -105957,24 +107115,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Bool)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.Bool)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Bool)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.Bool)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Bool)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.Bool)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Bool)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.Bool)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -105991,31 +107149,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Bool(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Bool)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Bool)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Bool) - if !ok { + if vc, ok := v.Value.(binding.Bool); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Bool)//set: arg 1: expected native of type binding.Bool") + return env.NewError("Go(binding.Bool)//set: arg 1: " + "expected native of type binding.Bool, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Bool)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Bool)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Bool)//set: arg 1: expected native") + return env.NewError("Go(binding.Bool)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val bool - if v, ok := arg1.(env.Integer); ok { - arg1Val = v.Value != 0 + if vc, ok := arg1.(env.Integer); ok { + arg1Val = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(binding.Bool)//set: arg 2: expected integer") + return env.NewError("Go(binding.Bool)//set: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -106040,24 +107198,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BoolList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BoolList)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BoolList) - if !ok { + if vc, ok := v.Value.(binding.BoolList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//add-listener: arg 1: expected native of type binding.BoolList") + return env.NewError("Go(binding.BoolList)//add-listener: arg 1: " + "expected native of type binding.BoolList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BoolList)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.BoolList)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -106066,24 +107224,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.BoolList)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.BoolList)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.BoolList)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.BoolList)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -106100,31 +107258,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BoolList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BoolList)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BoolList) - if !ok { + if vc, ok := v.Value.(binding.BoolList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//append: arg 1: expected native of type binding.BoolList") + return env.NewError("Go(binding.BoolList)//append: arg 1: " + "expected native of type binding.BoolList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BoolList)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//append: arg 1: expected native") + return env.NewError("Go(binding.BoolList)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val bool - if v, ok := arg1.(env.Integer); ok { - arg1Val = v.Value != 0 + if vc, ok := arg1.(env.Integer); ok { + arg1Val = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//append: arg 2: expected integer") + return env.NewError("Go(binding.BoolList)//append: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } resErr := arg0Val.Append(arg1Val) var resErrObj env.Object @@ -106149,24 +107307,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BoolList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BoolList)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BoolList) - if !ok { + if vc, ok := v.Value.(binding.BoolList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//get: arg 1: expected native of type binding.BoolList") + return env.NewError("Go(binding.BoolList)//get: arg 1: " + "expected native of type binding.BoolList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BoolList)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//get: arg 1: expected native") + return env.NewError("Go(binding.BoolList)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object @@ -106199,52 +107357,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BoolList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BoolList)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BoolList) - if !ok { + if vc, ok := v.Value.(binding.BoolList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//get-item: arg 1: expected native of type binding.BoolList") + return env.NewError("Go(binding.BoolList)//get-item: arg 1: " + "expected native of type binding.BoolList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BoolList)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//get-item: arg 1: expected native") + return env.NewError("Go(binding.BoolList)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//get-item: arg 2: expected integer") + return env.NewError("Go(binding.BoolList)//get-item: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -106267,31 +107408,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BoolList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BoolList)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BoolList) - if !ok { + if vc, ok := v.Value.(binding.BoolList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//get-value: arg 1: expected native of type binding.BoolList") + return env.NewError("Go(binding.BoolList)//get-value: arg 1: " + "expected native of type binding.BoolList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BoolList)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//get-value: arg 1: expected native") + return env.NewError("Go(binding.BoolList)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//get-value: arg 2: expected integer") + return env.NewError("Go(binding.BoolList)//get-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object @@ -106318,24 +107459,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BoolList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//length: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BoolList)//length: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BoolList) - if !ok { + if vc, ok := v.Value.(binding.BoolList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//length: arg 1: expected native of type binding.BoolList") + return env.NewError("Go(binding.BoolList)//length: arg 1: " + "expected native of type binding.BoolList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//length: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BoolList)//length: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//length: arg 1: expected native") + return env.NewError("Go(binding.BoolList)//length: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Length() var res0Obj env.Object @@ -106354,31 +107495,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BoolList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BoolList)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BoolList) - if !ok { + if vc, ok := v.Value.(binding.BoolList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//prepend: arg 1: expected native of type binding.BoolList") + return env.NewError("Go(binding.BoolList)//prepend: arg 1: " + "expected native of type binding.BoolList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BoolList)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//prepend: arg 1: expected native") + return env.NewError("Go(binding.BoolList)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val bool - if v, ok := arg1.(env.Integer); ok { - arg1Val = v.Value != 0 + if vc, ok := arg1.(env.Integer); ok { + arg1Val = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//prepend: arg 2: expected integer") + return env.NewError("Go(binding.BoolList)//prepend: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } resErr := arg0Val.Prepend(arg1Val) var resErrObj env.Object @@ -106403,24 +107544,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BoolList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BoolList)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BoolList) - if !ok { + if vc, ok := v.Value.(binding.BoolList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//remove-listener: arg 1: expected native of type binding.BoolList") + return env.NewError("Go(binding.BoolList)//remove-listener: arg 1: " + "expected native of type binding.BoolList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BoolList)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.BoolList)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -106429,24 +107570,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.BoolList)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.BoolList)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.BoolList)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.BoolList)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -106463,53 +107604,46 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BoolList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BoolList)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BoolList) - if !ok { + if vc, ok := v.Value.(binding.BoolList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//set: arg 1: expected native of type binding.BoolList") + return env.NewError("Go(binding.BoolList)//set: arg 1: " + "expected native of type binding.BoolList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BoolList)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//set: arg 1: expected native") + return env.NewError("Go(binding.BoolList)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []bool switch v := arg1.(type) { case env.Block: arg1Val = make([]bool, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.Integer); ok { - arg1Val[i] = v.Value != 0 + if vc, ok := it.(env.Integer); ok { + arg1Val[i] = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//set: arg 2: block item: expected integer") + return env.NewError("Go(binding.BoolList)//set: arg 2: " + "block item: " + "expected integer, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]bool) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//set: arg 2: expected native of type []bool") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.BoolList)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//set: arg 2: expected block, native or nil") + return env.NewError("Go(binding.BoolList)//set: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -106534,38 +107668,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BoolList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BoolList)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BoolList) - if !ok { + if vc, ok := v.Value.(binding.BoolList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//set-value: arg 1: expected native of type binding.BoolList") + return env.NewError("Go(binding.BoolList)//set-value: arg 1: " + "expected native of type binding.BoolList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BoolList)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//set-value: arg 1: expected native") + return env.NewError("Go(binding.BoolList)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//set-value: arg 2: expected integer") + return env.NewError("Go(binding.BoolList)//set-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val bool - if v, ok := arg2.(env.Integer); ok { - arg2Val = v.Value != 0 + if vc, ok := arg2.(env.Integer); ok { + arg2Val = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolList)//set-value: arg 3: expected integer") + return env.NewError("Go(binding.BoolList)//set-value: arg 3: " + "expected integer, but got " + objectDebugString(ps.Idx, arg2)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -106590,24 +107724,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BoolTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BoolTree)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BoolTree) - if !ok { + if vc, ok := v.Value.(binding.BoolTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//add-listener: arg 1: expected native of type binding.BoolTree") + return env.NewError("Go(binding.BoolTree)//add-listener: arg 1: " + "expected native of type binding.BoolTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BoolTree)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.BoolTree)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -106616,24 +107750,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.BoolTree)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.BoolTree)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.BoolTree)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.BoolTree)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -106650,45 +107784,45 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BoolTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BoolTree)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BoolTree) - if !ok { + if vc, ok := v.Value.(binding.BoolTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//append: arg 1: expected native of type binding.BoolTree") + return env.NewError("Go(binding.BoolTree)//append: arg 1: " + "expected native of type binding.BoolTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BoolTree)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//append: arg 1: expected native") + return env.NewError("Go(binding.BoolTree)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//append: arg 2: expected string") + return env.NewError("Go(binding.BoolTree)//append: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//append: arg 3: expected string") + return env.NewError("Go(binding.BoolTree)//append: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val bool - if v, ok := arg3.(env.Integer); ok { - arg3Val = v.Value != 0 + if vc, ok := arg3.(env.Integer); ok { + arg3Val = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//append: arg 4: expected integer") + return env.NewError("Go(binding.BoolTree)//append: arg 4: " + "expected integer, but got " + objectDebugString(ps.Idx, arg3)) } resErr := arg0Val.Append(arg1Val, arg2Val, arg3Val) var resErrObj env.Object @@ -106713,31 +107847,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BoolTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//child-i-ds: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BoolTree)//child-i-ds: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BoolTree) - if !ok { + if vc, ok := v.Value.(binding.BoolTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//child-i-ds: arg 1: expected native of type binding.BoolTree") + return env.NewError("Go(binding.BoolTree)//child-i-ds: arg 1: " + "expected native of type binding.BoolTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//child-i-ds: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BoolTree)//child-i-ds: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//child-i-ds: arg 1: expected native") + return env.NewError("Go(binding.BoolTree)//child-i-ds: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//child-i-ds: arg 2: expected string") + return env.NewError("Go(binding.BoolTree)//child-i-ds: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := arg0Val.ChildIDs(arg1Val) var res0Obj env.Object @@ -106762,24 +107896,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BoolTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BoolTree)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BoolTree) - if !ok { + if vc, ok := v.Value.(binding.BoolTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//get: arg 1: expected native of type binding.BoolTree") + return env.NewError("Go(binding.BoolTree)//get: arg 1: " + "expected native of type binding.BoolTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BoolTree)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//get: arg 1: expected native") + return env.NewError("Go(binding.BoolTree)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, res1, resErr := arg0Val.Get() var res0Obj env.Object @@ -106833,52 +107967,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BoolTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BoolTree)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BoolTree) - if !ok { + if vc, ok := v.Value.(binding.BoolTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//get-item: arg 1: expected native of type binding.BoolTree") + return env.NewError("Go(binding.BoolTree)//get-item: arg 1: " + "expected native of type binding.BoolTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BoolTree)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//get-item: arg 1: expected native") + return env.NewError("Go(binding.BoolTree)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//get-item: arg 2: expected string") + return env.NewError("Go(binding.BoolTree)//get-item: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -106901,31 +108018,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BoolTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BoolTree)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BoolTree) - if !ok { + if vc, ok := v.Value.(binding.BoolTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//get-value: arg 1: expected native of type binding.BoolTree") + return env.NewError("Go(binding.BoolTree)//get-value: arg 1: " + "expected native of type binding.BoolTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BoolTree)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//get-value: arg 1: expected native") + return env.NewError("Go(binding.BoolTree)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//get-value: arg 2: expected string") + return env.NewError("Go(binding.BoolTree)//get-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object @@ -106952,45 +108069,45 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BoolTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BoolTree)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BoolTree) - if !ok { + if vc, ok := v.Value.(binding.BoolTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//prepend: arg 1: expected native of type binding.BoolTree") + return env.NewError("Go(binding.BoolTree)//prepend: arg 1: " + "expected native of type binding.BoolTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BoolTree)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//prepend: arg 1: expected native") + return env.NewError("Go(binding.BoolTree)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//prepend: arg 2: expected string") + return env.NewError("Go(binding.BoolTree)//prepend: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//prepend: arg 3: expected string") + return env.NewError("Go(binding.BoolTree)//prepend: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val bool - if v, ok := arg3.(env.Integer); ok { - arg3Val = v.Value != 0 + if vc, ok := arg3.(env.Integer); ok { + arg3Val = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//prepend: arg 4: expected integer") + return env.NewError("Go(binding.BoolTree)//prepend: arg 4: " + "expected integer, but got " + objectDebugString(ps.Idx, arg3)) } resErr := arg0Val.Prepend(arg1Val, arg2Val, arg3Val) var resErrObj env.Object @@ -107015,24 +108132,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BoolTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BoolTree)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BoolTree) - if !ok { + if vc, ok := v.Value.(binding.BoolTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//remove-listener: arg 1: expected native of type binding.BoolTree") + return env.NewError("Go(binding.BoolTree)//remove-listener: arg 1: " + "expected native of type binding.BoolTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BoolTree)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.BoolTree)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -107041,24 +108158,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.BoolTree)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.BoolTree)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.BoolTree)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.BoolTree)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -107075,69 +108192,62 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BoolTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BoolTree)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BoolTree) - if !ok { + if vc, ok := v.Value.(binding.BoolTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set: arg 1: expected native of type binding.BoolTree") + return env.NewError("Go(binding.BoolTree)//set: arg 1: " + "expected native of type binding.BoolTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BoolTree)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set: arg 1: expected native") + return env.NewError("Go(binding.BoolTree)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val map[string][]string switch v := arg1.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set: arg 2: expected block to have length of multiple of 2") + return env.NewError("Go(binding.BoolTree)//set: arg 2: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } arg1Val = make(map[string][]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set: arg 2: map key: expected string") + return env.NewError("Go(binding.BoolTree)//set: arg 2: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV []string switch v := v.Series.S[i+1].(type) { case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set: arg 2: map value: block item: expected string") + return env.NewError("Go(binding.BoolTree)//set: arg 2: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set: arg 2: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set: arg 2: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.BoolTree)//set: arg 2: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set: arg 2: map value: expected block, native or nil") + return env.NewError("Go(binding.BoolTree)//set: arg 2: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } @@ -107150,71 +108260,57 @@ var Builtins = map[string]*env.Builtin{ case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set: arg 2: map value: block item: expected string") + return env.NewError("Go(binding.BoolTree)//set: arg 2: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set: arg 2: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set: arg 2: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.BoolTree)//set: arg 2: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set: arg 2: map value: expected block, native or nil") + return env.NewError("Go(binding.BoolTree)//set: arg 2: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } - case env.Native: - var ok bool - arg1Val, ok = v.Value.(map[string][]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set: arg 2: expected native of type map[string][]string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.BoolTree)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set: arg 2: expected native, block, dict or nil") + return env.NewError("Go(binding.BoolTree)//set: arg 2: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } var arg2Val map[string]bool switch v := arg2.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set: arg 3: expected block to have length of multiple of 2") + return env.NewError("Go(binding.BoolTree)//set: arg 3: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } arg2Val = make(map[string]bool, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set: arg 3: map key: expected string") + return env.NewError("Go(binding.BoolTree)//set: arg 3: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV bool - if v, ok := v.Series.S[i+1].(env.Integer); ok { - mapV = v.Value != 0 + if vc, ok := v.Series.S[i+1].(env.Integer); ok { + mapV = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set: arg 3: map value: expected integer") + return env.NewError("Go(binding.BoolTree)//set: arg 3: " + "map value: " + "expected integer, but got " + objectDebugString(ps.Idx, v.Series.S[i+1])) } arg2Val[mapK] = mapV } @@ -107223,30 +108319,23 @@ var Builtins = map[string]*env.Builtin{ for dictK, dictV := range v.Data { mapK := dictK var mapV bool - if v, ok := dictV.(env.Integer); ok { - mapV = v.Value != 0 + if vc, ok := dictV.(env.Integer); ok { + mapV = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set: arg 3: map value: expected integer") + return env.NewError("Go(binding.BoolTree)//set: arg 3: " + "map value: " + "expected integer, but got " + objectDebugString(ps.Idx, dictV)) } arg2Val[mapK] = mapV } - case env.Native: - var ok bool - arg2Val, ok = v.Value.(map[string]bool) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set: arg 3: expected native of type map[string]bool") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(binding.BoolTree)//set: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set: arg 3: expected native, block, dict or nil") + return env.NewError("Go(binding.BoolTree)//set: arg 3: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val, arg2Val) var resErrObj env.Object @@ -107271,38 +108360,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BoolTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BoolTree)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BoolTree) - if !ok { + if vc, ok := v.Value.(binding.BoolTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set-value: arg 1: expected native of type binding.BoolTree") + return env.NewError("Go(binding.BoolTree)//set-value: arg 1: " + "expected native of type binding.BoolTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BoolTree)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set-value: arg 1: expected native") + return env.NewError("Go(binding.BoolTree)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set-value: arg 2: expected string") + return env.NewError("Go(binding.BoolTree)//set-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val bool - if v, ok := arg2.(env.Integer); ok { - arg2Val = v.Value != 0 + if vc, ok := arg2.(env.Integer); ok { + arg2Val = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(binding.BoolTree)//set-value: arg 3: expected integer") + return env.NewError("Go(binding.BoolTree)//set-value: arg 3: " + "expected integer, but got " + objectDebugString(ps.Idx, arg2)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -107327,24 +108416,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Bytes(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Bytes)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Bytes)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Bytes) - if !ok { + if vc, ok := v.Value.(binding.Bytes); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Bytes)//add-listener: arg 1: expected native of type binding.Bytes") + return env.NewError("Go(binding.Bytes)//add-listener: arg 1: " + "expected native of type binding.Bytes, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Bytes)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Bytes)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Bytes)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.Bytes)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -107353,24 +108442,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Bytes)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.Bytes)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Bytes)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.Bytes)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Bytes)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.Bytes)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Bytes)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.Bytes)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -107387,24 +108476,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Bytes(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Bytes)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Bytes)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Bytes) - if !ok { + if vc, ok := v.Value.(binding.Bytes); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Bytes)//get: arg 1: expected native of type binding.Bytes") + return env.NewError("Go(binding.Bytes)//get: arg 1: " + "expected native of type binding.Bytes, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Bytes)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Bytes)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Bytes)//get: arg 1: expected native") + return env.NewError("Go(binding.Bytes)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object @@ -107437,24 +108526,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Bytes(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Bytes)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Bytes)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Bytes) - if !ok { + if vc, ok := v.Value.(binding.Bytes); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Bytes)//remove-listener: arg 1: expected native of type binding.Bytes") + return env.NewError("Go(binding.Bytes)//remove-listener: arg 1: " + "expected native of type binding.Bytes, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Bytes)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Bytes)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Bytes)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.Bytes)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -107463,24 +108552,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Bytes)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.Bytes)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Bytes)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.Bytes)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Bytes)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.Bytes)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Bytes)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.Bytes)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -107497,24 +108586,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Bytes(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Bytes)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Bytes)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Bytes) - if !ok { + if vc, ok := v.Value.(binding.Bytes); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Bytes)//set: arg 1: expected native of type binding.Bytes") + return env.NewError("Go(binding.Bytes)//set: arg 1: " + "expected native of type binding.Bytes, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Bytes)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Bytes)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Bytes)//set: arg 1: expected native") + return env.NewError("Go(binding.Bytes)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []byte switch v := arg1.(type) { @@ -107523,33 +108612,26 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg1Val[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + arg1Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Bytes)//set: arg 2: block item: expected native of type byte") + return env.NewError("Go(binding.Bytes)//set: arg 2: " + "block item: " + "expected native of type byte, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.Bytes)//set: arg 2: block item: expected native") + return env.NewError("Go(binding.Bytes)//set: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]byte) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.Bytes)//set: arg 2: expected native of type []byte") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Bytes)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.Bytes)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Bytes)//set: arg 2: expected block, native or nil") + return env.NewError("Go(binding.Bytes)//set: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -107574,24 +108656,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BytesList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BytesList)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BytesList) - if !ok { + if vc, ok := v.Value.(binding.BytesList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//add-listener: arg 1: expected native of type binding.BytesList") + return env.NewError("Go(binding.BytesList)//add-listener: arg 1: " + "expected native of type binding.BytesList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesList)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.BytesList)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -107600,24 +108682,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.BytesList)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.BytesList)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesList)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.BytesList)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -107634,24 +108716,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BytesList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BytesList)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BytesList) - if !ok { + if vc, ok := v.Value.(binding.BytesList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//append: arg 1: expected native of type binding.BytesList") + return env.NewError("Go(binding.BytesList)//append: arg 1: " + "expected native of type binding.BytesList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesList)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//append: arg 1: expected native") + return env.NewError("Go(binding.BytesList)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []byte switch v := arg1.(type) { @@ -107660,33 +108742,26 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg1Val[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + arg1Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//append: arg 2: block item: expected native of type byte") + return env.NewError("Go(binding.BytesList)//append: arg 2: " + "block item: " + "expected native of type byte, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//append: arg 2: block item: expected native") + return env.NewError("Go(binding.BytesList)//append: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]byte) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//append: arg 2: expected native of type []byte") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//append: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesList)//append: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//append: arg 2: expected block, native or nil") + return env.NewError("Go(binding.BytesList)//append: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Append(arg1Val) var resErrObj env.Object @@ -107711,24 +108786,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BytesList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BytesList)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BytesList) - if !ok { + if vc, ok := v.Value.(binding.BytesList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//get: arg 1: expected native of type binding.BytesList") + return env.NewError("Go(binding.BytesList)//get: arg 1: " + "expected native of type binding.BytesList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesList)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//get: arg 1: expected native") + return env.NewError("Go(binding.BytesList)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object @@ -107767,52 +108842,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BytesList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BytesList)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BytesList) - if !ok { + if vc, ok := v.Value.(binding.BytesList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//get-item: arg 1: expected native of type binding.BytesList") + return env.NewError("Go(binding.BytesList)//get-item: arg 1: " + "expected native of type binding.BytesList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesList)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//get-item: arg 1: expected native") + return env.NewError("Go(binding.BytesList)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//get-item: arg 2: expected integer") + return env.NewError("Go(binding.BytesList)//get-item: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -107835,31 +108893,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BytesList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BytesList)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BytesList) - if !ok { + if vc, ok := v.Value.(binding.BytesList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//get-value: arg 1: expected native of type binding.BytesList") + return env.NewError("Go(binding.BytesList)//get-value: arg 1: " + "expected native of type binding.BytesList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesList)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//get-value: arg 1: expected native") + return env.NewError("Go(binding.BytesList)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//get-value: arg 2: expected integer") + return env.NewError("Go(binding.BytesList)//get-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object @@ -107892,24 +108950,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BytesList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//length: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BytesList)//length: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BytesList) - if !ok { + if vc, ok := v.Value.(binding.BytesList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//length: arg 1: expected native of type binding.BytesList") + return env.NewError("Go(binding.BytesList)//length: arg 1: " + "expected native of type binding.BytesList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//length: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesList)//length: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//length: arg 1: expected native") + return env.NewError("Go(binding.BytesList)//length: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Length() var res0Obj env.Object @@ -107928,24 +108986,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BytesList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BytesList)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BytesList) - if !ok { + if vc, ok := v.Value.(binding.BytesList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//prepend: arg 1: expected native of type binding.BytesList") + return env.NewError("Go(binding.BytesList)//prepend: arg 1: " + "expected native of type binding.BytesList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesList)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//prepend: arg 1: expected native") + return env.NewError("Go(binding.BytesList)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []byte switch v := arg1.(type) { @@ -107954,33 +109012,26 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg1Val[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + arg1Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//prepend: arg 2: block item: expected native of type byte") + return env.NewError("Go(binding.BytesList)//prepend: arg 2: " + "block item: " + "expected native of type byte, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//prepend: arg 2: block item: expected native") + return env.NewError("Go(binding.BytesList)//prepend: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]byte) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//prepend: arg 2: expected native of type []byte") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//prepend: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesList)//prepend: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//prepend: arg 2: expected block, native or nil") + return env.NewError("Go(binding.BytesList)//prepend: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Prepend(arg1Val) var resErrObj env.Object @@ -108005,24 +109056,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BytesList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BytesList)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BytesList) - if !ok { + if vc, ok := v.Value.(binding.BytesList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//remove-listener: arg 1: expected native of type binding.BytesList") + return env.NewError("Go(binding.BytesList)//remove-listener: arg 1: " + "expected native of type binding.BytesList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesList)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.BytesList)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -108031,24 +109082,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.BytesList)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.BytesList)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesList)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.BytesList)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -108065,24 +109116,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BytesList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BytesList)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BytesList) - if !ok { + if vc, ok := v.Value.(binding.BytesList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//set: arg 1: expected native of type binding.BytesList") + return env.NewError("Go(binding.BytesList)//set: arg 1: " + "expected native of type binding.BytesList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesList)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//set: arg 1: expected native") + return env.NewError("Go(binding.BytesList)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val [][]byte switch v := arg1.(type) { @@ -108095,51 +109146,37 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg1Val[i][i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + arg1Val[i][i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//set: arg 2: block item: block item: expected native of type byte") + return env.NewError("Go(binding.BytesList)//set: arg 2: " + "block item: " + "block item: " + "expected native of type byte, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//set: arg 2: block item: block item: expected native") + return env.NewError("Go(binding.BytesList)//set: arg 2: " + "block item: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val[i], ok = v.Value.([]byte) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//set: arg 2: block item: expected native of type []byte") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//set: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesList)//set: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val[i] = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//set: arg 2: block item: expected block, native or nil") + return env.NewError("Go(binding.BytesList)//set: arg 2: " + "block item: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([][]byte) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//set: arg 2: expected native of type [][]byte") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesList)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//set: arg 2: expected block, native or nil") + return env.NewError("Go(binding.BytesList)//set: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -108164,31 +109201,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BytesList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BytesList)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BytesList) - if !ok { + if vc, ok := v.Value.(binding.BytesList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//set-value: arg 1: expected native of type binding.BytesList") + return env.NewError("Go(binding.BytesList)//set-value: arg 1: " + "expected native of type binding.BytesList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesList)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//set-value: arg 1: expected native") + return env.NewError("Go(binding.BytesList)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//set-value: arg 2: expected integer") + return env.NewError("Go(binding.BytesList)//set-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val []byte switch v := arg2.(type) { @@ -108197,33 +109234,26 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg2Val[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + arg2Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//set-value: arg 3: block item: expected native of type byte") + return env.NewError("Go(binding.BytesList)//set-value: arg 3: " + "block item: " + "expected native of type byte, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//set-value: arg 3: block item: expected native") + return env.NewError("Go(binding.BytesList)//set-value: arg 3: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg2Val, ok = v.Value.([]byte) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//set-value: arg 3: expected native of type []byte") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//set-value: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesList)//set-value: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesList)//set-value: arg 3: expected block, native or nil") + return env.NewError("Go(binding.BytesList)//set-value: arg 3: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -108248,24 +109278,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BytesTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BytesTree)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BytesTree) - if !ok { + if vc, ok := v.Value.(binding.BytesTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//add-listener: arg 1: expected native of type binding.BytesTree") + return env.NewError("Go(binding.BytesTree)//add-listener: arg 1: " + "expected native of type binding.BytesTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesTree)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.BytesTree)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -108274,24 +109304,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.BytesTree)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.BytesTree)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesTree)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.BytesTree)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -108308,38 +109338,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BytesTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BytesTree)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BytesTree) - if !ok { + if vc, ok := v.Value.(binding.BytesTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//append: arg 1: expected native of type binding.BytesTree") + return env.NewError("Go(binding.BytesTree)//append: arg 1: " + "expected native of type binding.BytesTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesTree)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//append: arg 1: expected native") + return env.NewError("Go(binding.BytesTree)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//append: arg 2: expected string") + return env.NewError("Go(binding.BytesTree)//append: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//append: arg 3: expected string") + return env.NewError("Go(binding.BytesTree)//append: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val []byte switch v := arg3.(type) { @@ -108348,33 +109378,26 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg3Val[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + arg3Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//append: arg 4: block item: expected native of type byte") + return env.NewError("Go(binding.BytesTree)//append: arg 4: " + "block item: " + "expected native of type byte, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//append: arg 4: block item: expected native") + return env.NewError("Go(binding.BytesTree)//append: arg 4: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg3Val, ok = v.Value.([]byte) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//append: arg 4: expected native of type []byte") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//append: arg 4: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesTree)//append: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//append: arg 4: expected block, native or nil") + return env.NewError("Go(binding.BytesTree)//append: arg 4: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Append(arg1Val, arg2Val, arg3Val) var resErrObj env.Object @@ -108399,31 +109422,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BytesTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//child-i-ds: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BytesTree)//child-i-ds: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BytesTree) - if !ok { + if vc, ok := v.Value.(binding.BytesTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//child-i-ds: arg 1: expected native of type binding.BytesTree") + return env.NewError("Go(binding.BytesTree)//child-i-ds: arg 1: " + "expected native of type binding.BytesTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//child-i-ds: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesTree)//child-i-ds: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//child-i-ds: arg 1: expected native") + return env.NewError("Go(binding.BytesTree)//child-i-ds: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//child-i-ds: arg 2: expected string") + return env.NewError("Go(binding.BytesTree)//child-i-ds: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := arg0Val.ChildIDs(arg1Val) var res0Obj env.Object @@ -108448,24 +109471,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BytesTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BytesTree)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BytesTree) - if !ok { + if vc, ok := v.Value.(binding.BytesTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//get: arg 1: expected native of type binding.BytesTree") + return env.NewError("Go(binding.BytesTree)//get: arg 1: " + "expected native of type binding.BytesTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesTree)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//get: arg 1: expected native") + return env.NewError("Go(binding.BytesTree)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, res1, resErr := arg0Val.Get() var res0Obj env.Object @@ -108525,52 +109548,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BytesTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BytesTree)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BytesTree) - if !ok { + if vc, ok := v.Value.(binding.BytesTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//get-item: arg 1: expected native of type binding.BytesTree") + return env.NewError("Go(binding.BytesTree)//get-item: arg 1: " + "expected native of type binding.BytesTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesTree)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//get-item: arg 1: expected native") + return env.NewError("Go(binding.BytesTree)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//get-item: arg 2: expected string") + return env.NewError("Go(binding.BytesTree)//get-item: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -108593,31 +109599,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BytesTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BytesTree)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BytesTree) - if !ok { + if vc, ok := v.Value.(binding.BytesTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//get-value: arg 1: expected native of type binding.BytesTree") + return env.NewError("Go(binding.BytesTree)//get-value: arg 1: " + "expected native of type binding.BytesTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesTree)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//get-value: arg 1: expected native") + return env.NewError("Go(binding.BytesTree)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//get-value: arg 2: expected string") + return env.NewError("Go(binding.BytesTree)//get-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object @@ -108650,38 +109656,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BytesTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BytesTree)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BytesTree) - if !ok { + if vc, ok := v.Value.(binding.BytesTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//prepend: arg 1: expected native of type binding.BytesTree") + return env.NewError("Go(binding.BytesTree)//prepend: arg 1: " + "expected native of type binding.BytesTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesTree)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//prepend: arg 1: expected native") + return env.NewError("Go(binding.BytesTree)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//prepend: arg 2: expected string") + return env.NewError("Go(binding.BytesTree)//prepend: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//prepend: arg 3: expected string") + return env.NewError("Go(binding.BytesTree)//prepend: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val []byte switch v := arg3.(type) { @@ -108690,33 +109696,26 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg3Val[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + arg3Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//prepend: arg 4: block item: expected native of type byte") + return env.NewError("Go(binding.BytesTree)//prepend: arg 4: " + "block item: " + "expected native of type byte, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//prepend: arg 4: block item: expected native") + return env.NewError("Go(binding.BytesTree)//prepend: arg 4: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg3Val, ok = v.Value.([]byte) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//prepend: arg 4: expected native of type []byte") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//prepend: arg 4: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesTree)//prepend: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//prepend: arg 4: expected block, native or nil") + return env.NewError("Go(binding.BytesTree)//prepend: arg 4: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Prepend(arg1Val, arg2Val, arg3Val) var resErrObj env.Object @@ -108741,24 +109740,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BytesTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BytesTree)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BytesTree) - if !ok { + if vc, ok := v.Value.(binding.BytesTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//remove-listener: arg 1: expected native of type binding.BytesTree") + return env.NewError("Go(binding.BytesTree)//remove-listener: arg 1: " + "expected native of type binding.BytesTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesTree)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.BytesTree)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -108767,24 +109766,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.BytesTree)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.BytesTree)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesTree)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.BytesTree)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -108801,69 +109800,62 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BytesTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BytesTree)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BytesTree) - if !ok { + if vc, ok := v.Value.(binding.BytesTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 1: expected native of type binding.BytesTree") + return env.NewError("Go(binding.BytesTree)//set: arg 1: " + "expected native of type binding.BytesTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesTree)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 1: expected native") + return env.NewError("Go(binding.BytesTree)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val map[string][]string switch v := arg1.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 2: expected block to have length of multiple of 2") + return env.NewError("Go(binding.BytesTree)//set: arg 2: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } arg1Val = make(map[string][]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 2: map key: expected string") + return env.NewError("Go(binding.BytesTree)//set: arg 2: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV []string switch v := v.Series.S[i+1].(type) { case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 2: map value: block item: expected string") + return env.NewError("Go(binding.BytesTree)//set: arg 2: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 2: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 2: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesTree)//set: arg 2: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 2: map value: expected block, native or nil") + return env.NewError("Go(binding.BytesTree)//set: arg 2: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } @@ -108876,64 +109868,50 @@ var Builtins = map[string]*env.Builtin{ case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 2: map value: block item: expected string") + return env.NewError("Go(binding.BytesTree)//set: arg 2: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 2: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 2: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesTree)//set: arg 2: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 2: map value: expected block, native or nil") + return env.NewError("Go(binding.BytesTree)//set: arg 2: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } - case env.Native: - var ok bool - arg1Val, ok = v.Value.(map[string][]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 2: expected native of type map[string][]string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesTree)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 2: expected native, block, dict or nil") + return env.NewError("Go(binding.BytesTree)//set: arg 2: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } var arg2Val map[string][]byte switch v := arg2.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 3: expected block to have length of multiple of 2") + return env.NewError("Go(binding.BytesTree)//set: arg 3: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } arg2Val = make(map[string][]byte, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 3: map key: expected string") + return env.NewError("Go(binding.BytesTree)//set: arg 3: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV []byte switch v := v.Series.S[i+1].(type) { @@ -108942,33 +109920,26 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - mapV[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + mapV[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 3: map value: block item: expected native of type byte") + return env.NewError("Go(binding.BytesTree)//set: arg 3: " + "map value: " + "block item: " + "expected native of type byte, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 3: map value: block item: expected native") + return env.NewError("Go(binding.BytesTree)//set: arg 3: " + "map value: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]byte) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 3: map value: expected native of type []byte") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 3: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesTree)//set: arg 3: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 3: map value: expected block, native or nil") + return env.NewError("Go(binding.BytesTree)//set: arg 3: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg2Val[mapK] = mapV } @@ -108983,52 +109954,38 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - mapV[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + mapV[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 3: map value: block item: expected native of type byte") + return env.NewError("Go(binding.BytesTree)//set: arg 3: " + "map value: " + "block item: " + "expected native of type byte, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 3: map value: block item: expected native") + return env.NewError("Go(binding.BytesTree)//set: arg 3: " + "map value: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]byte) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 3: map value: expected native of type []byte") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 3: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesTree)//set: arg 3: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 3: map value: expected block, native or nil") + return env.NewError("Go(binding.BytesTree)//set: arg 3: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg2Val[mapK] = mapV } - case env.Native: - var ok bool - arg2Val, ok = v.Value.(map[string][]byte) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 3: expected native of type map[string][]byte") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesTree)//set: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set: arg 3: expected native, block, dict or nil") + return env.NewError("Go(binding.BytesTree)//set: arg 3: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val, arg2Val) var resErrObj env.Object @@ -109053,31 +110010,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_BytesTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.BytesTree)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.BytesTree) - if !ok { + if vc, ok := v.Value.(binding.BytesTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set-value: arg 1: expected native of type binding.BytesTree") + return env.NewError("Go(binding.BytesTree)//set-value: arg 1: " + "expected native of type binding.BytesTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesTree)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set-value: arg 1: expected native") + return env.NewError("Go(binding.BytesTree)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set-value: arg 2: expected string") + return env.NewError("Go(binding.BytesTree)//set-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val []byte switch v := arg2.(type) { @@ -109086,33 +110043,26 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg2Val[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + arg2Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set-value: arg 3: block item: expected native of type byte") + return env.NewError("Go(binding.BytesTree)//set-value: arg 3: " + "block item: " + "expected native of type byte, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set-value: arg 3: block item: expected native") + return env.NewError("Go(binding.BytesTree)//set-value: arg 3: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg2Val, ok = v.Value.([]byte) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set-value: arg 3: expected native of type []byte") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set-value: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(binding.BytesTree)//set-value: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.BytesTree)//set-value: arg 3: expected block, native or nil") + return env.NewError("Go(binding.BytesTree)//set-value: arg 3: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -109137,24 +110087,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_DataItem(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.DataItem)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.DataItem)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.DataItem)//add-listener: arg 1: expected native of type binding.DataItem") + return env.NewError("Go(binding.DataItem)//add-listener: arg 1: " + "expected native of type binding.DataItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.DataItem)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.DataItem)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.DataItem)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.DataItem)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -109163,24 +110113,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.DataItem)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.DataItem)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.DataItem)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.DataItem)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.DataItem)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.DataItem)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.DataItem)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.DataItem)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -109197,24 +110147,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_DataItem(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.DataItem)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.DataItem)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.DataItem)//remove-listener: arg 1: expected native of type binding.DataItem") + return env.NewError("Go(binding.DataItem)//remove-listener: arg 1: " + "expected native of type binding.DataItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.DataItem)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.DataItem)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.DataItem)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.DataItem)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -109223,24 +110173,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.DataItem)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.DataItem)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.DataItem)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.DataItem)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.DataItem)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.DataItem)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.DataItem)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.DataItem)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -109257,24 +110207,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_DataList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.DataList)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.DataList)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.DataList) - if !ok { + if vc, ok := v.Value.(binding.DataList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.DataList)//add-listener: arg 1: expected native of type binding.DataList") + return env.NewError("Go(binding.DataList)//add-listener: arg 1: " + "expected native of type binding.DataList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.DataList)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.DataList)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.DataList)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.DataList)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -109283,24 +110233,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.DataList)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.DataList)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.DataList)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.DataList)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.DataList)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.DataList)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.DataList)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.DataList)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -109317,52 +110267,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_DataList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.DataList)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.DataList)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.DataList) - if !ok { + if vc, ok := v.Value.(binding.DataList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.DataList)//get-item: arg 1: expected native of type binding.DataList") + return env.NewError("Go(binding.DataList)//get-item: arg 1: " + "expected native of type binding.DataList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.DataList)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.DataList)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.DataList)//get-item: arg 1: expected native") + return env.NewError("Go(binding.DataList)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.DataList)//get-item: arg 2: expected integer") + return env.NewError("Go(binding.DataList)//get-item: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -109385,24 +110318,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_DataList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.DataList)//length: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.DataList)//length: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.DataList) - if !ok { + if vc, ok := v.Value.(binding.DataList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.DataList)//length: arg 1: expected native of type binding.DataList") + return env.NewError("Go(binding.DataList)//length: arg 1: " + "expected native of type binding.DataList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.DataList)//length: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.DataList)//length: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.DataList)//length: arg 1: expected native") + return env.NewError("Go(binding.DataList)//length: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Length() var res0Obj env.Object @@ -109421,24 +110354,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_DataList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.DataList)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.DataList)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.DataList) - if !ok { + if vc, ok := v.Value.(binding.DataList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.DataList)//remove-listener: arg 1: expected native of type binding.DataList") + return env.NewError("Go(binding.DataList)//remove-listener: arg 1: " + "expected native of type binding.DataList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.DataList)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.DataList)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.DataList)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.DataList)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -109447,24 +110380,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.DataList)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.DataList)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.DataList)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.DataList)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.DataList)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.DataList)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.DataList)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.DataList)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -109481,24 +110414,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.DataListener)//data-changed: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.DataListener)//data-changed: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.DataListener)//data-changed: arg 1: expected native of type binding.DataListener") + return env.NewError("Go(binding.DataListener)//data-changed: arg 1: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.DataListener)//data-changed: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.DataListener)//data-changed: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.DataListener)//data-changed: arg 1: expected native") + return env.NewError("Go(binding.DataListener)//data-changed: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.DataChanged() return arg0 @@ -109515,24 +110448,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_DataMap(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.DataMap)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.DataMap)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.DataMap) - if !ok { + if vc, ok := v.Value.(binding.DataMap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.DataMap)//add-listener: arg 1: expected native of type binding.DataMap") + return env.NewError("Go(binding.DataMap)//add-listener: arg 1: " + "expected native of type binding.DataMap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.DataMap)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.DataMap)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.DataMap)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.DataMap)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -109541,24 +110474,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.DataMap)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.DataMap)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.DataMap)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.DataMap)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.DataMap)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.DataMap)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.DataMap)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.DataMap)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -109575,52 +110508,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_DataMap(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.DataMap)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.DataMap)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.DataMap) - if !ok { + if vc, ok := v.Value.(binding.DataMap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.DataMap)//get-item: arg 1: expected native of type binding.DataMap") + return env.NewError("Go(binding.DataMap)//get-item: arg 1: " + "expected native of type binding.DataMap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.DataMap)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.DataMap)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.DataMap)//get-item: arg 1: expected native") + return env.NewError("Go(binding.DataMap)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.DataMap)//get-item: arg 2: expected string") + return env.NewError("Go(binding.DataMap)//get-item: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -109643,24 +110559,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_DataMap(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.DataMap)//keys: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.DataMap)//keys: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.DataMap) - if !ok { + if vc, ok := v.Value.(binding.DataMap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.DataMap)//keys: arg 1: expected native of type binding.DataMap") + return env.NewError("Go(binding.DataMap)//keys: arg 1: " + "expected native of type binding.DataMap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.DataMap)//keys: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.DataMap)//keys: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.DataMap)//keys: arg 1: expected native") + return env.NewError("Go(binding.DataMap)//keys: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Keys() var res0Obj env.Object @@ -109685,24 +110601,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_DataMap(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.DataMap)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.DataMap)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.DataMap) - if !ok { + if vc, ok := v.Value.(binding.DataMap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.DataMap)//remove-listener: arg 1: expected native of type binding.DataMap") + return env.NewError("Go(binding.DataMap)//remove-listener: arg 1: " + "expected native of type binding.DataMap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.DataMap)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.DataMap)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.DataMap)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.DataMap)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -109711,24 +110627,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.DataMap)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.DataMap)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.DataMap)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.DataMap)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.DataMap)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.DataMap)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.DataMap)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.DataMap)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -109745,24 +110661,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_DataTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.DataTree)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.DataTree)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.DataTree) - if !ok { + if vc, ok := v.Value.(binding.DataTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.DataTree)//add-listener: arg 1: expected native of type binding.DataTree") + return env.NewError("Go(binding.DataTree)//add-listener: arg 1: " + "expected native of type binding.DataTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.DataTree)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.DataTree)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.DataTree)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.DataTree)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -109771,24 +110687,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.DataTree)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.DataTree)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.DataTree)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.DataTree)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.DataTree)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.DataTree)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.DataTree)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.DataTree)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -109805,31 +110721,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_DataTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.DataTree)//child-i-ds: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.DataTree)//child-i-ds: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.DataTree) - if !ok { + if vc, ok := v.Value.(binding.DataTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.DataTree)//child-i-ds: arg 1: expected native of type binding.DataTree") + return env.NewError("Go(binding.DataTree)//child-i-ds: arg 1: " + "expected native of type binding.DataTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.DataTree)//child-i-ds: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.DataTree)//child-i-ds: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.DataTree)//child-i-ds: arg 1: expected native") + return env.NewError("Go(binding.DataTree)//child-i-ds: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.DataTree)//child-i-ds: arg 2: expected string") + return env.NewError("Go(binding.DataTree)//child-i-ds: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := arg0Val.ChildIDs(arg1Val) var res0Obj env.Object @@ -109854,52 +110770,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_DataTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.DataTree)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.DataTree)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.DataTree) - if !ok { + if vc, ok := v.Value.(binding.DataTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.DataTree)//get-item: arg 1: expected native of type binding.DataTree") + return env.NewError("Go(binding.DataTree)//get-item: arg 1: " + "expected native of type binding.DataTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.DataTree)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.DataTree)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.DataTree)//get-item: arg 1: expected native") + return env.NewError("Go(binding.DataTree)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.DataTree)//get-item: arg 2: expected string") + return env.NewError("Go(binding.DataTree)//get-item: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -109922,24 +110821,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_DataTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.DataTree)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.DataTree)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.DataTree) - if !ok { + if vc, ok := v.Value.(binding.DataTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.DataTree)//remove-listener: arg 1: expected native of type binding.DataTree") + return env.NewError("Go(binding.DataTree)//remove-listener: arg 1: " + "expected native of type binding.DataTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.DataTree)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.DataTree)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.DataTree)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.DataTree)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -109948,24 +110847,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.DataTree)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.DataTree)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.DataTree)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.DataTree)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.DataTree)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.DataTree)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.DataTree)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.DataTree)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -109982,24 +110881,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBool(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBool)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBool)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBool) - if !ok { + if vc, ok := v.Value.(binding.ExternalBool); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBool)//add-listener: arg 1: expected native of type binding.ExternalBool") + return env.NewError("Go(binding.ExternalBool)//add-listener: arg 1: " + "expected native of type binding.ExternalBool, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBool)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBool)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBool)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalBool)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -110008,24 +110907,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBool)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBool)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBool)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalBool)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBool)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBool)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBool)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalBool)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -110042,24 +110941,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBool(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBool)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBool)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBool) - if !ok { + if vc, ok := v.Value.(binding.ExternalBool); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBool)//get: arg 1: expected native of type binding.ExternalBool") + return env.NewError("Go(binding.ExternalBool)//get: arg 1: " + "expected native of type binding.ExternalBool, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBool)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBool)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBool)//get: arg 1: expected native") + return env.NewError("Go(binding.ExternalBool)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object @@ -110086,24 +110985,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBool(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBool)//reload: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBool)//reload: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBool) - if !ok { + if vc, ok := v.Value.(binding.ExternalBool); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBool)//reload: arg 1: expected native of type binding.ExternalBool") + return env.NewError("Go(binding.ExternalBool)//reload: arg 1: " + "expected native of type binding.ExternalBool, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBool)//reload: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBool)//reload: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBool)//reload: arg 1: expected native") + return env.NewError("Go(binding.ExternalBool)//reload: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Reload() var resErrObj env.Object @@ -110128,24 +111027,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBool(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBool)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBool)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBool) - if !ok { + if vc, ok := v.Value.(binding.ExternalBool); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBool)//remove-listener: arg 1: expected native of type binding.ExternalBool") + return env.NewError("Go(binding.ExternalBool)//remove-listener: arg 1: " + "expected native of type binding.ExternalBool, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBool)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBool)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBool)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalBool)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -110154,24 +111053,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBool)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBool)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBool)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalBool)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBool)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBool)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBool)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalBool)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -110188,31 +111087,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBool(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBool)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBool)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBool) - if !ok { + if vc, ok := v.Value.(binding.ExternalBool); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBool)//set: arg 1: expected native of type binding.ExternalBool") + return env.NewError("Go(binding.ExternalBool)//set: arg 1: " + "expected native of type binding.ExternalBool, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBool)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBool)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBool)//set: arg 1: expected native") + return env.NewError("Go(binding.ExternalBool)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val bool - if v, ok := arg1.(env.Integer); ok { - arg1Val = v.Value != 0 + if vc, ok := arg1.(env.Integer); ok { + arg1Val = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBool)//set: arg 2: expected integer") + return env.NewError("Go(binding.ExternalBool)//set: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -110237,24 +111136,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBoolList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBoolList)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBoolList) - if !ok { + if vc, ok := v.Value.(binding.ExternalBoolList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//add-listener: arg 1: expected native of type binding.ExternalBoolList") + return env.NewError("Go(binding.ExternalBoolList)//add-listener: arg 1: " + "expected native of type binding.ExternalBoolList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolList)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalBoolList)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -110263,24 +111162,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBoolList)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalBoolList)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolList)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalBoolList)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -110297,31 +111196,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBoolList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBoolList)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBoolList) - if !ok { + if vc, ok := v.Value.(binding.ExternalBoolList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//append: arg 1: expected native of type binding.ExternalBoolList") + return env.NewError("Go(binding.ExternalBoolList)//append: arg 1: " + "expected native of type binding.ExternalBoolList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolList)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//append: arg 1: expected native") + return env.NewError("Go(binding.ExternalBoolList)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val bool - if v, ok := arg1.(env.Integer); ok { - arg1Val = v.Value != 0 + if vc, ok := arg1.(env.Integer); ok { + arg1Val = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//append: arg 2: expected integer") + return env.NewError("Go(binding.ExternalBoolList)//append: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } resErr := arg0Val.Append(arg1Val) var resErrObj env.Object @@ -110346,24 +111245,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBoolList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBoolList)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBoolList) - if !ok { + if vc, ok := v.Value.(binding.ExternalBoolList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//get: arg 1: expected native of type binding.ExternalBoolList") + return env.NewError("Go(binding.ExternalBoolList)//get: arg 1: " + "expected native of type binding.ExternalBoolList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolList)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//get: arg 1: expected native") + return env.NewError("Go(binding.ExternalBoolList)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object @@ -110396,52 +111295,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBoolList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBoolList)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBoolList) - if !ok { + if vc, ok := v.Value.(binding.ExternalBoolList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//get-item: arg 1: expected native of type binding.ExternalBoolList") + return env.NewError("Go(binding.ExternalBoolList)//get-item: arg 1: " + "expected native of type binding.ExternalBoolList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolList)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//get-item: arg 1: expected native") + return env.NewError("Go(binding.ExternalBoolList)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//get-item: arg 2: expected integer") + return env.NewError("Go(binding.ExternalBoolList)//get-item: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -110464,31 +111346,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBoolList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBoolList)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBoolList) - if !ok { + if vc, ok := v.Value.(binding.ExternalBoolList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//get-value: arg 1: expected native of type binding.ExternalBoolList") + return env.NewError("Go(binding.ExternalBoolList)//get-value: arg 1: " + "expected native of type binding.ExternalBoolList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolList)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//get-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalBoolList)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//get-value: arg 2: expected integer") + return env.NewError("Go(binding.ExternalBoolList)//get-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object @@ -110515,24 +111397,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBoolList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//length: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBoolList)//length: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBoolList) - if !ok { + if vc, ok := v.Value.(binding.ExternalBoolList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//length: arg 1: expected native of type binding.ExternalBoolList") + return env.NewError("Go(binding.ExternalBoolList)//length: arg 1: " + "expected native of type binding.ExternalBoolList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//length: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolList)//length: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//length: arg 1: expected native") + return env.NewError("Go(binding.ExternalBoolList)//length: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Length() var res0Obj env.Object @@ -110551,31 +111433,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBoolList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBoolList)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBoolList) - if !ok { + if vc, ok := v.Value.(binding.ExternalBoolList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//prepend: arg 1: expected native of type binding.ExternalBoolList") + return env.NewError("Go(binding.ExternalBoolList)//prepend: arg 1: " + "expected native of type binding.ExternalBoolList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolList)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//prepend: arg 1: expected native") + return env.NewError("Go(binding.ExternalBoolList)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val bool - if v, ok := arg1.(env.Integer); ok { - arg1Val = v.Value != 0 + if vc, ok := arg1.(env.Integer); ok { + arg1Val = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//prepend: arg 2: expected integer") + return env.NewError("Go(binding.ExternalBoolList)//prepend: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } resErr := arg0Val.Prepend(arg1Val) var resErrObj env.Object @@ -110600,24 +111482,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBoolList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//reload: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBoolList)//reload: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBoolList) - if !ok { + if vc, ok := v.Value.(binding.ExternalBoolList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//reload: arg 1: expected native of type binding.ExternalBoolList") + return env.NewError("Go(binding.ExternalBoolList)//reload: arg 1: " + "expected native of type binding.ExternalBoolList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//reload: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolList)//reload: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//reload: arg 1: expected native") + return env.NewError("Go(binding.ExternalBoolList)//reload: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Reload() var resErrObj env.Object @@ -110642,24 +111524,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBoolList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBoolList)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBoolList) - if !ok { + if vc, ok := v.Value.(binding.ExternalBoolList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//remove-listener: arg 1: expected native of type binding.ExternalBoolList") + return env.NewError("Go(binding.ExternalBoolList)//remove-listener: arg 1: " + "expected native of type binding.ExternalBoolList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolList)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalBoolList)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -110668,24 +111550,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBoolList)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalBoolList)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolList)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalBoolList)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -110702,53 +111584,46 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBoolList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBoolList)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBoolList) - if !ok { + if vc, ok := v.Value.(binding.ExternalBoolList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//set: arg 1: expected native of type binding.ExternalBoolList") + return env.NewError("Go(binding.ExternalBoolList)//set: arg 1: " + "expected native of type binding.ExternalBoolList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolList)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//set: arg 1: expected native") + return env.NewError("Go(binding.ExternalBoolList)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []bool switch v := arg1.(type) { case env.Block: arg1Val = make([]bool, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.Integer); ok { - arg1Val[i] = v.Value != 0 + if vc, ok := it.(env.Integer); ok { + arg1Val[i] = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//set: arg 2: block item: expected integer") + return env.NewError("Go(binding.ExternalBoolList)//set: arg 2: " + "block item: " + "expected integer, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]bool) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//set: arg 2: expected native of type []bool") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolList)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//set: arg 2: expected block, native or nil") + return env.NewError("Go(binding.ExternalBoolList)//set: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -110773,38 +111648,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBoolList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBoolList)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBoolList) - if !ok { + if vc, ok := v.Value.(binding.ExternalBoolList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//set-value: arg 1: expected native of type binding.ExternalBoolList") + return env.NewError("Go(binding.ExternalBoolList)//set-value: arg 1: " + "expected native of type binding.ExternalBoolList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolList)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//set-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalBoolList)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//set-value: arg 2: expected integer") + return env.NewError("Go(binding.ExternalBoolList)//set-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val bool - if v, ok := arg2.(env.Integer); ok { - arg2Val = v.Value != 0 + if vc, ok := arg2.(env.Integer); ok { + arg2Val = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolList)//set-value: arg 3: expected integer") + return env.NewError("Go(binding.ExternalBoolList)//set-value: arg 3: " + "expected integer, but got " + objectDebugString(ps.Idx, arg2)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -110829,24 +111704,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBoolTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBoolTree)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBoolTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalBoolTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//add-listener: arg 1: expected native of type binding.ExternalBoolTree") + return env.NewError("Go(binding.ExternalBoolTree)//add-listener: arg 1: " + "expected native of type binding.ExternalBoolTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolTree)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalBoolTree)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -110855,24 +111730,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBoolTree)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalBoolTree)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolTree)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalBoolTree)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -110889,45 +111764,45 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBoolTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBoolTree)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBoolTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalBoolTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//append: arg 1: expected native of type binding.ExternalBoolTree") + return env.NewError("Go(binding.ExternalBoolTree)//append: arg 1: " + "expected native of type binding.ExternalBoolTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolTree)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//append: arg 1: expected native") + return env.NewError("Go(binding.ExternalBoolTree)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//append: arg 2: expected string") + return env.NewError("Go(binding.ExternalBoolTree)//append: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//append: arg 3: expected string") + return env.NewError("Go(binding.ExternalBoolTree)//append: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val bool - if v, ok := arg3.(env.Integer); ok { - arg3Val = v.Value != 0 + if vc, ok := arg3.(env.Integer); ok { + arg3Val = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//append: arg 4: expected integer") + return env.NewError("Go(binding.ExternalBoolTree)//append: arg 4: " + "expected integer, but got " + objectDebugString(ps.Idx, arg3)) } resErr := arg0Val.Append(arg1Val, arg2Val, arg3Val) var resErrObj env.Object @@ -110952,31 +111827,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBoolTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//child-i-ds: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBoolTree)//child-i-ds: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBoolTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalBoolTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//child-i-ds: arg 1: expected native of type binding.ExternalBoolTree") + return env.NewError("Go(binding.ExternalBoolTree)//child-i-ds: arg 1: " + "expected native of type binding.ExternalBoolTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//child-i-ds: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolTree)//child-i-ds: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//child-i-ds: arg 1: expected native") + return env.NewError("Go(binding.ExternalBoolTree)//child-i-ds: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//child-i-ds: arg 2: expected string") + return env.NewError("Go(binding.ExternalBoolTree)//child-i-ds: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := arg0Val.ChildIDs(arg1Val) var res0Obj env.Object @@ -111001,24 +111876,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBoolTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBoolTree)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBoolTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalBoolTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//get: arg 1: expected native of type binding.ExternalBoolTree") + return env.NewError("Go(binding.ExternalBoolTree)//get: arg 1: " + "expected native of type binding.ExternalBoolTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolTree)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//get: arg 1: expected native") + return env.NewError("Go(binding.ExternalBoolTree)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, res1, resErr := arg0Val.Get() var res0Obj env.Object @@ -111072,52 +111947,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBoolTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBoolTree)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBoolTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalBoolTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//get-item: arg 1: expected native of type binding.ExternalBoolTree") + return env.NewError("Go(binding.ExternalBoolTree)//get-item: arg 1: " + "expected native of type binding.ExternalBoolTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolTree)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//get-item: arg 1: expected native") + return env.NewError("Go(binding.ExternalBoolTree)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//get-item: arg 2: expected string") + return env.NewError("Go(binding.ExternalBoolTree)//get-item: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -111140,31 +111998,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBoolTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBoolTree)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBoolTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalBoolTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//get-value: arg 1: expected native of type binding.ExternalBoolTree") + return env.NewError("Go(binding.ExternalBoolTree)//get-value: arg 1: " + "expected native of type binding.ExternalBoolTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolTree)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//get-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalBoolTree)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//get-value: arg 2: expected string") + return env.NewError("Go(binding.ExternalBoolTree)//get-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object @@ -111191,45 +112049,45 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBoolTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBoolTree)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBoolTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalBoolTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//prepend: arg 1: expected native of type binding.ExternalBoolTree") + return env.NewError("Go(binding.ExternalBoolTree)//prepend: arg 1: " + "expected native of type binding.ExternalBoolTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolTree)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//prepend: arg 1: expected native") + return env.NewError("Go(binding.ExternalBoolTree)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//prepend: arg 2: expected string") + return env.NewError("Go(binding.ExternalBoolTree)//prepend: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//prepend: arg 3: expected string") + return env.NewError("Go(binding.ExternalBoolTree)//prepend: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val bool - if v, ok := arg3.(env.Integer); ok { - arg3Val = v.Value != 0 + if vc, ok := arg3.(env.Integer); ok { + arg3Val = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//prepend: arg 4: expected integer") + return env.NewError("Go(binding.ExternalBoolTree)//prepend: arg 4: " + "expected integer, but got " + objectDebugString(ps.Idx, arg3)) } resErr := arg0Val.Prepend(arg1Val, arg2Val, arg3Val) var resErrObj env.Object @@ -111254,24 +112112,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBoolTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//reload: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBoolTree)//reload: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBoolTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalBoolTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//reload: arg 1: expected native of type binding.ExternalBoolTree") + return env.NewError("Go(binding.ExternalBoolTree)//reload: arg 1: " + "expected native of type binding.ExternalBoolTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//reload: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolTree)//reload: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//reload: arg 1: expected native") + return env.NewError("Go(binding.ExternalBoolTree)//reload: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Reload() var resErrObj env.Object @@ -111296,24 +112154,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBoolTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBoolTree)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBoolTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalBoolTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//remove-listener: arg 1: expected native of type binding.ExternalBoolTree") + return env.NewError("Go(binding.ExternalBoolTree)//remove-listener: arg 1: " + "expected native of type binding.ExternalBoolTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolTree)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalBoolTree)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -111322,24 +112180,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBoolTree)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalBoolTree)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolTree)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalBoolTree)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -111356,69 +112214,62 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBoolTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBoolTree)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBoolTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalBoolTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set: arg 1: expected native of type binding.ExternalBoolTree") + return env.NewError("Go(binding.ExternalBoolTree)//set: arg 1: " + "expected native of type binding.ExternalBoolTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolTree)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set: arg 1: expected native") + return env.NewError("Go(binding.ExternalBoolTree)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val map[string][]string switch v := arg1.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set: arg 2: expected block to have length of multiple of 2") + return env.NewError("Go(binding.ExternalBoolTree)//set: arg 2: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } arg1Val = make(map[string][]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set: arg 2: map key: expected string") + return env.NewError("Go(binding.ExternalBoolTree)//set: arg 2: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV []string switch v := v.Series.S[i+1].(type) { case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set: arg 2: map value: block item: expected string") + return env.NewError("Go(binding.ExternalBoolTree)//set: arg 2: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set: arg 2: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set: arg 2: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolTree)//set: arg 2: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set: arg 2: map value: expected block, native or nil") + return env.NewError("Go(binding.ExternalBoolTree)//set: arg 2: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } @@ -111431,71 +112282,57 @@ var Builtins = map[string]*env.Builtin{ case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set: arg 2: map value: block item: expected string") + return env.NewError("Go(binding.ExternalBoolTree)//set: arg 2: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set: arg 2: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set: arg 2: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolTree)//set: arg 2: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set: arg 2: map value: expected block, native or nil") + return env.NewError("Go(binding.ExternalBoolTree)//set: arg 2: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } - case env.Native: - var ok bool - arg1Val, ok = v.Value.(map[string][]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set: arg 2: expected native of type map[string][]string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolTree)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set: arg 2: expected native, block, dict or nil") + return env.NewError("Go(binding.ExternalBoolTree)//set: arg 2: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } var arg2Val map[string]bool switch v := arg2.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set: arg 3: expected block to have length of multiple of 2") + return env.NewError("Go(binding.ExternalBoolTree)//set: arg 3: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } arg2Val = make(map[string]bool, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set: arg 3: map key: expected string") + return env.NewError("Go(binding.ExternalBoolTree)//set: arg 3: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV bool - if v, ok := v.Series.S[i+1].(env.Integer); ok { - mapV = v.Value != 0 + if vc, ok := v.Series.S[i+1].(env.Integer); ok { + mapV = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set: arg 3: map value: expected integer") + return env.NewError("Go(binding.ExternalBoolTree)//set: arg 3: " + "map value: " + "expected integer, but got " + objectDebugString(ps.Idx, v.Series.S[i+1])) } arg2Val[mapK] = mapV } @@ -111504,30 +112341,23 @@ var Builtins = map[string]*env.Builtin{ for dictK, dictV := range v.Data { mapK := dictK var mapV bool - if v, ok := dictV.(env.Integer); ok { - mapV = v.Value != 0 + if vc, ok := dictV.(env.Integer); ok { + mapV = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set: arg 3: map value: expected integer") + return env.NewError("Go(binding.ExternalBoolTree)//set: arg 3: " + "map value: " + "expected integer, but got " + objectDebugString(ps.Idx, dictV)) } arg2Val[mapK] = mapV } - case env.Native: - var ok bool - arg2Val, ok = v.Value.(map[string]bool) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set: arg 3: expected native of type map[string]bool") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolTree)//set: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set: arg 3: expected native, block, dict or nil") + return env.NewError("Go(binding.ExternalBoolTree)//set: arg 3: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val, arg2Val) var resErrObj env.Object @@ -111552,38 +112382,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBoolTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBoolTree)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBoolTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalBoolTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set-value: arg 1: expected native of type binding.ExternalBoolTree") + return env.NewError("Go(binding.ExternalBoolTree)//set-value: arg 1: " + "expected native of type binding.ExternalBoolTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBoolTree)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalBoolTree)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set-value: arg 2: expected string") + return env.NewError("Go(binding.ExternalBoolTree)//set-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val bool - if v, ok := arg2.(env.Integer); ok { - arg2Val = v.Value != 0 + if vc, ok := arg2.(env.Integer); ok { + arg2Val = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBoolTree)//set-value: arg 3: expected integer") + return env.NewError("Go(binding.ExternalBoolTree)//set-value: arg 3: " + "expected integer, but got " + objectDebugString(ps.Idx, arg2)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -111608,24 +112438,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBytes(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytes)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBytes) - if !ok { + if vc, ok := v.Value.(binding.ExternalBytes); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//add-listener: arg 1: expected native of type binding.ExternalBytes") + return env.NewError("Go(binding.ExternalBytes)//add-listener: arg 1: " + "expected native of type binding.ExternalBytes, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytes)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalBytes)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -111634,24 +112464,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytes)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalBytes)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytes)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalBytes)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -111668,24 +112498,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBytes(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytes)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBytes) - if !ok { + if vc, ok := v.Value.(binding.ExternalBytes); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//get: arg 1: expected native of type binding.ExternalBytes") + return env.NewError("Go(binding.ExternalBytes)//get: arg 1: " + "expected native of type binding.ExternalBytes, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytes)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//get: arg 1: expected native") + return env.NewError("Go(binding.ExternalBytes)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object @@ -111718,24 +112548,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBytes(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//reload: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytes)//reload: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBytes) - if !ok { + if vc, ok := v.Value.(binding.ExternalBytes); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//reload: arg 1: expected native of type binding.ExternalBytes") + return env.NewError("Go(binding.ExternalBytes)//reload: arg 1: " + "expected native of type binding.ExternalBytes, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//reload: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytes)//reload: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//reload: arg 1: expected native") + return env.NewError("Go(binding.ExternalBytes)//reload: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Reload() var resErrObj env.Object @@ -111760,24 +112590,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBytes(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytes)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBytes) - if !ok { + if vc, ok := v.Value.(binding.ExternalBytes); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//remove-listener: arg 1: expected native of type binding.ExternalBytes") + return env.NewError("Go(binding.ExternalBytes)//remove-listener: arg 1: " + "expected native of type binding.ExternalBytes, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytes)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalBytes)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -111786,24 +112616,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytes)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalBytes)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytes)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalBytes)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -111820,24 +112650,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBytes(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytes)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBytes) - if !ok { + if vc, ok := v.Value.(binding.ExternalBytes); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//set: arg 1: expected native of type binding.ExternalBytes") + return env.NewError("Go(binding.ExternalBytes)//set: arg 1: " + "expected native of type binding.ExternalBytes, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytes)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//set: arg 1: expected native") + return env.NewError("Go(binding.ExternalBytes)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []byte switch v := arg1.(type) { @@ -111846,33 +112676,26 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg1Val[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + arg1Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//set: arg 2: block item: expected native of type byte") + return env.NewError("Go(binding.ExternalBytes)//set: arg 2: " + "block item: " + "expected native of type byte, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//set: arg 2: block item: expected native") + return env.NewError("Go(binding.ExternalBytes)//set: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]byte) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//set: arg 2: expected native of type []byte") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytes)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytes)//set: arg 2: expected block, native or nil") + return env.NewError("Go(binding.ExternalBytes)//set: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -111897,24 +112720,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBytesList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytesList)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBytesList) - if !ok { + if vc, ok := v.Value.(binding.ExternalBytesList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//add-listener: arg 1: expected native of type binding.ExternalBytesList") + return env.NewError("Go(binding.ExternalBytesList)//add-listener: arg 1: " + "expected native of type binding.ExternalBytesList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesList)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalBytesList)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -111923,24 +112746,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytesList)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalBytesList)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesList)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalBytesList)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -111957,24 +112780,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBytesList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytesList)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBytesList) - if !ok { + if vc, ok := v.Value.(binding.ExternalBytesList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//append: arg 1: expected native of type binding.ExternalBytesList") + return env.NewError("Go(binding.ExternalBytesList)//append: arg 1: " + "expected native of type binding.ExternalBytesList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesList)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//append: arg 1: expected native") + return env.NewError("Go(binding.ExternalBytesList)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []byte switch v := arg1.(type) { @@ -111983,33 +112806,26 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg1Val[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + arg1Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//append: arg 2: block item: expected native of type byte") + return env.NewError("Go(binding.ExternalBytesList)//append: arg 2: " + "block item: " + "expected native of type byte, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//append: arg 2: block item: expected native") + return env.NewError("Go(binding.ExternalBytesList)//append: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]byte) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//append: arg 2: expected native of type []byte") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//append: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesList)//append: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//append: arg 2: expected block, native or nil") + return env.NewError("Go(binding.ExternalBytesList)//append: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Append(arg1Val) var resErrObj env.Object @@ -112034,24 +112850,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBytesList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytesList)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBytesList) - if !ok { + if vc, ok := v.Value.(binding.ExternalBytesList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//get: arg 1: expected native of type binding.ExternalBytesList") + return env.NewError("Go(binding.ExternalBytesList)//get: arg 1: " + "expected native of type binding.ExternalBytesList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesList)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//get: arg 1: expected native") + return env.NewError("Go(binding.ExternalBytesList)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object @@ -112090,52 +112906,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBytesList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytesList)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBytesList) - if !ok { + if vc, ok := v.Value.(binding.ExternalBytesList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//get-item: arg 1: expected native of type binding.ExternalBytesList") + return env.NewError("Go(binding.ExternalBytesList)//get-item: arg 1: " + "expected native of type binding.ExternalBytesList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesList)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//get-item: arg 1: expected native") + return env.NewError("Go(binding.ExternalBytesList)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//get-item: arg 2: expected integer") + return env.NewError("Go(binding.ExternalBytesList)//get-item: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -112158,31 +112957,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBytesList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytesList)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBytesList) - if !ok { + if vc, ok := v.Value.(binding.ExternalBytesList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//get-value: arg 1: expected native of type binding.ExternalBytesList") + return env.NewError("Go(binding.ExternalBytesList)//get-value: arg 1: " + "expected native of type binding.ExternalBytesList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesList)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//get-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalBytesList)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//get-value: arg 2: expected integer") + return env.NewError("Go(binding.ExternalBytesList)//get-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object @@ -112215,24 +113014,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBytesList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//length: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytesList)//length: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBytesList) - if !ok { + if vc, ok := v.Value.(binding.ExternalBytesList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//length: arg 1: expected native of type binding.ExternalBytesList") + return env.NewError("Go(binding.ExternalBytesList)//length: arg 1: " + "expected native of type binding.ExternalBytesList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//length: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesList)//length: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//length: arg 1: expected native") + return env.NewError("Go(binding.ExternalBytesList)//length: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Length() var res0Obj env.Object @@ -112251,24 +113050,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBytesList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytesList)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBytesList) - if !ok { + if vc, ok := v.Value.(binding.ExternalBytesList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//prepend: arg 1: expected native of type binding.ExternalBytesList") + return env.NewError("Go(binding.ExternalBytesList)//prepend: arg 1: " + "expected native of type binding.ExternalBytesList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesList)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//prepend: arg 1: expected native") + return env.NewError("Go(binding.ExternalBytesList)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []byte switch v := arg1.(type) { @@ -112277,33 +113076,26 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg1Val[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + arg1Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//prepend: arg 2: block item: expected native of type byte") + return env.NewError("Go(binding.ExternalBytesList)//prepend: arg 2: " + "block item: " + "expected native of type byte, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//prepend: arg 2: block item: expected native") + return env.NewError("Go(binding.ExternalBytesList)//prepend: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]byte) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//prepend: arg 2: expected native of type []byte") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//prepend: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesList)//prepend: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//prepend: arg 2: expected block, native or nil") + return env.NewError("Go(binding.ExternalBytesList)//prepend: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Prepend(arg1Val) var resErrObj env.Object @@ -112328,24 +113120,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBytesList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//reload: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytesList)//reload: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBytesList) - if !ok { + if vc, ok := v.Value.(binding.ExternalBytesList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//reload: arg 1: expected native of type binding.ExternalBytesList") + return env.NewError("Go(binding.ExternalBytesList)//reload: arg 1: " + "expected native of type binding.ExternalBytesList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//reload: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesList)//reload: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//reload: arg 1: expected native") + return env.NewError("Go(binding.ExternalBytesList)//reload: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Reload() var resErrObj env.Object @@ -112370,24 +113162,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBytesList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytesList)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBytesList) - if !ok { + if vc, ok := v.Value.(binding.ExternalBytesList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//remove-listener: arg 1: expected native of type binding.ExternalBytesList") + return env.NewError("Go(binding.ExternalBytesList)//remove-listener: arg 1: " + "expected native of type binding.ExternalBytesList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesList)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalBytesList)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -112396,24 +113188,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytesList)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalBytesList)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesList)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalBytesList)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -112430,24 +113222,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBytesList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytesList)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBytesList) - if !ok { + if vc, ok := v.Value.(binding.ExternalBytesList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//set: arg 1: expected native of type binding.ExternalBytesList") + return env.NewError("Go(binding.ExternalBytesList)//set: arg 1: " + "expected native of type binding.ExternalBytesList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesList)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//set: arg 1: expected native") + return env.NewError("Go(binding.ExternalBytesList)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val [][]byte switch v := arg1.(type) { @@ -112460,51 +113252,37 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg1Val[i][i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + arg1Val[i][i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//set: arg 2: block item: block item: expected native of type byte") + return env.NewError("Go(binding.ExternalBytesList)//set: arg 2: " + "block item: " + "block item: " + "expected native of type byte, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//set: arg 2: block item: block item: expected native") + return env.NewError("Go(binding.ExternalBytesList)//set: arg 2: " + "block item: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val[i], ok = v.Value.([]byte) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//set: arg 2: block item: expected native of type []byte") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//set: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesList)//set: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val[i] = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//set: arg 2: block item: expected block, native or nil") + return env.NewError("Go(binding.ExternalBytesList)//set: arg 2: " + "block item: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([][]byte) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//set: arg 2: expected native of type [][]byte") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesList)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//set: arg 2: expected block, native or nil") + return env.NewError("Go(binding.ExternalBytesList)//set: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -112529,31 +113307,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBytesList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytesList)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBytesList) - if !ok { + if vc, ok := v.Value.(binding.ExternalBytesList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//set-value: arg 1: expected native of type binding.ExternalBytesList") + return env.NewError("Go(binding.ExternalBytesList)//set-value: arg 1: " + "expected native of type binding.ExternalBytesList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesList)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//set-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalBytesList)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//set-value: arg 2: expected integer") + return env.NewError("Go(binding.ExternalBytesList)//set-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val []byte switch v := arg2.(type) { @@ -112562,33 +113340,26 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg2Val[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + arg2Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//set-value: arg 3: block item: expected native of type byte") + return env.NewError("Go(binding.ExternalBytesList)//set-value: arg 3: " + "block item: " + "expected native of type byte, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//set-value: arg 3: block item: expected native") + return env.NewError("Go(binding.ExternalBytesList)//set-value: arg 3: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg2Val, ok = v.Value.([]byte) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//set-value: arg 3: expected native of type []byte") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//set-value: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesList)//set-value: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesList)//set-value: arg 3: expected block, native or nil") + return env.NewError("Go(binding.ExternalBytesList)//set-value: arg 3: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -112613,24 +113384,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBytesTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytesTree)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBytesTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalBytesTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//add-listener: arg 1: expected native of type binding.ExternalBytesTree") + return env.NewError("Go(binding.ExternalBytesTree)//add-listener: arg 1: " + "expected native of type binding.ExternalBytesTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesTree)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalBytesTree)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -112639,24 +113410,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytesTree)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalBytesTree)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesTree)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalBytesTree)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -112673,38 +113444,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBytesTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytesTree)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBytesTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalBytesTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//append: arg 1: expected native of type binding.ExternalBytesTree") + return env.NewError("Go(binding.ExternalBytesTree)//append: arg 1: " + "expected native of type binding.ExternalBytesTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesTree)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//append: arg 1: expected native") + return env.NewError("Go(binding.ExternalBytesTree)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//append: arg 2: expected string") + return env.NewError("Go(binding.ExternalBytesTree)//append: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//append: arg 3: expected string") + return env.NewError("Go(binding.ExternalBytesTree)//append: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val []byte switch v := arg3.(type) { @@ -112713,33 +113484,26 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg3Val[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + arg3Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//append: arg 4: block item: expected native of type byte") + return env.NewError("Go(binding.ExternalBytesTree)//append: arg 4: " + "block item: " + "expected native of type byte, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//append: arg 4: block item: expected native") + return env.NewError("Go(binding.ExternalBytesTree)//append: arg 4: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg3Val, ok = v.Value.([]byte) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//append: arg 4: expected native of type []byte") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//append: arg 4: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesTree)//append: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//append: arg 4: expected block, native or nil") + return env.NewError("Go(binding.ExternalBytesTree)//append: arg 4: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Append(arg1Val, arg2Val, arg3Val) var resErrObj env.Object @@ -112764,31 +113528,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBytesTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//child-i-ds: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytesTree)//child-i-ds: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBytesTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalBytesTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//child-i-ds: arg 1: expected native of type binding.ExternalBytesTree") + return env.NewError("Go(binding.ExternalBytesTree)//child-i-ds: arg 1: " + "expected native of type binding.ExternalBytesTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//child-i-ds: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesTree)//child-i-ds: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//child-i-ds: arg 1: expected native") + return env.NewError("Go(binding.ExternalBytesTree)//child-i-ds: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//child-i-ds: arg 2: expected string") + return env.NewError("Go(binding.ExternalBytesTree)//child-i-ds: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := arg0Val.ChildIDs(arg1Val) var res0Obj env.Object @@ -112813,24 +113577,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBytesTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytesTree)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBytesTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalBytesTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//get: arg 1: expected native of type binding.ExternalBytesTree") + return env.NewError("Go(binding.ExternalBytesTree)//get: arg 1: " + "expected native of type binding.ExternalBytesTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesTree)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//get: arg 1: expected native") + return env.NewError("Go(binding.ExternalBytesTree)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, res1, resErr := arg0Val.Get() var res0Obj env.Object @@ -112890,52 +113654,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBytesTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytesTree)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBytesTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalBytesTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//get-item: arg 1: expected native of type binding.ExternalBytesTree") + return env.NewError("Go(binding.ExternalBytesTree)//get-item: arg 1: " + "expected native of type binding.ExternalBytesTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesTree)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//get-item: arg 1: expected native") + return env.NewError("Go(binding.ExternalBytesTree)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//get-item: arg 2: expected string") + return env.NewError("Go(binding.ExternalBytesTree)//get-item: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -112958,31 +113705,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBytesTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytesTree)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBytesTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalBytesTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//get-value: arg 1: expected native of type binding.ExternalBytesTree") + return env.NewError("Go(binding.ExternalBytesTree)//get-value: arg 1: " + "expected native of type binding.ExternalBytesTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesTree)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//get-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalBytesTree)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//get-value: arg 2: expected string") + return env.NewError("Go(binding.ExternalBytesTree)//get-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object @@ -113015,38 +113762,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBytesTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytesTree)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBytesTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalBytesTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//prepend: arg 1: expected native of type binding.ExternalBytesTree") + return env.NewError("Go(binding.ExternalBytesTree)//prepend: arg 1: " + "expected native of type binding.ExternalBytesTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesTree)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//prepend: arg 1: expected native") + return env.NewError("Go(binding.ExternalBytesTree)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//prepend: arg 2: expected string") + return env.NewError("Go(binding.ExternalBytesTree)//prepend: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//prepend: arg 3: expected string") + return env.NewError("Go(binding.ExternalBytesTree)//prepend: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val []byte switch v := arg3.(type) { @@ -113055,33 +113802,26 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg3Val[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + arg3Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//prepend: arg 4: block item: expected native of type byte") + return env.NewError("Go(binding.ExternalBytesTree)//prepend: arg 4: " + "block item: " + "expected native of type byte, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//prepend: arg 4: block item: expected native") + return env.NewError("Go(binding.ExternalBytesTree)//prepend: arg 4: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg3Val, ok = v.Value.([]byte) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//prepend: arg 4: expected native of type []byte") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//prepend: arg 4: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesTree)//prepend: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//prepend: arg 4: expected block, native or nil") + return env.NewError("Go(binding.ExternalBytesTree)//prepend: arg 4: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Prepend(arg1Val, arg2Val, arg3Val) var resErrObj env.Object @@ -113106,24 +113846,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBytesTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//reload: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytesTree)//reload: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBytesTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalBytesTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//reload: arg 1: expected native of type binding.ExternalBytesTree") + return env.NewError("Go(binding.ExternalBytesTree)//reload: arg 1: " + "expected native of type binding.ExternalBytesTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//reload: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesTree)//reload: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//reload: arg 1: expected native") + return env.NewError("Go(binding.ExternalBytesTree)//reload: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Reload() var resErrObj env.Object @@ -113148,24 +113888,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBytesTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytesTree)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBytesTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalBytesTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//remove-listener: arg 1: expected native of type binding.ExternalBytesTree") + return env.NewError("Go(binding.ExternalBytesTree)//remove-listener: arg 1: " + "expected native of type binding.ExternalBytesTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesTree)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalBytesTree)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -113174,24 +113914,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytesTree)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalBytesTree)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesTree)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalBytesTree)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -113208,69 +113948,62 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBytesTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytesTree)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBytesTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalBytesTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 1: expected native of type binding.ExternalBytesTree") + return env.NewError("Go(binding.ExternalBytesTree)//set: arg 1: " + "expected native of type binding.ExternalBytesTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesTree)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 1: expected native") + return env.NewError("Go(binding.ExternalBytesTree)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val map[string][]string switch v := arg1.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 2: expected block to have length of multiple of 2") + return env.NewError("Go(binding.ExternalBytesTree)//set: arg 2: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } arg1Val = make(map[string][]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 2: map key: expected string") + return env.NewError("Go(binding.ExternalBytesTree)//set: arg 2: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV []string switch v := v.Series.S[i+1].(type) { case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 2: map value: block item: expected string") + return env.NewError("Go(binding.ExternalBytesTree)//set: arg 2: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 2: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 2: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesTree)//set: arg 2: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 2: map value: expected block, native or nil") + return env.NewError("Go(binding.ExternalBytesTree)//set: arg 2: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } @@ -113283,64 +114016,50 @@ var Builtins = map[string]*env.Builtin{ case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 2: map value: block item: expected string") + return env.NewError("Go(binding.ExternalBytesTree)//set: arg 2: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 2: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 2: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesTree)//set: arg 2: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 2: map value: expected block, native or nil") + return env.NewError("Go(binding.ExternalBytesTree)//set: arg 2: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } - case env.Native: - var ok bool - arg1Val, ok = v.Value.(map[string][]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 2: expected native of type map[string][]string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesTree)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 2: expected native, block, dict or nil") + return env.NewError("Go(binding.ExternalBytesTree)//set: arg 2: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } var arg2Val map[string][]byte switch v := arg2.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 3: expected block to have length of multiple of 2") + return env.NewError("Go(binding.ExternalBytesTree)//set: arg 3: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } arg2Val = make(map[string][]byte, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 3: map key: expected string") + return env.NewError("Go(binding.ExternalBytesTree)//set: arg 3: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV []byte switch v := v.Series.S[i+1].(type) { @@ -113349,33 +114068,26 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - mapV[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + mapV[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 3: map value: block item: expected native of type byte") + return env.NewError("Go(binding.ExternalBytesTree)//set: arg 3: " + "map value: " + "block item: " + "expected native of type byte, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 3: map value: block item: expected native") + return env.NewError("Go(binding.ExternalBytesTree)//set: arg 3: " + "map value: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]byte) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 3: map value: expected native of type []byte") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 3: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesTree)//set: arg 3: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 3: map value: expected block, native or nil") + return env.NewError("Go(binding.ExternalBytesTree)//set: arg 3: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg2Val[mapK] = mapV } @@ -113390,52 +114102,38 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - mapV[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + mapV[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 3: map value: block item: expected native of type byte") + return env.NewError("Go(binding.ExternalBytesTree)//set: arg 3: " + "map value: " + "block item: " + "expected native of type byte, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 3: map value: block item: expected native") + return env.NewError("Go(binding.ExternalBytesTree)//set: arg 3: " + "map value: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]byte) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 3: map value: expected native of type []byte") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 3: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesTree)//set: arg 3: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 3: map value: expected block, native or nil") + return env.NewError("Go(binding.ExternalBytesTree)//set: arg 3: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg2Val[mapK] = mapV } - case env.Native: - var ok bool - arg2Val, ok = v.Value.(map[string][]byte) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 3: expected native of type map[string][]byte") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesTree)//set: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set: arg 3: expected native, block, dict or nil") + return env.NewError("Go(binding.ExternalBytesTree)//set: arg 3: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val, arg2Val) var resErrObj env.Object @@ -113460,31 +114158,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalBytesTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalBytesTree)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalBytesTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalBytesTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set-value: arg 1: expected native of type binding.ExternalBytesTree") + return env.NewError("Go(binding.ExternalBytesTree)//set-value: arg 1: " + "expected native of type binding.ExternalBytesTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesTree)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalBytesTree)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set-value: arg 2: expected string") + return env.NewError("Go(binding.ExternalBytesTree)//set-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val []byte switch v := arg2.(type) { @@ -113493,33 +114191,26 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg2Val[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + arg2Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set-value: arg 3: block item: expected native of type byte") + return env.NewError("Go(binding.ExternalBytesTree)//set-value: arg 3: " + "block item: " + "expected native of type byte, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set-value: arg 3: block item: expected native") + return env.NewError("Go(binding.ExternalBytesTree)//set-value: arg 3: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg2Val, ok = v.Value.([]byte) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set-value: arg 3: expected native of type []byte") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set-value: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalBytesTree)//set-value: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalBytesTree)//set-value: arg 3: expected block, native or nil") + return env.NewError("Go(binding.ExternalBytesTree)//set-value: arg 3: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -113544,24 +114235,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalFloat(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloat)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloat)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalFloat) - if !ok { + if vc, ok := v.Value.(binding.ExternalFloat); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloat)//add-listener: arg 1: expected native of type binding.ExternalFloat") + return env.NewError("Go(binding.ExternalFloat)//add-listener: arg 1: " + "expected native of type binding.ExternalFloat, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloat)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloat)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloat)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalFloat)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -113570,24 +114261,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloat)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloat)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloat)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalFloat)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloat)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloat)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloat)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalFloat)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -113604,24 +114295,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalFloat(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloat)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloat)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalFloat) - if !ok { + if vc, ok := v.Value.(binding.ExternalFloat); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloat)//get: arg 1: expected native of type binding.ExternalFloat") + return env.NewError("Go(binding.ExternalFloat)//get: arg 1: " + "expected native of type binding.ExternalFloat, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloat)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloat)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloat)//get: arg 1: expected native") + return env.NewError("Go(binding.ExternalFloat)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object @@ -113648,24 +114339,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalFloat(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloat)//reload: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloat)//reload: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalFloat) - if !ok { + if vc, ok := v.Value.(binding.ExternalFloat); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloat)//reload: arg 1: expected native of type binding.ExternalFloat") + return env.NewError("Go(binding.ExternalFloat)//reload: arg 1: " + "expected native of type binding.ExternalFloat, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloat)//reload: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloat)//reload: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloat)//reload: arg 1: expected native") + return env.NewError("Go(binding.ExternalFloat)//reload: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Reload() var resErrObj env.Object @@ -113690,24 +114381,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalFloat(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloat)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloat)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalFloat) - if !ok { + if vc, ok := v.Value.(binding.ExternalFloat); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloat)//remove-listener: arg 1: expected native of type binding.ExternalFloat") + return env.NewError("Go(binding.ExternalFloat)//remove-listener: arg 1: " + "expected native of type binding.ExternalFloat, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloat)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloat)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloat)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalFloat)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -113716,24 +114407,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloat)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloat)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloat)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalFloat)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloat)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloat)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloat)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalFloat)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -113750,31 +114441,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalFloat(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloat)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloat)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalFloat) - if !ok { + if vc, ok := v.Value.(binding.ExternalFloat); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloat)//set: arg 1: expected native of type binding.ExternalFloat") + return env.NewError("Go(binding.ExternalFloat)//set: arg 1: " + "expected native of type binding.ExternalFloat, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloat)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloat)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloat)//set: arg 1: expected native") + return env.NewError("Go(binding.ExternalFloat)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val float64 - if v, ok := arg1.(env.Decimal); ok { - arg1Val = float64(v.Value) + if vc, ok := arg1.(env.Decimal); ok { + arg1Val = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloat)//set: arg 2: expected decimal") + return env.NewError("Go(binding.ExternalFloat)//set: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -113799,24 +114490,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalFloatList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloatList)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalFloatList) - if !ok { + if vc, ok := v.Value.(binding.ExternalFloatList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//add-listener: arg 1: expected native of type binding.ExternalFloatList") + return env.NewError("Go(binding.ExternalFloatList)//add-listener: arg 1: " + "expected native of type binding.ExternalFloatList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatList)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalFloatList)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -113825,24 +114516,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloatList)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalFloatList)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatList)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalFloatList)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -113859,31 +114550,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalFloatList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloatList)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalFloatList) - if !ok { + if vc, ok := v.Value.(binding.ExternalFloatList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//append: arg 1: expected native of type binding.ExternalFloatList") + return env.NewError("Go(binding.ExternalFloatList)//append: arg 1: " + "expected native of type binding.ExternalFloatList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatList)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//append: arg 1: expected native") + return env.NewError("Go(binding.ExternalFloatList)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val float64 - if v, ok := arg1.(env.Decimal); ok { - arg1Val = float64(v.Value) + if vc, ok := arg1.(env.Decimal); ok { + arg1Val = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//append: arg 2: expected decimal") + return env.NewError("Go(binding.ExternalFloatList)//append: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } resErr := arg0Val.Append(arg1Val) var resErrObj env.Object @@ -113908,24 +114599,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalFloatList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloatList)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalFloatList) - if !ok { + if vc, ok := v.Value.(binding.ExternalFloatList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//get: arg 1: expected native of type binding.ExternalFloatList") + return env.NewError("Go(binding.ExternalFloatList)//get: arg 1: " + "expected native of type binding.ExternalFloatList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatList)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//get: arg 1: expected native") + return env.NewError("Go(binding.ExternalFloatList)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object @@ -113958,52 +114649,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalFloatList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloatList)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalFloatList) - if !ok { + if vc, ok := v.Value.(binding.ExternalFloatList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//get-item: arg 1: expected native of type binding.ExternalFloatList") + return env.NewError("Go(binding.ExternalFloatList)//get-item: arg 1: " + "expected native of type binding.ExternalFloatList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatList)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//get-item: arg 1: expected native") + return env.NewError("Go(binding.ExternalFloatList)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//get-item: arg 2: expected integer") + return env.NewError("Go(binding.ExternalFloatList)//get-item: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -114026,31 +114700,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalFloatList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloatList)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalFloatList) - if !ok { + if vc, ok := v.Value.(binding.ExternalFloatList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//get-value: arg 1: expected native of type binding.ExternalFloatList") + return env.NewError("Go(binding.ExternalFloatList)//get-value: arg 1: " + "expected native of type binding.ExternalFloatList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatList)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//get-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalFloatList)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//get-value: arg 2: expected integer") + return env.NewError("Go(binding.ExternalFloatList)//get-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object @@ -114077,24 +114751,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalFloatList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//length: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloatList)//length: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalFloatList) - if !ok { + if vc, ok := v.Value.(binding.ExternalFloatList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//length: arg 1: expected native of type binding.ExternalFloatList") + return env.NewError("Go(binding.ExternalFloatList)//length: arg 1: " + "expected native of type binding.ExternalFloatList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//length: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatList)//length: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//length: arg 1: expected native") + return env.NewError("Go(binding.ExternalFloatList)//length: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Length() var res0Obj env.Object @@ -114113,31 +114787,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalFloatList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloatList)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalFloatList) - if !ok { + if vc, ok := v.Value.(binding.ExternalFloatList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//prepend: arg 1: expected native of type binding.ExternalFloatList") + return env.NewError("Go(binding.ExternalFloatList)//prepend: arg 1: " + "expected native of type binding.ExternalFloatList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatList)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//prepend: arg 1: expected native") + return env.NewError("Go(binding.ExternalFloatList)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val float64 - if v, ok := arg1.(env.Decimal); ok { - arg1Val = float64(v.Value) + if vc, ok := arg1.(env.Decimal); ok { + arg1Val = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//prepend: arg 2: expected decimal") + return env.NewError("Go(binding.ExternalFloatList)//prepend: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } resErr := arg0Val.Prepend(arg1Val) var resErrObj env.Object @@ -114162,24 +114836,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalFloatList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//reload: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloatList)//reload: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalFloatList) - if !ok { + if vc, ok := v.Value.(binding.ExternalFloatList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//reload: arg 1: expected native of type binding.ExternalFloatList") + return env.NewError("Go(binding.ExternalFloatList)//reload: arg 1: " + "expected native of type binding.ExternalFloatList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//reload: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatList)//reload: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//reload: arg 1: expected native") + return env.NewError("Go(binding.ExternalFloatList)//reload: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Reload() var resErrObj env.Object @@ -114204,24 +114878,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalFloatList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloatList)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalFloatList) - if !ok { + if vc, ok := v.Value.(binding.ExternalFloatList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//remove-listener: arg 1: expected native of type binding.ExternalFloatList") + return env.NewError("Go(binding.ExternalFloatList)//remove-listener: arg 1: " + "expected native of type binding.ExternalFloatList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatList)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalFloatList)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -114230,24 +114904,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloatList)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalFloatList)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatList)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalFloatList)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -114264,53 +114938,46 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalFloatList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloatList)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalFloatList) - if !ok { + if vc, ok := v.Value.(binding.ExternalFloatList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//set: arg 1: expected native of type binding.ExternalFloatList") + return env.NewError("Go(binding.ExternalFloatList)//set: arg 1: " + "expected native of type binding.ExternalFloatList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatList)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//set: arg 1: expected native") + return env.NewError("Go(binding.ExternalFloatList)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []float64 switch v := arg1.(type) { case env.Block: arg1Val = make([]float64, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.Decimal); ok { - arg1Val[i] = float64(v.Value) + if vc, ok := it.(env.Decimal); ok { + arg1Val[i] = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//set: arg 2: block item: expected decimal") + return env.NewError("Go(binding.ExternalFloatList)//set: arg 2: " + "block item: " + "expected decimal, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]float64) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//set: arg 2: expected native of type []float64") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatList)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//set: arg 2: expected block, native or nil") + return env.NewError("Go(binding.ExternalFloatList)//set: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -114335,38 +115002,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalFloatList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloatList)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalFloatList) - if !ok { + if vc, ok := v.Value.(binding.ExternalFloatList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//set-value: arg 1: expected native of type binding.ExternalFloatList") + return env.NewError("Go(binding.ExternalFloatList)//set-value: arg 1: " + "expected native of type binding.ExternalFloatList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatList)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//set-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalFloatList)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//set-value: arg 2: expected integer") + return env.NewError("Go(binding.ExternalFloatList)//set-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val float64 - if v, ok := arg2.(env.Decimal); ok { - arg2Val = float64(v.Value) + if vc, ok := arg2.(env.Decimal); ok { + arg2Val = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatList)//set-value: arg 3: expected decimal") + return env.NewError("Go(binding.ExternalFloatList)//set-value: arg 3: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg2)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -114391,24 +115058,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalFloatTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloatTree)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalFloatTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalFloatTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//add-listener: arg 1: expected native of type binding.ExternalFloatTree") + return env.NewError("Go(binding.ExternalFloatTree)//add-listener: arg 1: " + "expected native of type binding.ExternalFloatTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatTree)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalFloatTree)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -114417,24 +115084,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloatTree)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalFloatTree)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatTree)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalFloatTree)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -114451,45 +115118,45 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalFloatTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloatTree)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalFloatTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalFloatTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//append: arg 1: expected native of type binding.ExternalFloatTree") + return env.NewError("Go(binding.ExternalFloatTree)//append: arg 1: " + "expected native of type binding.ExternalFloatTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatTree)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//append: arg 1: expected native") + return env.NewError("Go(binding.ExternalFloatTree)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//append: arg 2: expected string") + return env.NewError("Go(binding.ExternalFloatTree)//append: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//append: arg 3: expected string") + return env.NewError("Go(binding.ExternalFloatTree)//append: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val float64 - if v, ok := arg3.(env.Decimal); ok { - arg3Val = float64(v.Value) + if vc, ok := arg3.(env.Decimal); ok { + arg3Val = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//append: arg 4: expected decimal") + return env.NewError("Go(binding.ExternalFloatTree)//append: arg 4: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg3)) } resErr := arg0Val.Append(arg1Val, arg2Val, arg3Val) var resErrObj env.Object @@ -114514,31 +115181,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalFloatTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//child-i-ds: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloatTree)//child-i-ds: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalFloatTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalFloatTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//child-i-ds: arg 1: expected native of type binding.ExternalFloatTree") + return env.NewError("Go(binding.ExternalFloatTree)//child-i-ds: arg 1: " + "expected native of type binding.ExternalFloatTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//child-i-ds: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatTree)//child-i-ds: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//child-i-ds: arg 1: expected native") + return env.NewError("Go(binding.ExternalFloatTree)//child-i-ds: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//child-i-ds: arg 2: expected string") + return env.NewError("Go(binding.ExternalFloatTree)//child-i-ds: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := arg0Val.ChildIDs(arg1Val) var res0Obj env.Object @@ -114563,24 +115230,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalFloatTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloatTree)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalFloatTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalFloatTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//get: arg 1: expected native of type binding.ExternalFloatTree") + return env.NewError("Go(binding.ExternalFloatTree)//get: arg 1: " + "expected native of type binding.ExternalFloatTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatTree)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//get: arg 1: expected native") + return env.NewError("Go(binding.ExternalFloatTree)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, res1, resErr := arg0Val.Get() var res0Obj env.Object @@ -114634,52 +115301,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalFloatTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloatTree)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalFloatTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalFloatTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//get-item: arg 1: expected native of type binding.ExternalFloatTree") + return env.NewError("Go(binding.ExternalFloatTree)//get-item: arg 1: " + "expected native of type binding.ExternalFloatTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatTree)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//get-item: arg 1: expected native") + return env.NewError("Go(binding.ExternalFloatTree)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//get-item: arg 2: expected string") + return env.NewError("Go(binding.ExternalFloatTree)//get-item: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -114702,31 +115352,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalFloatTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloatTree)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalFloatTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalFloatTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//get-value: arg 1: expected native of type binding.ExternalFloatTree") + return env.NewError("Go(binding.ExternalFloatTree)//get-value: arg 1: " + "expected native of type binding.ExternalFloatTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatTree)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//get-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalFloatTree)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//get-value: arg 2: expected string") + return env.NewError("Go(binding.ExternalFloatTree)//get-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object @@ -114753,45 +115403,45 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalFloatTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloatTree)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalFloatTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalFloatTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//prepend: arg 1: expected native of type binding.ExternalFloatTree") + return env.NewError("Go(binding.ExternalFloatTree)//prepend: arg 1: " + "expected native of type binding.ExternalFloatTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatTree)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//prepend: arg 1: expected native") + return env.NewError("Go(binding.ExternalFloatTree)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//prepend: arg 2: expected string") + return env.NewError("Go(binding.ExternalFloatTree)//prepend: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//prepend: arg 3: expected string") + return env.NewError("Go(binding.ExternalFloatTree)//prepend: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val float64 - if v, ok := arg3.(env.Decimal); ok { - arg3Val = float64(v.Value) + if vc, ok := arg3.(env.Decimal); ok { + arg3Val = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//prepend: arg 4: expected decimal") + return env.NewError("Go(binding.ExternalFloatTree)//prepend: arg 4: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg3)) } resErr := arg0Val.Prepend(arg1Val, arg2Val, arg3Val) var resErrObj env.Object @@ -114816,24 +115466,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalFloatTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//reload: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloatTree)//reload: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalFloatTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalFloatTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//reload: arg 1: expected native of type binding.ExternalFloatTree") + return env.NewError("Go(binding.ExternalFloatTree)//reload: arg 1: " + "expected native of type binding.ExternalFloatTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//reload: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatTree)//reload: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//reload: arg 1: expected native") + return env.NewError("Go(binding.ExternalFloatTree)//reload: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Reload() var resErrObj env.Object @@ -114858,24 +115508,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalFloatTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloatTree)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalFloatTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalFloatTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//remove-listener: arg 1: expected native of type binding.ExternalFloatTree") + return env.NewError("Go(binding.ExternalFloatTree)//remove-listener: arg 1: " + "expected native of type binding.ExternalFloatTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatTree)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalFloatTree)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -114884,24 +115534,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloatTree)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalFloatTree)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatTree)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalFloatTree)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -114918,69 +115568,62 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalFloatTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloatTree)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalFloatTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalFloatTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set: arg 1: expected native of type binding.ExternalFloatTree") + return env.NewError("Go(binding.ExternalFloatTree)//set: arg 1: " + "expected native of type binding.ExternalFloatTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatTree)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set: arg 1: expected native") + return env.NewError("Go(binding.ExternalFloatTree)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val map[string][]string switch v := arg1.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set: arg 2: expected block to have length of multiple of 2") + return env.NewError("Go(binding.ExternalFloatTree)//set: arg 2: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } arg1Val = make(map[string][]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set: arg 2: map key: expected string") + return env.NewError("Go(binding.ExternalFloatTree)//set: arg 2: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV []string switch v := v.Series.S[i+1].(type) { case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set: arg 2: map value: block item: expected string") + return env.NewError("Go(binding.ExternalFloatTree)//set: arg 2: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set: arg 2: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set: arg 2: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatTree)//set: arg 2: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set: arg 2: map value: expected block, native or nil") + return env.NewError("Go(binding.ExternalFloatTree)//set: arg 2: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } @@ -114993,71 +115636,57 @@ var Builtins = map[string]*env.Builtin{ case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set: arg 2: map value: block item: expected string") + return env.NewError("Go(binding.ExternalFloatTree)//set: arg 2: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set: arg 2: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set: arg 2: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatTree)//set: arg 2: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set: arg 2: map value: expected block, native or nil") + return env.NewError("Go(binding.ExternalFloatTree)//set: arg 2: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } - case env.Native: - var ok bool - arg1Val, ok = v.Value.(map[string][]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set: arg 2: expected native of type map[string][]string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatTree)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set: arg 2: expected native, block, dict or nil") + return env.NewError("Go(binding.ExternalFloatTree)//set: arg 2: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } var arg2Val map[string]float64 switch v := arg2.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set: arg 3: expected block to have length of multiple of 2") + return env.NewError("Go(binding.ExternalFloatTree)//set: arg 3: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } arg2Val = make(map[string]float64, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set: arg 3: map key: expected string") + return env.NewError("Go(binding.ExternalFloatTree)//set: arg 3: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV float64 - if v, ok := v.Series.S[i+1].(env.Decimal); ok { - mapV = float64(v.Value) + if vc, ok := v.Series.S[i+1].(env.Decimal); ok { + mapV = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set: arg 3: map value: expected decimal") + return env.NewError("Go(binding.ExternalFloatTree)//set: arg 3: " + "map value: " + "expected decimal, but got " + objectDebugString(ps.Idx, v.Series.S[i+1])) } arg2Val[mapK] = mapV } @@ -115066,30 +115695,23 @@ var Builtins = map[string]*env.Builtin{ for dictK, dictV := range v.Data { mapK := dictK var mapV float64 - if v, ok := dictV.(env.Decimal); ok { - mapV = float64(v.Value) + if vc, ok := dictV.(env.Decimal); ok { + mapV = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set: arg 3: map value: expected decimal") + return env.NewError("Go(binding.ExternalFloatTree)//set: arg 3: " + "map value: " + "expected decimal, but got " + objectDebugString(ps.Idx, dictV)) } arg2Val[mapK] = mapV } - case env.Native: - var ok bool - arg2Val, ok = v.Value.(map[string]float64) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set: arg 3: expected native of type map[string]float64") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatTree)//set: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set: arg 3: expected native, block, dict or nil") + return env.NewError("Go(binding.ExternalFloatTree)//set: arg 3: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val, arg2Val) var resErrObj env.Object @@ -115114,38 +115736,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalFloatTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalFloatTree)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalFloatTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalFloatTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set-value: arg 1: expected native of type binding.ExternalFloatTree") + return env.NewError("Go(binding.ExternalFloatTree)//set-value: arg 1: " + "expected native of type binding.ExternalFloatTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalFloatTree)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalFloatTree)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set-value: arg 2: expected string") + return env.NewError("Go(binding.ExternalFloatTree)//set-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val float64 - if v, ok := arg2.(env.Decimal); ok { - arg2Val = float64(v.Value) + if vc, ok := arg2.(env.Decimal); ok { + arg2Val = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalFloatTree)//set-value: arg 3: expected decimal") + return env.NewError("Go(binding.ExternalFloatTree)//set-value: arg 3: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg2)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -115170,24 +115792,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalInt(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalInt)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalInt)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalInt) - if !ok { + if vc, ok := v.Value.(binding.ExternalInt); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalInt)//add-listener: arg 1: expected native of type binding.ExternalInt") + return env.NewError("Go(binding.ExternalInt)//add-listener: arg 1: " + "expected native of type binding.ExternalInt, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalInt)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalInt)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalInt)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalInt)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -115196,24 +115818,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalInt)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalInt)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalInt)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalInt)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalInt)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalInt)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalInt)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalInt)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -115230,24 +115852,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalInt(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalInt)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalInt)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalInt) - if !ok { + if vc, ok := v.Value.(binding.ExternalInt); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalInt)//get: arg 1: expected native of type binding.ExternalInt") + return env.NewError("Go(binding.ExternalInt)//get: arg 1: " + "expected native of type binding.ExternalInt, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalInt)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalInt)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalInt)//get: arg 1: expected native") + return env.NewError("Go(binding.ExternalInt)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object @@ -115274,24 +115896,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalInt(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalInt)//reload: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalInt)//reload: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalInt) - if !ok { + if vc, ok := v.Value.(binding.ExternalInt); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalInt)//reload: arg 1: expected native of type binding.ExternalInt") + return env.NewError("Go(binding.ExternalInt)//reload: arg 1: " + "expected native of type binding.ExternalInt, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalInt)//reload: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalInt)//reload: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalInt)//reload: arg 1: expected native") + return env.NewError("Go(binding.ExternalInt)//reload: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Reload() var resErrObj env.Object @@ -115316,24 +115938,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalInt(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalInt)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalInt)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalInt) - if !ok { + if vc, ok := v.Value.(binding.ExternalInt); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalInt)//remove-listener: arg 1: expected native of type binding.ExternalInt") + return env.NewError("Go(binding.ExternalInt)//remove-listener: arg 1: " + "expected native of type binding.ExternalInt, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalInt)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalInt)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalInt)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalInt)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -115342,24 +115964,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalInt)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalInt)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalInt)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalInt)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalInt)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalInt)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalInt)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalInt)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -115376,31 +115998,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalInt(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalInt)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalInt)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalInt) - if !ok { + if vc, ok := v.Value.(binding.ExternalInt); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalInt)//set: arg 1: expected native of type binding.ExternalInt") + return env.NewError("Go(binding.ExternalInt)//set: arg 1: " + "expected native of type binding.ExternalInt, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalInt)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalInt)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalInt)//set: arg 1: expected native") + return env.NewError("Go(binding.ExternalInt)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalInt)//set: arg 2: expected integer") + return env.NewError("Go(binding.ExternalInt)//set: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -115425,24 +116047,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalIntList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalIntList)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalIntList) - if !ok { + if vc, ok := v.Value.(binding.ExternalIntList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//add-listener: arg 1: expected native of type binding.ExternalIntList") + return env.NewError("Go(binding.ExternalIntList)//add-listener: arg 1: " + "expected native of type binding.ExternalIntList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntList)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalIntList)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -115451,24 +116073,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalIntList)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalIntList)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntList)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalIntList)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -115485,31 +116107,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalIntList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalIntList)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalIntList) - if !ok { + if vc, ok := v.Value.(binding.ExternalIntList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//append: arg 1: expected native of type binding.ExternalIntList") + return env.NewError("Go(binding.ExternalIntList)//append: arg 1: " + "expected native of type binding.ExternalIntList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntList)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//append: arg 1: expected native") + return env.NewError("Go(binding.ExternalIntList)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//append: arg 2: expected integer") + return env.NewError("Go(binding.ExternalIntList)//append: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } resErr := arg0Val.Append(arg1Val) var resErrObj env.Object @@ -115534,24 +116156,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalIntList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalIntList)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalIntList) - if !ok { + if vc, ok := v.Value.(binding.ExternalIntList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//get: arg 1: expected native of type binding.ExternalIntList") + return env.NewError("Go(binding.ExternalIntList)//get: arg 1: " + "expected native of type binding.ExternalIntList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntList)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//get: arg 1: expected native") + return env.NewError("Go(binding.ExternalIntList)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object @@ -115584,52 +116206,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalIntList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalIntList)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalIntList) - if !ok { + if vc, ok := v.Value.(binding.ExternalIntList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//get-item: arg 1: expected native of type binding.ExternalIntList") + return env.NewError("Go(binding.ExternalIntList)//get-item: arg 1: " + "expected native of type binding.ExternalIntList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntList)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//get-item: arg 1: expected native") + return env.NewError("Go(binding.ExternalIntList)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//get-item: arg 2: expected integer") + return env.NewError("Go(binding.ExternalIntList)//get-item: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -115652,31 +116257,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalIntList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalIntList)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalIntList) - if !ok { + if vc, ok := v.Value.(binding.ExternalIntList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//get-value: arg 1: expected native of type binding.ExternalIntList") + return env.NewError("Go(binding.ExternalIntList)//get-value: arg 1: " + "expected native of type binding.ExternalIntList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntList)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//get-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalIntList)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//get-value: arg 2: expected integer") + return env.NewError("Go(binding.ExternalIntList)//get-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object @@ -115703,24 +116308,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalIntList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//length: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalIntList)//length: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalIntList) - if !ok { + if vc, ok := v.Value.(binding.ExternalIntList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//length: arg 1: expected native of type binding.ExternalIntList") + return env.NewError("Go(binding.ExternalIntList)//length: arg 1: " + "expected native of type binding.ExternalIntList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//length: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntList)//length: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//length: arg 1: expected native") + return env.NewError("Go(binding.ExternalIntList)//length: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Length() var res0Obj env.Object @@ -115739,31 +116344,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalIntList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalIntList)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalIntList) - if !ok { + if vc, ok := v.Value.(binding.ExternalIntList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//prepend: arg 1: expected native of type binding.ExternalIntList") + return env.NewError("Go(binding.ExternalIntList)//prepend: arg 1: " + "expected native of type binding.ExternalIntList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntList)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//prepend: arg 1: expected native") + return env.NewError("Go(binding.ExternalIntList)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//prepend: arg 2: expected integer") + return env.NewError("Go(binding.ExternalIntList)//prepend: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } resErr := arg0Val.Prepend(arg1Val) var resErrObj env.Object @@ -115788,24 +116393,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalIntList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//reload: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalIntList)//reload: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalIntList) - if !ok { + if vc, ok := v.Value.(binding.ExternalIntList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//reload: arg 1: expected native of type binding.ExternalIntList") + return env.NewError("Go(binding.ExternalIntList)//reload: arg 1: " + "expected native of type binding.ExternalIntList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//reload: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntList)//reload: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//reload: arg 1: expected native") + return env.NewError("Go(binding.ExternalIntList)//reload: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Reload() var resErrObj env.Object @@ -115830,24 +116435,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalIntList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalIntList)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalIntList) - if !ok { + if vc, ok := v.Value.(binding.ExternalIntList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//remove-listener: arg 1: expected native of type binding.ExternalIntList") + return env.NewError("Go(binding.ExternalIntList)//remove-listener: arg 1: " + "expected native of type binding.ExternalIntList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntList)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalIntList)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -115856,24 +116461,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalIntList)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalIntList)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntList)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalIntList)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -115890,53 +116495,46 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalIntList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalIntList)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalIntList) - if !ok { + if vc, ok := v.Value.(binding.ExternalIntList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//set: arg 1: expected native of type binding.ExternalIntList") + return env.NewError("Go(binding.ExternalIntList)//set: arg 1: " + "expected native of type binding.ExternalIntList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntList)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//set: arg 1: expected native") + return env.NewError("Go(binding.ExternalIntList)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []int switch v := arg1.(type) { case env.Block: arg1Val = make([]int, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.Integer); ok { - arg1Val[i] = int(v.Value) + if vc, ok := it.(env.Integer); ok { + arg1Val[i] = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//set: arg 2: block item: expected integer") + return env.NewError("Go(binding.ExternalIntList)//set: arg 2: " + "block item: " + "expected integer, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]int) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//set: arg 2: expected native of type []int") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntList)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//set: arg 2: expected block, native or nil") + return env.NewError("Go(binding.ExternalIntList)//set: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -115961,38 +116559,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalIntList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalIntList)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalIntList) - if !ok { + if vc, ok := v.Value.(binding.ExternalIntList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//set-value: arg 1: expected native of type binding.ExternalIntList") + return env.NewError("Go(binding.ExternalIntList)//set-value: arg 1: " + "expected native of type binding.ExternalIntList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntList)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//set-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalIntList)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//set-value: arg 2: expected integer") + return env.NewError("Go(binding.ExternalIntList)//set-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val int - if v, ok := arg2.(env.Integer); ok { - arg2Val = int(v.Value) + if vc, ok := arg2.(env.Integer); ok { + arg2Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntList)//set-value: arg 3: expected integer") + return env.NewError("Go(binding.ExternalIntList)//set-value: arg 3: " + "expected integer, but got " + objectDebugString(ps.Idx, arg2)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -116017,24 +116615,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalIntTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalIntTree)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalIntTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalIntTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//add-listener: arg 1: expected native of type binding.ExternalIntTree") + return env.NewError("Go(binding.ExternalIntTree)//add-listener: arg 1: " + "expected native of type binding.ExternalIntTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntTree)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalIntTree)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -116043,24 +116641,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalIntTree)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalIntTree)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntTree)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalIntTree)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -116077,45 +116675,45 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalIntTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalIntTree)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalIntTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalIntTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//append: arg 1: expected native of type binding.ExternalIntTree") + return env.NewError("Go(binding.ExternalIntTree)//append: arg 1: " + "expected native of type binding.ExternalIntTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntTree)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//append: arg 1: expected native") + return env.NewError("Go(binding.ExternalIntTree)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//append: arg 2: expected string") + return env.NewError("Go(binding.ExternalIntTree)//append: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//append: arg 3: expected string") + return env.NewError("Go(binding.ExternalIntTree)//append: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val int - if v, ok := arg3.(env.Integer); ok { - arg3Val = int(v.Value) + if vc, ok := arg3.(env.Integer); ok { + arg3Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//append: arg 4: expected integer") + return env.NewError("Go(binding.ExternalIntTree)//append: arg 4: " + "expected integer, but got " + objectDebugString(ps.Idx, arg3)) } resErr := arg0Val.Append(arg1Val, arg2Val, arg3Val) var resErrObj env.Object @@ -116140,31 +116738,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalIntTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//child-i-ds: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalIntTree)//child-i-ds: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalIntTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalIntTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//child-i-ds: arg 1: expected native of type binding.ExternalIntTree") + return env.NewError("Go(binding.ExternalIntTree)//child-i-ds: arg 1: " + "expected native of type binding.ExternalIntTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//child-i-ds: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntTree)//child-i-ds: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//child-i-ds: arg 1: expected native") + return env.NewError("Go(binding.ExternalIntTree)//child-i-ds: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//child-i-ds: arg 2: expected string") + return env.NewError("Go(binding.ExternalIntTree)//child-i-ds: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := arg0Val.ChildIDs(arg1Val) var res0Obj env.Object @@ -116189,24 +116787,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalIntTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalIntTree)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalIntTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalIntTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//get: arg 1: expected native of type binding.ExternalIntTree") + return env.NewError("Go(binding.ExternalIntTree)//get: arg 1: " + "expected native of type binding.ExternalIntTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntTree)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//get: arg 1: expected native") + return env.NewError("Go(binding.ExternalIntTree)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, res1, resErr := arg0Val.Get() var res0Obj env.Object @@ -116260,52 +116858,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalIntTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalIntTree)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalIntTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalIntTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//get-item: arg 1: expected native of type binding.ExternalIntTree") + return env.NewError("Go(binding.ExternalIntTree)//get-item: arg 1: " + "expected native of type binding.ExternalIntTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntTree)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//get-item: arg 1: expected native") + return env.NewError("Go(binding.ExternalIntTree)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//get-item: arg 2: expected string") + return env.NewError("Go(binding.ExternalIntTree)//get-item: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -116328,31 +116909,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalIntTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalIntTree)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalIntTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalIntTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//get-value: arg 1: expected native of type binding.ExternalIntTree") + return env.NewError("Go(binding.ExternalIntTree)//get-value: arg 1: " + "expected native of type binding.ExternalIntTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntTree)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//get-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalIntTree)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//get-value: arg 2: expected string") + return env.NewError("Go(binding.ExternalIntTree)//get-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object @@ -116379,45 +116960,45 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalIntTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalIntTree)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalIntTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalIntTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//prepend: arg 1: expected native of type binding.ExternalIntTree") + return env.NewError("Go(binding.ExternalIntTree)//prepend: arg 1: " + "expected native of type binding.ExternalIntTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntTree)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//prepend: arg 1: expected native") + return env.NewError("Go(binding.ExternalIntTree)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//prepend: arg 2: expected string") + return env.NewError("Go(binding.ExternalIntTree)//prepend: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//prepend: arg 3: expected string") + return env.NewError("Go(binding.ExternalIntTree)//prepend: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val int - if v, ok := arg3.(env.Integer); ok { - arg3Val = int(v.Value) + if vc, ok := arg3.(env.Integer); ok { + arg3Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//prepend: arg 4: expected integer") + return env.NewError("Go(binding.ExternalIntTree)//prepend: arg 4: " + "expected integer, but got " + objectDebugString(ps.Idx, arg3)) } resErr := arg0Val.Prepend(arg1Val, arg2Val, arg3Val) var resErrObj env.Object @@ -116442,24 +117023,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalIntTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//reload: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalIntTree)//reload: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalIntTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalIntTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//reload: arg 1: expected native of type binding.ExternalIntTree") + return env.NewError("Go(binding.ExternalIntTree)//reload: arg 1: " + "expected native of type binding.ExternalIntTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//reload: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntTree)//reload: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//reload: arg 1: expected native") + return env.NewError("Go(binding.ExternalIntTree)//reload: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Reload() var resErrObj env.Object @@ -116484,24 +117065,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalIntTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalIntTree)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalIntTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalIntTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//remove-listener: arg 1: expected native of type binding.ExternalIntTree") + return env.NewError("Go(binding.ExternalIntTree)//remove-listener: arg 1: " + "expected native of type binding.ExternalIntTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntTree)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalIntTree)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -116510,24 +117091,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalIntTree)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalIntTree)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntTree)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalIntTree)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -116544,69 +117125,62 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalIntTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalIntTree)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalIntTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalIntTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set: arg 1: expected native of type binding.ExternalIntTree") + return env.NewError("Go(binding.ExternalIntTree)//set: arg 1: " + "expected native of type binding.ExternalIntTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntTree)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set: arg 1: expected native") + return env.NewError("Go(binding.ExternalIntTree)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val map[string][]string switch v := arg1.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set: arg 2: expected block to have length of multiple of 2") + return env.NewError("Go(binding.ExternalIntTree)//set: arg 2: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } arg1Val = make(map[string][]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set: arg 2: map key: expected string") + return env.NewError("Go(binding.ExternalIntTree)//set: arg 2: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV []string switch v := v.Series.S[i+1].(type) { case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set: arg 2: map value: block item: expected string") + return env.NewError("Go(binding.ExternalIntTree)//set: arg 2: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set: arg 2: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set: arg 2: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntTree)//set: arg 2: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set: arg 2: map value: expected block, native or nil") + return env.NewError("Go(binding.ExternalIntTree)//set: arg 2: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } @@ -116619,71 +117193,57 @@ var Builtins = map[string]*env.Builtin{ case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set: arg 2: map value: block item: expected string") + return env.NewError("Go(binding.ExternalIntTree)//set: arg 2: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set: arg 2: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set: arg 2: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntTree)//set: arg 2: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set: arg 2: map value: expected block, native or nil") + return env.NewError("Go(binding.ExternalIntTree)//set: arg 2: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } - case env.Native: - var ok bool - arg1Val, ok = v.Value.(map[string][]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set: arg 2: expected native of type map[string][]string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntTree)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set: arg 2: expected native, block, dict or nil") + return env.NewError("Go(binding.ExternalIntTree)//set: arg 2: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } var arg2Val map[string]int switch v := arg2.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set: arg 3: expected block to have length of multiple of 2") + return env.NewError("Go(binding.ExternalIntTree)//set: arg 3: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } arg2Val = make(map[string]int, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set: arg 3: map key: expected string") + return env.NewError("Go(binding.ExternalIntTree)//set: arg 3: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV int - if v, ok := v.Series.S[i+1].(env.Integer); ok { - mapV = int(v.Value) + if vc, ok := v.Series.S[i+1].(env.Integer); ok { + mapV = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set: arg 3: map value: expected integer") + return env.NewError("Go(binding.ExternalIntTree)//set: arg 3: " + "map value: " + "expected integer, but got " + objectDebugString(ps.Idx, v.Series.S[i+1])) } arg2Val[mapK] = mapV } @@ -116692,30 +117252,23 @@ var Builtins = map[string]*env.Builtin{ for dictK, dictV := range v.Data { mapK := dictK var mapV int - if v, ok := dictV.(env.Integer); ok { - mapV = int(v.Value) + if vc, ok := dictV.(env.Integer); ok { + mapV = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set: arg 3: map value: expected integer") + return env.NewError("Go(binding.ExternalIntTree)//set: arg 3: " + "map value: " + "expected integer, but got " + objectDebugString(ps.Idx, dictV)) } arg2Val[mapK] = mapV } - case env.Native: - var ok bool - arg2Val, ok = v.Value.(map[string]int) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set: arg 3: expected native of type map[string]int") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntTree)//set: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set: arg 3: expected native, block, dict or nil") + return env.NewError("Go(binding.ExternalIntTree)//set: arg 3: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val, arg2Val) var resErrObj env.Object @@ -116740,38 +117293,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalIntTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalIntTree)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalIntTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalIntTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set-value: arg 1: expected native of type binding.ExternalIntTree") + return env.NewError("Go(binding.ExternalIntTree)//set-value: arg 1: " + "expected native of type binding.ExternalIntTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalIntTree)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalIntTree)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set-value: arg 2: expected string") + return env.NewError("Go(binding.ExternalIntTree)//set-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val int - if v, ok := arg2.(env.Integer); ok { - arg2Val = int(v.Value) + if vc, ok := arg2.(env.Integer); ok { + arg2Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalIntTree)//set-value: arg 3: expected integer") + return env.NewError("Go(binding.ExternalIntTree)//set-value: arg 3: " + "expected integer, but got " + objectDebugString(ps.Idx, arg2)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -116796,24 +117349,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalRune(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRune)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalRune) - if !ok { + if vc, ok := v.Value.(binding.ExternalRune); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//add-listener: arg 1: expected native of type binding.ExternalRune") + return env.NewError("Go(binding.ExternalRune)//add-listener: arg 1: " + "expected native of type binding.ExternalRune, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRune)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalRune)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -116822,24 +117375,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRune)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalRune)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRune)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalRune)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -116856,24 +117409,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalRune(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRune)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalRune) - if !ok { + if vc, ok := v.Value.(binding.ExternalRune); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//get: arg 1: expected native of type binding.ExternalRune") + return env.NewError("Go(binding.ExternalRune)//get: arg 1: " + "expected native of type binding.ExternalRune, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRune)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//get: arg 1: expected native") + return env.NewError("Go(binding.ExternalRune)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object @@ -116900,24 +117453,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalRune(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//reload: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRune)//reload: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalRune) - if !ok { + if vc, ok := v.Value.(binding.ExternalRune); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//reload: arg 1: expected native of type binding.ExternalRune") + return env.NewError("Go(binding.ExternalRune)//reload: arg 1: " + "expected native of type binding.ExternalRune, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//reload: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRune)//reload: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//reload: arg 1: expected native") + return env.NewError("Go(binding.ExternalRune)//reload: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Reload() var resErrObj env.Object @@ -116942,24 +117495,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalRune(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRune)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalRune) - if !ok { + if vc, ok := v.Value.(binding.ExternalRune); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//remove-listener: arg 1: expected native of type binding.ExternalRune") + return env.NewError("Go(binding.ExternalRune)//remove-listener: arg 1: " + "expected native of type binding.ExternalRune, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRune)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalRune)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -116968,24 +117521,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRune)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalRune)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRune)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalRune)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -117002,37 +117555,37 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalRune(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRune)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalRune) - if !ok { + if vc, ok := v.Value.(binding.ExternalRune); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//set: arg 1: expected native of type binding.ExternalRune") + return env.NewError("Go(binding.ExternalRune)//set: arg 1: " + "expected native of type binding.ExternalRune, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRune)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//set: arg 1: expected native") + return env.NewError("Go(binding.ExternalRune)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val rune switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//set: arg 2: expected native of type rune") + return env.NewError("Go(binding.ExternalRune)//set: arg 2: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRune)//set: arg 2: expected native") + return env.NewError("Go(binding.ExternalRune)//set: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -117057,24 +117610,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalRuneList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRuneList)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalRuneList) - if !ok { + if vc, ok := v.Value.(binding.ExternalRuneList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//add-listener: arg 1: expected native of type binding.ExternalRuneList") + return env.NewError("Go(binding.ExternalRuneList)//add-listener: arg 1: " + "expected native of type binding.ExternalRuneList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneList)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalRuneList)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -117083,24 +117636,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRuneList)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalRuneList)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneList)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalRuneList)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -117117,37 +117670,37 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalRuneList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRuneList)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalRuneList) - if !ok { + if vc, ok := v.Value.(binding.ExternalRuneList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//append: arg 1: expected native of type binding.ExternalRuneList") + return env.NewError("Go(binding.ExternalRuneList)//append: arg 1: " + "expected native of type binding.ExternalRuneList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneList)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//append: arg 1: expected native") + return env.NewError("Go(binding.ExternalRuneList)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val rune switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//append: arg 2: expected native of type rune") + return env.NewError("Go(binding.ExternalRuneList)//append: arg 2: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//append: arg 2: expected native") + return env.NewError("Go(binding.ExternalRuneList)//append: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Append(arg1Val) var resErrObj env.Object @@ -117172,24 +117725,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalRuneList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRuneList)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalRuneList) - if !ok { + if vc, ok := v.Value.(binding.ExternalRuneList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//get: arg 1: expected native of type binding.ExternalRuneList") + return env.NewError("Go(binding.ExternalRuneList)//get: arg 1: " + "expected native of type binding.ExternalRuneList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneList)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//get: arg 1: expected native") + return env.NewError("Go(binding.ExternalRuneList)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object @@ -117222,52 +117775,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalRuneList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRuneList)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalRuneList) - if !ok { + if vc, ok := v.Value.(binding.ExternalRuneList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//get-item: arg 1: expected native of type binding.ExternalRuneList") + return env.NewError("Go(binding.ExternalRuneList)//get-item: arg 1: " + "expected native of type binding.ExternalRuneList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneList)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//get-item: arg 1: expected native") + return env.NewError("Go(binding.ExternalRuneList)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//get-item: arg 2: expected integer") + return env.NewError("Go(binding.ExternalRuneList)//get-item: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -117290,31 +117826,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalRuneList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRuneList)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalRuneList) - if !ok { + if vc, ok := v.Value.(binding.ExternalRuneList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//get-value: arg 1: expected native of type binding.ExternalRuneList") + return env.NewError("Go(binding.ExternalRuneList)//get-value: arg 1: " + "expected native of type binding.ExternalRuneList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneList)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//get-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalRuneList)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//get-value: arg 2: expected integer") + return env.NewError("Go(binding.ExternalRuneList)//get-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object @@ -117341,24 +117877,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalRuneList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//length: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRuneList)//length: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalRuneList) - if !ok { + if vc, ok := v.Value.(binding.ExternalRuneList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//length: arg 1: expected native of type binding.ExternalRuneList") + return env.NewError("Go(binding.ExternalRuneList)//length: arg 1: " + "expected native of type binding.ExternalRuneList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//length: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneList)//length: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//length: arg 1: expected native") + return env.NewError("Go(binding.ExternalRuneList)//length: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Length() var res0Obj env.Object @@ -117377,37 +117913,37 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalRuneList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRuneList)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalRuneList) - if !ok { + if vc, ok := v.Value.(binding.ExternalRuneList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//prepend: arg 1: expected native of type binding.ExternalRuneList") + return env.NewError("Go(binding.ExternalRuneList)//prepend: arg 1: " + "expected native of type binding.ExternalRuneList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneList)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//prepend: arg 1: expected native") + return env.NewError("Go(binding.ExternalRuneList)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val rune switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//prepend: arg 2: expected native of type rune") + return env.NewError("Go(binding.ExternalRuneList)//prepend: arg 2: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//prepend: arg 2: expected native") + return env.NewError("Go(binding.ExternalRuneList)//prepend: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Prepend(arg1Val) var resErrObj env.Object @@ -117432,24 +117968,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalRuneList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//reload: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRuneList)//reload: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalRuneList) - if !ok { + if vc, ok := v.Value.(binding.ExternalRuneList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//reload: arg 1: expected native of type binding.ExternalRuneList") + return env.NewError("Go(binding.ExternalRuneList)//reload: arg 1: " + "expected native of type binding.ExternalRuneList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//reload: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneList)//reload: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//reload: arg 1: expected native") + return env.NewError("Go(binding.ExternalRuneList)//reload: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Reload() var resErrObj env.Object @@ -117474,24 +118010,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalRuneList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRuneList)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalRuneList) - if !ok { + if vc, ok := v.Value.(binding.ExternalRuneList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//remove-listener: arg 1: expected native of type binding.ExternalRuneList") + return env.NewError("Go(binding.ExternalRuneList)//remove-listener: arg 1: " + "expected native of type binding.ExternalRuneList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneList)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalRuneList)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -117500,24 +118036,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRuneList)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalRuneList)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneList)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalRuneList)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -117534,24 +118070,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalRuneList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRuneList)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalRuneList) - if !ok { + if vc, ok := v.Value.(binding.ExternalRuneList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//set: arg 1: expected native of type binding.ExternalRuneList") + return env.NewError("Go(binding.ExternalRuneList)//set: arg 1: " + "expected native of type binding.ExternalRuneList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneList)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//set: arg 1: expected native") + return env.NewError("Go(binding.ExternalRuneList)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []rune switch v := arg1.(type) { @@ -117560,33 +118096,26 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg1Val[i], ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg1Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//set: arg 2: block item: expected native of type rune") + return env.NewError("Go(binding.ExternalRuneList)//set: arg 2: " + "block item: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//set: arg 2: block item: expected native") + return env.NewError("Go(binding.ExternalRuneList)//set: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]rune) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//set: arg 2: expected native of type []rune") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneList)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//set: arg 2: expected block, native or nil") + return env.NewError("Go(binding.ExternalRuneList)//set: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -117611,44 +118140,44 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalRuneList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRuneList)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalRuneList) - if !ok { + if vc, ok := v.Value.(binding.ExternalRuneList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//set-value: arg 1: expected native of type binding.ExternalRuneList") + return env.NewError("Go(binding.ExternalRuneList)//set-value: arg 1: " + "expected native of type binding.ExternalRuneList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneList)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//set-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalRuneList)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//set-value: arg 2: expected integer") + return env.NewError("Go(binding.ExternalRuneList)//set-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val rune switch v := arg2.(type) { case env.Native: - var ok bool - arg2Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//set-value: arg 3: expected native of type rune") + return env.NewError("Go(binding.ExternalRuneList)//set-value: arg 3: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneList)//set-value: arg 3: expected native") + return env.NewError("Go(binding.ExternalRuneList)//set-value: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -117673,24 +118202,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalRuneTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRuneTree)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalRuneTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalRuneTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//add-listener: arg 1: expected native of type binding.ExternalRuneTree") + return env.NewError("Go(binding.ExternalRuneTree)//add-listener: arg 1: " + "expected native of type binding.ExternalRuneTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneTree)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalRuneTree)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -117699,24 +118228,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRuneTree)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalRuneTree)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneTree)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalRuneTree)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -117733,51 +118262,51 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalRuneTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRuneTree)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalRuneTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalRuneTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//append: arg 1: expected native of type binding.ExternalRuneTree") + return env.NewError("Go(binding.ExternalRuneTree)//append: arg 1: " + "expected native of type binding.ExternalRuneTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneTree)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//append: arg 1: expected native") + return env.NewError("Go(binding.ExternalRuneTree)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//append: arg 2: expected string") + return env.NewError("Go(binding.ExternalRuneTree)//append: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//append: arg 3: expected string") + return env.NewError("Go(binding.ExternalRuneTree)//append: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val rune switch v := arg3.(type) { case env.Native: - var ok bool - arg3Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg3Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//append: arg 4: expected native of type rune") + return env.NewError("Go(binding.ExternalRuneTree)//append: arg 4: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//append: arg 4: expected native") + return env.NewError("Go(binding.ExternalRuneTree)//append: arg 4: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Append(arg1Val, arg2Val, arg3Val) var resErrObj env.Object @@ -117802,31 +118331,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalRuneTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//child-i-ds: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRuneTree)//child-i-ds: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalRuneTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalRuneTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//child-i-ds: arg 1: expected native of type binding.ExternalRuneTree") + return env.NewError("Go(binding.ExternalRuneTree)//child-i-ds: arg 1: " + "expected native of type binding.ExternalRuneTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//child-i-ds: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneTree)//child-i-ds: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//child-i-ds: arg 1: expected native") + return env.NewError("Go(binding.ExternalRuneTree)//child-i-ds: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//child-i-ds: arg 2: expected string") + return env.NewError("Go(binding.ExternalRuneTree)//child-i-ds: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := arg0Val.ChildIDs(arg1Val) var res0Obj env.Object @@ -117851,24 +118380,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalRuneTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRuneTree)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalRuneTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalRuneTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//get: arg 1: expected native of type binding.ExternalRuneTree") + return env.NewError("Go(binding.ExternalRuneTree)//get: arg 1: " + "expected native of type binding.ExternalRuneTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneTree)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//get: arg 1: expected native") + return env.NewError("Go(binding.ExternalRuneTree)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, res1, resErr := arg0Val.Get() var res0Obj env.Object @@ -117922,52 +118451,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalRuneTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRuneTree)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalRuneTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalRuneTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//get-item: arg 1: expected native of type binding.ExternalRuneTree") + return env.NewError("Go(binding.ExternalRuneTree)//get-item: arg 1: " + "expected native of type binding.ExternalRuneTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneTree)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//get-item: arg 1: expected native") + return env.NewError("Go(binding.ExternalRuneTree)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//get-item: arg 2: expected string") + return env.NewError("Go(binding.ExternalRuneTree)//get-item: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -117990,31 +118502,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalRuneTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRuneTree)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalRuneTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalRuneTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//get-value: arg 1: expected native of type binding.ExternalRuneTree") + return env.NewError("Go(binding.ExternalRuneTree)//get-value: arg 1: " + "expected native of type binding.ExternalRuneTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneTree)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//get-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalRuneTree)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//get-value: arg 2: expected string") + return env.NewError("Go(binding.ExternalRuneTree)//get-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object @@ -118041,51 +118553,51 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalRuneTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRuneTree)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalRuneTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalRuneTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//prepend: arg 1: expected native of type binding.ExternalRuneTree") + return env.NewError("Go(binding.ExternalRuneTree)//prepend: arg 1: " + "expected native of type binding.ExternalRuneTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneTree)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//prepend: arg 1: expected native") + return env.NewError("Go(binding.ExternalRuneTree)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//prepend: arg 2: expected string") + return env.NewError("Go(binding.ExternalRuneTree)//prepend: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//prepend: arg 3: expected string") + return env.NewError("Go(binding.ExternalRuneTree)//prepend: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val rune switch v := arg3.(type) { case env.Native: - var ok bool - arg3Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg3Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//prepend: arg 4: expected native of type rune") + return env.NewError("Go(binding.ExternalRuneTree)//prepend: arg 4: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//prepend: arg 4: expected native") + return env.NewError("Go(binding.ExternalRuneTree)//prepend: arg 4: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Prepend(arg1Val, arg2Val, arg3Val) var resErrObj env.Object @@ -118110,24 +118622,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalRuneTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//reload: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRuneTree)//reload: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalRuneTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalRuneTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//reload: arg 1: expected native of type binding.ExternalRuneTree") + return env.NewError("Go(binding.ExternalRuneTree)//reload: arg 1: " + "expected native of type binding.ExternalRuneTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//reload: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneTree)//reload: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//reload: arg 1: expected native") + return env.NewError("Go(binding.ExternalRuneTree)//reload: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Reload() var resErrObj env.Object @@ -118152,24 +118664,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalRuneTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRuneTree)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalRuneTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalRuneTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//remove-listener: arg 1: expected native of type binding.ExternalRuneTree") + return env.NewError("Go(binding.ExternalRuneTree)//remove-listener: arg 1: " + "expected native of type binding.ExternalRuneTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneTree)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalRuneTree)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -118178,24 +118690,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRuneTree)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalRuneTree)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneTree)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalRuneTree)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -118212,69 +118724,62 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalRuneTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRuneTree)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalRuneTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalRuneTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set: arg 1: expected native of type binding.ExternalRuneTree") + return env.NewError("Go(binding.ExternalRuneTree)//set: arg 1: " + "expected native of type binding.ExternalRuneTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneTree)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set: arg 1: expected native") + return env.NewError("Go(binding.ExternalRuneTree)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val map[string][]string switch v := arg1.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set: arg 2: expected block to have length of multiple of 2") + return env.NewError("Go(binding.ExternalRuneTree)//set: arg 2: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } arg1Val = make(map[string][]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set: arg 2: map key: expected string") + return env.NewError("Go(binding.ExternalRuneTree)//set: arg 2: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV []string switch v := v.Series.S[i+1].(type) { case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set: arg 2: map value: block item: expected string") + return env.NewError("Go(binding.ExternalRuneTree)//set: arg 2: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set: arg 2: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set: arg 2: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneTree)//set: arg 2: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set: arg 2: map value: expected block, native or nil") + return env.NewError("Go(binding.ExternalRuneTree)//set: arg 2: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } @@ -118287,77 +118792,63 @@ var Builtins = map[string]*env.Builtin{ case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set: arg 2: map value: block item: expected string") + return env.NewError("Go(binding.ExternalRuneTree)//set: arg 2: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set: arg 2: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set: arg 2: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneTree)//set: arg 2: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set: arg 2: map value: expected block, native or nil") + return env.NewError("Go(binding.ExternalRuneTree)//set: arg 2: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } - case env.Native: - var ok bool - arg1Val, ok = v.Value.(map[string][]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set: arg 2: expected native of type map[string][]string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneTree)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set: arg 2: expected native, block, dict or nil") + return env.NewError("Go(binding.ExternalRuneTree)//set: arg 2: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } var arg2Val map[string]rune switch v := arg2.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set: arg 3: expected block to have length of multiple of 2") + return env.NewError("Go(binding.ExternalRuneTree)//set: arg 3: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } arg2Val = make(map[string]rune, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set: arg 3: map key: expected string") + return env.NewError("Go(binding.ExternalRuneTree)//set: arg 3: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV rune switch v := v.Series.S[i+1].(type) { case env.Native: - var ok bool - mapV, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + mapV = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set: arg 3: map value: expected native of type rune") + return env.NewError("Go(binding.ExternalRuneTree)//set: arg 3: " + "map value: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set: arg 3: map value: expected native") + return env.NewError("Go(binding.ExternalRuneTree)//set: arg 3: " + "map value: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg2Val[mapK] = mapV } @@ -118368,34 +118859,27 @@ var Builtins = map[string]*env.Builtin{ var mapV rune switch v := dictV.(type) { case env.Native: - var ok bool - mapV, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + mapV = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set: arg 3: map value: expected native of type rune") + return env.NewError("Go(binding.ExternalRuneTree)//set: arg 3: " + "map value: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set: arg 3: map value: expected native") + return env.NewError("Go(binding.ExternalRuneTree)//set: arg 3: " + "map value: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg2Val[mapK] = mapV } - case env.Native: - var ok bool - arg2Val, ok = v.Value.(map[string]rune) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set: arg 3: expected native of type map[string]rune") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneTree)//set: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set: arg 3: expected native, block, dict or nil") + return env.NewError("Go(binding.ExternalRuneTree)//set: arg 3: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val, arg2Val) var resErrObj env.Object @@ -118420,44 +118904,44 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalRuneTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalRuneTree)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalRuneTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalRuneTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set-value: arg 1: expected native of type binding.ExternalRuneTree") + return env.NewError("Go(binding.ExternalRuneTree)//set-value: arg 1: " + "expected native of type binding.ExternalRuneTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalRuneTree)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalRuneTree)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set-value: arg 2: expected string") + return env.NewError("Go(binding.ExternalRuneTree)//set-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val rune switch v := arg2.(type) { case env.Native: - var ok bool - arg2Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set-value: arg 3: expected native of type rune") + return env.NewError("Go(binding.ExternalRuneTree)//set-value: arg 3: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalRuneTree)//set-value: arg 3: expected native") + return env.NewError("Go(binding.ExternalRuneTree)//set-value: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -118482,24 +118966,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalString(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalString)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalString)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalString) - if !ok { + if vc, ok := v.Value.(binding.ExternalString); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalString)//add-listener: arg 1: expected native of type binding.ExternalString") + return env.NewError("Go(binding.ExternalString)//add-listener: arg 1: " + "expected native of type binding.ExternalString, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalString)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalString)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalString)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalString)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -118508,24 +118992,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalString)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalString)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalString)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalString)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalString)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalString)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalString)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalString)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -118542,24 +119026,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalString(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalString)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalString)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalString) - if !ok { + if vc, ok := v.Value.(binding.ExternalString); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalString)//get: arg 1: expected native of type binding.ExternalString") + return env.NewError("Go(binding.ExternalString)//get: arg 1: " + "expected native of type binding.ExternalString, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalString)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalString)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalString)//get: arg 1: expected native") + return env.NewError("Go(binding.ExternalString)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object @@ -118586,24 +119070,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalString(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalString)//reload: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalString)//reload: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalString) - if !ok { + if vc, ok := v.Value.(binding.ExternalString); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalString)//reload: arg 1: expected native of type binding.ExternalString") + return env.NewError("Go(binding.ExternalString)//reload: arg 1: " + "expected native of type binding.ExternalString, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalString)//reload: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalString)//reload: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalString)//reload: arg 1: expected native") + return env.NewError("Go(binding.ExternalString)//reload: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Reload() var resErrObj env.Object @@ -118628,24 +119112,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalString(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalString)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalString)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalString) - if !ok { + if vc, ok := v.Value.(binding.ExternalString); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalString)//remove-listener: arg 1: expected native of type binding.ExternalString") + return env.NewError("Go(binding.ExternalString)//remove-listener: arg 1: " + "expected native of type binding.ExternalString, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalString)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalString)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalString)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalString)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -118654,24 +119138,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalString)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalString)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalString)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalString)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalString)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalString)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalString)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalString)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -118688,31 +119172,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalString(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalString)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalString)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalString) - if !ok { + if vc, ok := v.Value.(binding.ExternalString); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalString)//set: arg 1: expected native of type binding.ExternalString") + return env.NewError("Go(binding.ExternalString)//set: arg 1: " + "expected native of type binding.ExternalString, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalString)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalString)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalString)//set: arg 1: expected native") + return env.NewError("Go(binding.ExternalString)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalString)//set: arg 2: expected string") + return env.NewError("Go(binding.ExternalString)//set: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -118737,24 +119221,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalStringList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalStringList)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalStringList) - if !ok { + if vc, ok := v.Value.(binding.ExternalStringList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//add-listener: arg 1: expected native of type binding.ExternalStringList") + return env.NewError("Go(binding.ExternalStringList)//add-listener: arg 1: " + "expected native of type binding.ExternalStringList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringList)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalStringList)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -118763,24 +119247,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalStringList)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalStringList)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringList)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalStringList)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -118797,31 +119281,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalStringList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalStringList)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalStringList) - if !ok { + if vc, ok := v.Value.(binding.ExternalStringList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//append: arg 1: expected native of type binding.ExternalStringList") + return env.NewError("Go(binding.ExternalStringList)//append: arg 1: " + "expected native of type binding.ExternalStringList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringList)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//append: arg 1: expected native") + return env.NewError("Go(binding.ExternalStringList)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//append: arg 2: expected string") + return env.NewError("Go(binding.ExternalStringList)//append: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } resErr := arg0Val.Append(arg1Val) var resErrObj env.Object @@ -118846,24 +119330,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalStringList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalStringList)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalStringList) - if !ok { + if vc, ok := v.Value.(binding.ExternalStringList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//get: arg 1: expected native of type binding.ExternalStringList") + return env.NewError("Go(binding.ExternalStringList)//get: arg 1: " + "expected native of type binding.ExternalStringList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringList)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//get: arg 1: expected native") + return env.NewError("Go(binding.ExternalStringList)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object @@ -118896,52 +119380,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalStringList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalStringList)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalStringList) - if !ok { + if vc, ok := v.Value.(binding.ExternalStringList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//get-item: arg 1: expected native of type binding.ExternalStringList") + return env.NewError("Go(binding.ExternalStringList)//get-item: arg 1: " + "expected native of type binding.ExternalStringList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringList)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//get-item: arg 1: expected native") + return env.NewError("Go(binding.ExternalStringList)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//get-item: arg 2: expected integer") + return env.NewError("Go(binding.ExternalStringList)//get-item: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -118964,31 +119431,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalStringList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalStringList)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalStringList) - if !ok { + if vc, ok := v.Value.(binding.ExternalStringList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//get-value: arg 1: expected native of type binding.ExternalStringList") + return env.NewError("Go(binding.ExternalStringList)//get-value: arg 1: " + "expected native of type binding.ExternalStringList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringList)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//get-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalStringList)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//get-value: arg 2: expected integer") + return env.NewError("Go(binding.ExternalStringList)//get-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object @@ -119015,24 +119482,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalStringList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//length: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalStringList)//length: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalStringList) - if !ok { + if vc, ok := v.Value.(binding.ExternalStringList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//length: arg 1: expected native of type binding.ExternalStringList") + return env.NewError("Go(binding.ExternalStringList)//length: arg 1: " + "expected native of type binding.ExternalStringList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//length: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringList)//length: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//length: arg 1: expected native") + return env.NewError("Go(binding.ExternalStringList)//length: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Length() var res0Obj env.Object @@ -119051,31 +119518,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalStringList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalStringList)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalStringList) - if !ok { + if vc, ok := v.Value.(binding.ExternalStringList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//prepend: arg 1: expected native of type binding.ExternalStringList") + return env.NewError("Go(binding.ExternalStringList)//prepend: arg 1: " + "expected native of type binding.ExternalStringList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringList)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//prepend: arg 1: expected native") + return env.NewError("Go(binding.ExternalStringList)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//prepend: arg 2: expected string") + return env.NewError("Go(binding.ExternalStringList)//prepend: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } resErr := arg0Val.Prepend(arg1Val) var resErrObj env.Object @@ -119100,24 +119567,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalStringList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//reload: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalStringList)//reload: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalStringList) - if !ok { + if vc, ok := v.Value.(binding.ExternalStringList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//reload: arg 1: expected native of type binding.ExternalStringList") + return env.NewError("Go(binding.ExternalStringList)//reload: arg 1: " + "expected native of type binding.ExternalStringList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//reload: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringList)//reload: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//reload: arg 1: expected native") + return env.NewError("Go(binding.ExternalStringList)//reload: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Reload() var resErrObj env.Object @@ -119142,24 +119609,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalStringList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalStringList)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalStringList) - if !ok { + if vc, ok := v.Value.(binding.ExternalStringList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//remove-listener: arg 1: expected native of type binding.ExternalStringList") + return env.NewError("Go(binding.ExternalStringList)//remove-listener: arg 1: " + "expected native of type binding.ExternalStringList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringList)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalStringList)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -119168,24 +119635,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalStringList)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalStringList)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringList)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalStringList)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -119202,53 +119669,46 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalStringList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalStringList)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalStringList) - if !ok { + if vc, ok := v.Value.(binding.ExternalStringList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//set: arg 1: expected native of type binding.ExternalStringList") + return env.NewError("Go(binding.ExternalStringList)//set: arg 1: " + "expected native of type binding.ExternalStringList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringList)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//set: arg 1: expected native") + return env.NewError("Go(binding.ExternalStringList)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []string switch v := arg1.(type) { case env.Block: arg1Val = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - arg1Val[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + arg1Val[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//set: arg 2: block item: expected string") + return env.NewError("Go(binding.ExternalStringList)//set: arg 2: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//set: arg 2: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringList)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//set: arg 2: expected block, native or nil") + return env.NewError("Go(binding.ExternalStringList)//set: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -119273,38 +119733,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalStringList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalStringList)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalStringList) - if !ok { + if vc, ok := v.Value.(binding.ExternalStringList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//set-value: arg 1: expected native of type binding.ExternalStringList") + return env.NewError("Go(binding.ExternalStringList)//set-value: arg 1: " + "expected native of type binding.ExternalStringList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringList)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//set-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalStringList)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//set-value: arg 2: expected integer") + return env.NewError("Go(binding.ExternalStringList)//set-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringList)//set-value: arg 3: expected string") + return env.NewError("Go(binding.ExternalStringList)//set-value: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -119329,24 +119789,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalStringTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalStringTree)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalStringTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalStringTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//add-listener: arg 1: expected native of type binding.ExternalStringTree") + return env.NewError("Go(binding.ExternalStringTree)//add-listener: arg 1: " + "expected native of type binding.ExternalStringTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringTree)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalStringTree)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -119355,24 +119815,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalStringTree)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalStringTree)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringTree)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalStringTree)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -119389,45 +119849,45 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalStringTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalStringTree)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalStringTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalStringTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//append: arg 1: expected native of type binding.ExternalStringTree") + return env.NewError("Go(binding.ExternalStringTree)//append: arg 1: " + "expected native of type binding.ExternalStringTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringTree)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//append: arg 1: expected native") + return env.NewError("Go(binding.ExternalStringTree)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//append: arg 2: expected string") + return env.NewError("Go(binding.ExternalStringTree)//append: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//append: arg 3: expected string") + return env.NewError("Go(binding.ExternalStringTree)//append: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val string - if v, ok := arg3.(env.String); ok { - arg3Val = string(v.Value) + if vc, ok := arg3.(env.String); ok { + arg3Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//append: arg 4: expected string") + return env.NewError("Go(binding.ExternalStringTree)//append: arg 4: " + "expected string, but got " + objectDebugString(ps.Idx, arg3)) } resErr := arg0Val.Append(arg1Val, arg2Val, arg3Val) var resErrObj env.Object @@ -119452,31 +119912,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalStringTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//child-i-ds: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalStringTree)//child-i-ds: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalStringTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalStringTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//child-i-ds: arg 1: expected native of type binding.ExternalStringTree") + return env.NewError("Go(binding.ExternalStringTree)//child-i-ds: arg 1: " + "expected native of type binding.ExternalStringTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//child-i-ds: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringTree)//child-i-ds: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//child-i-ds: arg 1: expected native") + return env.NewError("Go(binding.ExternalStringTree)//child-i-ds: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//child-i-ds: arg 2: expected string") + return env.NewError("Go(binding.ExternalStringTree)//child-i-ds: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := arg0Val.ChildIDs(arg1Val) var res0Obj env.Object @@ -119501,24 +119961,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalStringTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalStringTree)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalStringTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalStringTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//get: arg 1: expected native of type binding.ExternalStringTree") + return env.NewError("Go(binding.ExternalStringTree)//get: arg 1: " + "expected native of type binding.ExternalStringTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringTree)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//get: arg 1: expected native") + return env.NewError("Go(binding.ExternalStringTree)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, res1, resErr := arg0Val.Get() var res0Obj env.Object @@ -119572,52 +120032,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalStringTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalStringTree)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalStringTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalStringTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//get-item: arg 1: expected native of type binding.ExternalStringTree") + return env.NewError("Go(binding.ExternalStringTree)//get-item: arg 1: " + "expected native of type binding.ExternalStringTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringTree)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//get-item: arg 1: expected native") + return env.NewError("Go(binding.ExternalStringTree)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//get-item: arg 2: expected string") + return env.NewError("Go(binding.ExternalStringTree)//get-item: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -119640,31 +120083,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalStringTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalStringTree)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalStringTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalStringTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//get-value: arg 1: expected native of type binding.ExternalStringTree") + return env.NewError("Go(binding.ExternalStringTree)//get-value: arg 1: " + "expected native of type binding.ExternalStringTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringTree)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//get-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalStringTree)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//get-value: arg 2: expected string") + return env.NewError("Go(binding.ExternalStringTree)//get-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object @@ -119691,45 +120134,45 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalStringTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalStringTree)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalStringTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalStringTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//prepend: arg 1: expected native of type binding.ExternalStringTree") + return env.NewError("Go(binding.ExternalStringTree)//prepend: arg 1: " + "expected native of type binding.ExternalStringTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringTree)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//prepend: arg 1: expected native") + return env.NewError("Go(binding.ExternalStringTree)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//prepend: arg 2: expected string") + return env.NewError("Go(binding.ExternalStringTree)//prepend: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//prepend: arg 3: expected string") + return env.NewError("Go(binding.ExternalStringTree)//prepend: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val string - if v, ok := arg3.(env.String); ok { - arg3Val = string(v.Value) + if vc, ok := arg3.(env.String); ok { + arg3Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//prepend: arg 4: expected string") + return env.NewError("Go(binding.ExternalStringTree)//prepend: arg 4: " + "expected string, but got " + objectDebugString(ps.Idx, arg3)) } resErr := arg0Val.Prepend(arg1Val, arg2Val, arg3Val) var resErrObj env.Object @@ -119754,24 +120197,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalStringTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//reload: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalStringTree)//reload: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalStringTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalStringTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//reload: arg 1: expected native of type binding.ExternalStringTree") + return env.NewError("Go(binding.ExternalStringTree)//reload: arg 1: " + "expected native of type binding.ExternalStringTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//reload: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringTree)//reload: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//reload: arg 1: expected native") + return env.NewError("Go(binding.ExternalStringTree)//reload: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Reload() var resErrObj env.Object @@ -119796,24 +120239,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalStringTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalStringTree)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalStringTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalStringTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//remove-listener: arg 1: expected native of type binding.ExternalStringTree") + return env.NewError("Go(binding.ExternalStringTree)//remove-listener: arg 1: " + "expected native of type binding.ExternalStringTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringTree)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalStringTree)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -119822,24 +120265,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalStringTree)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalStringTree)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringTree)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalStringTree)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -119856,69 +120299,62 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalStringTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalStringTree)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalStringTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalStringTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set: arg 1: expected native of type binding.ExternalStringTree") + return env.NewError("Go(binding.ExternalStringTree)//set: arg 1: " + "expected native of type binding.ExternalStringTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringTree)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set: arg 1: expected native") + return env.NewError("Go(binding.ExternalStringTree)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val map[string][]string switch v := arg1.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set: arg 2: expected block to have length of multiple of 2") + return env.NewError("Go(binding.ExternalStringTree)//set: arg 2: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } arg1Val = make(map[string][]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set: arg 2: map key: expected string") + return env.NewError("Go(binding.ExternalStringTree)//set: arg 2: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV []string switch v := v.Series.S[i+1].(type) { case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set: arg 2: map value: block item: expected string") + return env.NewError("Go(binding.ExternalStringTree)//set: arg 2: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set: arg 2: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set: arg 2: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringTree)//set: arg 2: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set: arg 2: map value: expected block, native or nil") + return env.NewError("Go(binding.ExternalStringTree)//set: arg 2: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } @@ -119931,71 +120367,57 @@ var Builtins = map[string]*env.Builtin{ case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set: arg 2: map value: block item: expected string") + return env.NewError("Go(binding.ExternalStringTree)//set: arg 2: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set: arg 2: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set: arg 2: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringTree)//set: arg 2: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set: arg 2: map value: expected block, native or nil") + return env.NewError("Go(binding.ExternalStringTree)//set: arg 2: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } - case env.Native: - var ok bool - arg1Val, ok = v.Value.(map[string][]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set: arg 2: expected native of type map[string][]string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringTree)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set: arg 2: expected native, block, dict or nil") + return env.NewError("Go(binding.ExternalStringTree)//set: arg 2: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } var arg2Val map[string]string switch v := arg2.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set: arg 3: expected block to have length of multiple of 2") + return env.NewError("Go(binding.ExternalStringTree)//set: arg 3: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } arg2Val = make(map[string]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set: arg 3: map key: expected string") + return env.NewError("Go(binding.ExternalStringTree)//set: arg 3: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV string - if v, ok := v.Series.S[i+1].(env.String); ok { - mapV = string(v.Value) + if vc, ok := v.Series.S[i+1].(env.String); ok { + mapV = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set: arg 3: map value: expected string") + return env.NewError("Go(binding.ExternalStringTree)//set: arg 3: " + "map value: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+1])) } arg2Val[mapK] = mapV } @@ -120004,30 +120426,23 @@ var Builtins = map[string]*env.Builtin{ for dictK, dictV := range v.Data { mapK := dictK var mapV string - if v, ok := dictV.(env.String); ok { - mapV = string(v.Value) + if vc, ok := dictV.(env.String); ok { + mapV = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set: arg 3: map value: expected string") + return env.NewError("Go(binding.ExternalStringTree)//set: arg 3: " + "map value: " + "expected string, but got " + objectDebugString(ps.Idx, dictV)) } arg2Val[mapK] = mapV } - case env.Native: - var ok bool - arg2Val, ok = v.Value.(map[string]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set: arg 3: expected native of type map[string]string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringTree)//set: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set: arg 3: expected native, block, dict or nil") + return env.NewError("Go(binding.ExternalStringTree)//set: arg 3: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val, arg2Val) var resErrObj env.Object @@ -120052,38 +120467,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalStringTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalStringTree)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalStringTree) - if !ok { + if vc, ok := v.Value.(binding.ExternalStringTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set-value: arg 1: expected native of type binding.ExternalStringTree") + return env.NewError("Go(binding.ExternalStringTree)//set-value: arg 1: " + "expected native of type binding.ExternalStringTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalStringTree)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalStringTree)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set-value: arg 2: expected string") + return env.NewError("Go(binding.ExternalStringTree)//set-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalStringTree)//set-value: arg 3: expected string") + return env.NewError("Go(binding.ExternalStringTree)//set-value: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -120108,24 +120523,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalURI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURI)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalURI) - if !ok { + if vc, ok := v.Value.(binding.ExternalURI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//add-listener: arg 1: expected native of type binding.ExternalURI") + return env.NewError("Go(binding.ExternalURI)//add-listener: arg 1: " + "expected native of type binding.ExternalURI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURI)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalURI)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -120134,24 +120549,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURI)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalURI)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURI)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalURI)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -120168,45 +120583,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalURI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURI)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalURI) - if !ok { + if vc, ok := v.Value.(binding.ExternalURI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//get: arg 1: expected native of type binding.ExternalURI") + return env.NewError("Go(binding.ExternalURI)//get: arg 1: " + "expected native of type binding.ExternalURI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURI)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//get: arg 1: expected native") + return env.NewError("Go(binding.ExternalURI)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URI)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URI)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -120229,24 +120627,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalURI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//reload: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURI)//reload: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalURI) - if !ok { + if vc, ok := v.Value.(binding.ExternalURI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//reload: arg 1: expected native of type binding.ExternalURI") + return env.NewError("Go(binding.ExternalURI)//reload: arg 1: " + "expected native of type binding.ExternalURI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//reload: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURI)//reload: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//reload: arg 1: expected native") + return env.NewError("Go(binding.ExternalURI)//reload: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Reload() var resErrObj env.Object @@ -120271,24 +120669,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalURI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURI)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalURI) - if !ok { + if vc, ok := v.Value.(binding.ExternalURI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//remove-listener: arg 1: expected native of type binding.ExternalURI") + return env.NewError("Go(binding.ExternalURI)//remove-listener: arg 1: " + "expected native of type binding.ExternalURI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURI)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalURI)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -120297,24 +120695,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURI)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalURI)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURI)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalURI)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -120331,24 +120729,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalURI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURI)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalURI) - if !ok { + if vc, ok := v.Value.(binding.ExternalURI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//set: arg 1: expected native of type binding.ExternalURI") + return env.NewError("Go(binding.ExternalURI)//set: arg 1: " + "expected native of type binding.ExternalURI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURI)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//set: arg 1: expected native") + return env.NewError("Go(binding.ExternalURI)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -120357,24 +120755,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//set: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURI)//set: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//set: arg 2: expected native of type fyne.URI") + return env.NewError("Go(binding.ExternalURI)//set: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURI)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURI)//set: arg 2: expected native") + return env.NewError("Go(binding.ExternalURI)//set: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -120399,24 +120797,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalURIList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURIList)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalURIList) - if !ok { + if vc, ok := v.Value.(binding.ExternalURIList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//add-listener: arg 1: expected native of type binding.ExternalURIList") + return env.NewError("Go(binding.ExternalURIList)//add-listener: arg 1: " + "expected native of type binding.ExternalURIList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURIList)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalURIList)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -120425,24 +120823,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURIList)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalURIList)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURIList)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalURIList)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -120459,24 +120857,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalURIList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURIList)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalURIList) - if !ok { + if vc, ok := v.Value.(binding.ExternalURIList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//append: arg 1: expected native of type binding.ExternalURIList") + return env.NewError("Go(binding.ExternalURIList)//append: arg 1: " + "expected native of type binding.ExternalURIList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURIList)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//append: arg 1: expected native") + return env.NewError("Go(binding.ExternalURIList)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -120485,24 +120883,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//append: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURIList)//append: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//append: arg 2: expected native of type fyne.URI") + return env.NewError("Go(binding.ExternalURIList)//append: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//append: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURIList)//append: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//append: arg 2: expected native") + return env.NewError("Go(binding.ExternalURIList)//append: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Append(arg1Val) var resErrObj env.Object @@ -120527,48 +120925,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalURIList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURIList)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalURIList) - if !ok { + if vc, ok := v.Value.(binding.ExternalURIList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//get: arg 1: expected native of type binding.ExternalURIList") + return env.NewError("Go(binding.ExternalURIList)//get: arg 1: " + "expected native of type binding.ExternalURIList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURIList)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//get: arg 1: expected native") + return env.NewError("Go(binding.ExternalURIList)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object { items := make([]env.Object, len(res0)) for i, it := range res0 { - { - typ := reflect.TypeOf(it) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - items[i] = *env.NewNative(ps.Idx, it, typRyeName) - } else { - items[i] = *env.NewNative(ps.Idx, it, "Go(fyne.URI)") - } - } + items[i] = ifaceToNative(ps.Idx, it, "Go(fyne.URI)") } res0Obj = *env.NewBlock(*env.NewTSeries(items)) } @@ -120594,52 +120975,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalURIList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURIList)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalURIList) - if !ok { + if vc, ok := v.Value.(binding.ExternalURIList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//get-item: arg 1: expected native of type binding.ExternalURIList") + return env.NewError("Go(binding.ExternalURIList)//get-item: arg 1: " + "expected native of type binding.ExternalURIList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURIList)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//get-item: arg 1: expected native") + return env.NewError("Go(binding.ExternalURIList)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//get-item: arg 2: expected integer") + return env.NewError("Go(binding.ExternalURIList)//get-item: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -120662,52 +121026,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalURIList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURIList)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalURIList) - if !ok { + if vc, ok := v.Value.(binding.ExternalURIList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//get-value: arg 1: expected native of type binding.ExternalURIList") + return env.NewError("Go(binding.ExternalURIList)//get-value: arg 1: " + "expected native of type binding.ExternalURIList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURIList)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//get-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalURIList)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//get-value: arg 2: expected integer") + return env.NewError("Go(binding.ExternalURIList)//get-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URI)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URI)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -120730,24 +121077,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalURIList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//length: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURIList)//length: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalURIList) - if !ok { + if vc, ok := v.Value.(binding.ExternalURIList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//length: arg 1: expected native of type binding.ExternalURIList") + return env.NewError("Go(binding.ExternalURIList)//length: arg 1: " + "expected native of type binding.ExternalURIList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//length: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURIList)//length: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//length: arg 1: expected native") + return env.NewError("Go(binding.ExternalURIList)//length: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Length() var res0Obj env.Object @@ -120766,24 +121113,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalURIList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURIList)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalURIList) - if !ok { + if vc, ok := v.Value.(binding.ExternalURIList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//prepend: arg 1: expected native of type binding.ExternalURIList") + return env.NewError("Go(binding.ExternalURIList)//prepend: arg 1: " + "expected native of type binding.ExternalURIList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURIList)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//prepend: arg 1: expected native") + return env.NewError("Go(binding.ExternalURIList)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -120792,24 +121139,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//prepend: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURIList)//prepend: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//prepend: arg 2: expected native of type fyne.URI") + return env.NewError("Go(binding.ExternalURIList)//prepend: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//prepend: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURIList)//prepend: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//prepend: arg 2: expected native") + return env.NewError("Go(binding.ExternalURIList)//prepend: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Prepend(arg1Val) var resErrObj env.Object @@ -120834,24 +121181,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalURIList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//reload: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURIList)//reload: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalURIList) - if !ok { + if vc, ok := v.Value.(binding.ExternalURIList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//reload: arg 1: expected native of type binding.ExternalURIList") + return env.NewError("Go(binding.ExternalURIList)//reload: arg 1: " + "expected native of type binding.ExternalURIList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//reload: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURIList)//reload: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//reload: arg 1: expected native") + return env.NewError("Go(binding.ExternalURIList)//reload: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Reload() var resErrObj env.Object @@ -120876,24 +121223,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalURIList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURIList)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalURIList) - if !ok { + if vc, ok := v.Value.(binding.ExternalURIList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//remove-listener: arg 1: expected native of type binding.ExternalURIList") + return env.NewError("Go(binding.ExternalURIList)//remove-listener: arg 1: " + "expected native of type binding.ExternalURIList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURIList)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalURIList)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -120902,24 +121249,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURIList)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalURIList)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURIList)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalURIList)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -120936,24 +121283,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalURIList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURIList)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalURIList) - if !ok { + if vc, ok := v.Value.(binding.ExternalURIList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//set: arg 1: expected native of type binding.ExternalURIList") + return env.NewError("Go(binding.ExternalURIList)//set: arg 1: " + "expected native of type binding.ExternalURIList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURIList)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//set: arg 1: expected native") + return env.NewError("Go(binding.ExternalURIList)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []fyne.URI switch v := arg1.(type) { @@ -120966,42 +121313,35 @@ var Builtins = map[string]*env.Builtin{ arg1Val[i], err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//set: arg 2: block item: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURIList)//set: arg 2: " + "block item: " + err.Error()) } case env.Native: - var ok bool - arg1Val[i], ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//set: arg 2: block item: expected native of type fyne.URI") + return env.NewError("Go(binding.ExternalURIList)//set: arg 2: " + "block item: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//set: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURIList)//set: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val[i] = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//set: arg 2: block item: expected native") + return env.NewError("Go(binding.ExternalURIList)//set: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]fyne.URI) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//set: arg 2: expected native of type []fyne.URI") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURIList)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//set: arg 2: expected block, native or nil") + return env.NewError("Go(binding.ExternalURIList)//set: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -121026,31 +121366,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalURIList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURIList)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalURIList) - if !ok { + if vc, ok := v.Value.(binding.ExternalURIList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//set-value: arg 1: expected native of type binding.ExternalURIList") + return env.NewError("Go(binding.ExternalURIList)//set-value: arg 1: " + "expected native of type binding.ExternalURIList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURIList)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//set-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalURIList)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//set-value: arg 2: expected integer") + return env.NewError("Go(binding.ExternalURIList)//set-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val fyne.URI switch v := arg2.(type) { @@ -121059,24 +121399,24 @@ var Builtins = map[string]*env.Builtin{ arg2Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//set-value: arg 3: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURIList)//set-value: arg 3: " + err.Error()) } case env.Native: - var ok bool - arg2Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//set-value: arg 3: expected native of type fyne.URI") + return env.NewError("Go(binding.ExternalURIList)//set-value: arg 3: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//set-value: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURIList)//set-value: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURIList)//set-value: arg 3: expected native") + return env.NewError("Go(binding.ExternalURIList)//set-value: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -121101,24 +121441,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalURITree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURITree)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalURITree) - if !ok { + if vc, ok := v.Value.(binding.ExternalURITree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//add-listener: arg 1: expected native of type binding.ExternalURITree") + return env.NewError("Go(binding.ExternalURITree)//add-listener: arg 1: " + "expected native of type binding.ExternalURITree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURITree)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalURITree)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -121127,24 +121467,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURITree)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalURITree)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURITree)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalURITree)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -121161,38 +121501,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalURITree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURITree)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalURITree) - if !ok { + if vc, ok := v.Value.(binding.ExternalURITree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//append: arg 1: expected native of type binding.ExternalURITree") + return env.NewError("Go(binding.ExternalURITree)//append: arg 1: " + "expected native of type binding.ExternalURITree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURITree)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//append: arg 1: expected native") + return env.NewError("Go(binding.ExternalURITree)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//append: arg 2: expected string") + return env.NewError("Go(binding.ExternalURITree)//append: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//append: arg 3: expected string") + return env.NewError("Go(binding.ExternalURITree)//append: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val fyne.URI switch v := arg3.(type) { @@ -121201,24 +121541,24 @@ var Builtins = map[string]*env.Builtin{ arg3Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//append: arg 4: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURITree)//append: arg 4: " + err.Error()) } case env.Native: - var ok bool - arg3Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg3Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//append: arg 4: expected native of type fyne.URI") + return env.NewError("Go(binding.ExternalURITree)//append: arg 4: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//append: arg 4: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURITree)//append: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//append: arg 4: expected native") + return env.NewError("Go(binding.ExternalURITree)//append: arg 4: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Append(arg1Val, arg2Val, arg3Val) var resErrObj env.Object @@ -121243,31 +121583,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalURITree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//child-i-ds: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURITree)//child-i-ds: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalURITree) - if !ok { + if vc, ok := v.Value.(binding.ExternalURITree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//child-i-ds: arg 1: expected native of type binding.ExternalURITree") + return env.NewError("Go(binding.ExternalURITree)//child-i-ds: arg 1: " + "expected native of type binding.ExternalURITree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//child-i-ds: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURITree)//child-i-ds: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//child-i-ds: arg 1: expected native") + return env.NewError("Go(binding.ExternalURITree)//child-i-ds: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//child-i-ds: arg 2: expected string") + return env.NewError("Go(binding.ExternalURITree)//child-i-ds: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := arg0Val.ChildIDs(arg1Val) var res0Obj env.Object @@ -121292,24 +121632,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalURITree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURITree)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalURITree) - if !ok { + if vc, ok := v.Value.(binding.ExternalURITree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//get: arg 1: expected native of type binding.ExternalURITree") + return env.NewError("Go(binding.ExternalURITree)//get: arg 1: " + "expected native of type binding.ExternalURITree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURITree)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//get: arg 1: expected native") + return env.NewError("Go(binding.ExternalURITree)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, res1, resErr := arg0Val.Get() var res0Obj env.Object @@ -121333,24 +121673,7 @@ var Builtins = map[string]*env.Builtin{ data := make(map[string]any, len(res1)) for mKey, mVal := range res1 { var dVal env.Object - { - typ := reflect.TypeOf(mVal) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - dVal = *env.NewNative(ps.Idx, mVal, typRyeName) - } else { - dVal = *env.NewNative(ps.Idx, mVal, "Go(fyne.URI)") - } - } + dVal = ifaceToNative(ps.Idx, mVal, "Go(fyne.URI)") data[mKey] = dVal } res1Obj = *env.NewDict(data) @@ -121380,52 +121703,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalURITree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURITree)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalURITree) - if !ok { + if vc, ok := v.Value.(binding.ExternalURITree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//get-item: arg 1: expected native of type binding.ExternalURITree") + return env.NewError("Go(binding.ExternalURITree)//get-item: arg 1: " + "expected native of type binding.ExternalURITree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURITree)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//get-item: arg 1: expected native") + return env.NewError("Go(binding.ExternalURITree)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//get-item: arg 2: expected string") + return env.NewError("Go(binding.ExternalURITree)//get-item: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -121448,52 +121754,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalURITree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURITree)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalURITree) - if !ok { + if vc, ok := v.Value.(binding.ExternalURITree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//get-value: arg 1: expected native of type binding.ExternalURITree") + return env.NewError("Go(binding.ExternalURITree)//get-value: arg 1: " + "expected native of type binding.ExternalURITree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURITree)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//get-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalURITree)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//get-value: arg 2: expected string") + return env.NewError("Go(binding.ExternalURITree)//get-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URI)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URI)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -121516,38 +121805,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalURITree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURITree)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalURITree) - if !ok { + if vc, ok := v.Value.(binding.ExternalURITree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//prepend: arg 1: expected native of type binding.ExternalURITree") + return env.NewError("Go(binding.ExternalURITree)//prepend: arg 1: " + "expected native of type binding.ExternalURITree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURITree)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//prepend: arg 1: expected native") + return env.NewError("Go(binding.ExternalURITree)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//prepend: arg 2: expected string") + return env.NewError("Go(binding.ExternalURITree)//prepend: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//prepend: arg 3: expected string") + return env.NewError("Go(binding.ExternalURITree)//prepend: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val fyne.URI switch v := arg3.(type) { @@ -121556,24 +121845,24 @@ var Builtins = map[string]*env.Builtin{ arg3Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//prepend: arg 4: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURITree)//prepend: arg 4: " + err.Error()) } case env.Native: - var ok bool - arg3Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg3Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//prepend: arg 4: expected native of type fyne.URI") + return env.NewError("Go(binding.ExternalURITree)//prepend: arg 4: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//prepend: arg 4: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURITree)//prepend: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//prepend: arg 4: expected native") + return env.NewError("Go(binding.ExternalURITree)//prepend: arg 4: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Prepend(arg1Val, arg2Val, arg3Val) var resErrObj env.Object @@ -121598,24 +121887,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalURITree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//reload: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURITree)//reload: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalURITree) - if !ok { + if vc, ok := v.Value.(binding.ExternalURITree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//reload: arg 1: expected native of type binding.ExternalURITree") + return env.NewError("Go(binding.ExternalURITree)//reload: arg 1: " + "expected native of type binding.ExternalURITree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//reload: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURITree)//reload: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//reload: arg 1: expected native") + return env.NewError("Go(binding.ExternalURITree)//reload: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Reload() var resErrObj env.Object @@ -121640,24 +121929,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalURITree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURITree)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalURITree) - if !ok { + if vc, ok := v.Value.(binding.ExternalURITree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//remove-listener: arg 1: expected native of type binding.ExternalURITree") + return env.NewError("Go(binding.ExternalURITree)//remove-listener: arg 1: " + "expected native of type binding.ExternalURITree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURITree)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalURITree)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -121666,24 +121955,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURITree)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalURITree)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURITree)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalURITree)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -121700,69 +121989,62 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalURITree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURITree)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalURITree) - if !ok { + if vc, ok := v.Value.(binding.ExternalURITree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 1: expected native of type binding.ExternalURITree") + return env.NewError("Go(binding.ExternalURITree)//set: arg 1: " + "expected native of type binding.ExternalURITree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURITree)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 1: expected native") + return env.NewError("Go(binding.ExternalURITree)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val map[string][]string switch v := arg1.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 2: expected block to have length of multiple of 2") + return env.NewError("Go(binding.ExternalURITree)//set: arg 2: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } arg1Val = make(map[string][]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 2: map key: expected string") + return env.NewError("Go(binding.ExternalURITree)//set: arg 2: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV []string switch v := v.Series.S[i+1].(type) { case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 2: map value: block item: expected string") + return env.NewError("Go(binding.ExternalURITree)//set: arg 2: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 2: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 2: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURITree)//set: arg 2: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 2: map value: expected block, native or nil") + return env.NewError("Go(binding.ExternalURITree)//set: arg 2: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } @@ -121775,64 +122057,50 @@ var Builtins = map[string]*env.Builtin{ case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 2: map value: block item: expected string") + return env.NewError("Go(binding.ExternalURITree)//set: arg 2: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 2: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 2: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURITree)//set: arg 2: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 2: map value: expected block, native or nil") + return env.NewError("Go(binding.ExternalURITree)//set: arg 2: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } - case env.Native: - var ok bool - arg1Val, ok = v.Value.(map[string][]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 2: expected native of type map[string][]string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURITree)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 2: expected native, block, dict or nil") + return env.NewError("Go(binding.ExternalURITree)//set: arg 2: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } var arg2Val map[string]fyne.URI switch v := arg2.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 3: expected block to have length of multiple of 2") + return env.NewError("Go(binding.ExternalURITree)//set: arg 3: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } arg2Val = make(map[string]fyne.URI, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 3: map key: expected string") + return env.NewError("Go(binding.ExternalURITree)//set: arg 3: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV fyne.URI switch v := v.Series.S[i+1].(type) { @@ -121841,24 +122109,24 @@ var Builtins = map[string]*env.Builtin{ mapV, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 3: map value: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURITree)//set: arg 3: " + "map value: " + err.Error()) } case env.Native: - var ok bool - mapV, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + mapV = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 3: map value: expected native of type fyne.URI") + return env.NewError("Go(binding.ExternalURITree)//set: arg 3: " + "map value: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 3: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURITree)//set: arg 3: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 3: map value: expected native") + return env.NewError("Go(binding.ExternalURITree)//set: arg 3: " + "map value: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg2Val[mapK] = mapV } @@ -121873,43 +122141,36 @@ var Builtins = map[string]*env.Builtin{ mapV, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 3: map value: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURITree)//set: arg 3: " + "map value: " + err.Error()) } case env.Native: - var ok bool - mapV, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + mapV = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 3: map value: expected native of type fyne.URI") + return env.NewError("Go(binding.ExternalURITree)//set: arg 3: " + "map value: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 3: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURITree)//set: arg 3: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 3: map value: expected native") + return env.NewError("Go(binding.ExternalURITree)//set: arg 3: " + "map value: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg2Val[mapK] = mapV } - case env.Native: - var ok bool - arg2Val, ok = v.Value.(map[string]fyne.URI) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 3: expected native of type map[string]fyne.URI") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURITree)//set: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set: arg 3: expected native, block, dict or nil") + return env.NewError("Go(binding.ExternalURITree)//set: arg 3: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val, arg2Val) var resErrObj env.Object @@ -121934,31 +122195,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalURITree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURITree)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalURITree) - if !ok { + if vc, ok := v.Value.(binding.ExternalURITree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set-value: arg 1: expected native of type binding.ExternalURITree") + return env.NewError("Go(binding.ExternalURITree)//set-value: arg 1: " + "expected native of type binding.ExternalURITree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURITree)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalURITree)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set-value: arg 2: expected string") + return env.NewError("Go(binding.ExternalURITree)//set-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val fyne.URI switch v := arg2.(type) { @@ -121967,24 +122228,24 @@ var Builtins = map[string]*env.Builtin{ arg2Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set-value: arg 3: " + err.Error() + "") + return env.NewError("Go(binding.ExternalURITree)//set-value: arg 3: " + err.Error()) } case env.Native: - var ok bool - arg2Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set-value: arg 3: expected native of type fyne.URI") + return env.NewError("Go(binding.ExternalURITree)//set-value: arg 3: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set-value: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalURITree)//set-value: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalURITree)//set-value: arg 3: expected native") + return env.NewError("Go(binding.ExternalURITree)//set-value: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -122009,24 +122270,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalUntyped(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntyped)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalUntyped) - if !ok { + if vc, ok := v.Value.(binding.ExternalUntyped); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//add-listener: arg 1: expected native of type binding.ExternalUntyped") + return env.NewError("Go(binding.ExternalUntyped)//add-listener: arg 1: " + "expected native of type binding.ExternalUntyped, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntyped)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalUntyped)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -122035,24 +122296,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntyped)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalUntyped)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntyped)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalUntyped)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -122069,28 +122330,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalUntyped(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntyped)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalUntyped) - if !ok { + if vc, ok := v.Value.(binding.ExternalUntyped); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//get: arg 1: expected native of type binding.ExternalUntyped") + return env.NewError("Go(binding.ExternalUntyped)//get: arg 1: " + "expected native of type binding.ExternalUntyped, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntyped)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//get: arg 1: expected native") + return env.NewError("Go(binding.ExternalUntyped)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object - res0Obj = *env.NewNative(ps.Idx, res0, "Go(any)") + res0Obj = *env.NewNative(ps.Idx, res0, "Go(interface{})") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -122113,24 +122374,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalUntyped(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//reload: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntyped)//reload: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalUntyped) - if !ok { + if vc, ok := v.Value.(binding.ExternalUntyped); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//reload: arg 1: expected native of type binding.ExternalUntyped") + return env.NewError("Go(binding.ExternalUntyped)//reload: arg 1: " + "expected native of type binding.ExternalUntyped, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//reload: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntyped)//reload: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//reload: arg 1: expected native") + return env.NewError("Go(binding.ExternalUntyped)//reload: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Reload() var resErrObj env.Object @@ -122155,24 +122416,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalUntyped(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntyped)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalUntyped) - if !ok { + if vc, ok := v.Value.(binding.ExternalUntyped); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//remove-listener: arg 1: expected native of type binding.ExternalUntyped") + return env.NewError("Go(binding.ExternalUntyped)//remove-listener: arg 1: " + "expected native of type binding.ExternalUntyped, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntyped)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalUntyped)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -122181,24 +122442,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntyped)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalUntyped)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntyped)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalUntyped)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -122215,37 +122476,37 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalUntyped(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntyped)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalUntyped) - if !ok { + if vc, ok := v.Value.(binding.ExternalUntyped); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//set: arg 1: expected native of type binding.ExternalUntyped") + return env.NewError("Go(binding.ExternalUntyped)//set: arg 1: " + "expected native of type binding.ExternalUntyped, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntyped)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//set: arg 1: expected native") + return env.NewError("Go(binding.ExternalUntyped)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val any + var arg1Val interface{} switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//set: arg 2: expected native of type any") + return env.NewError("Go(binding.ExternalUntyped)//set: arg 2: " + "expected native of type interface{}, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntyped)//set: arg 2: expected native") + return env.NewError("Go(binding.ExternalUntyped)//set: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -122270,24 +122531,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalUntypedList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntypedList)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalUntypedList) - if !ok { + if vc, ok := v.Value.(binding.ExternalUntypedList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//add-listener: arg 1: expected native of type binding.ExternalUntypedList") + return env.NewError("Go(binding.ExternalUntypedList)//add-listener: arg 1: " + "expected native of type binding.ExternalUntypedList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntypedList)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalUntypedList)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -122296,24 +122557,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntypedList)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalUntypedList)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntypedList)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalUntypedList)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -122330,37 +122591,37 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalUntypedList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntypedList)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalUntypedList) - if !ok { + if vc, ok := v.Value.(binding.ExternalUntypedList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//append: arg 1: expected native of type binding.ExternalUntypedList") + return env.NewError("Go(binding.ExternalUntypedList)//append: arg 1: " + "expected native of type binding.ExternalUntypedList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntypedList)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//append: arg 1: expected native") + return env.NewError("Go(binding.ExternalUntypedList)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val any + var arg1Val interface{} switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//append: arg 2: expected native of type any") + return env.NewError("Go(binding.ExternalUntypedList)//append: arg 2: " + "expected native of type interface{}, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//append: arg 2: expected native") + return env.NewError("Go(binding.ExternalUntypedList)//append: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Append(arg1Val) var resErrObj env.Object @@ -122385,31 +122646,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalUntypedList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntypedList)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalUntypedList) - if !ok { + if vc, ok := v.Value.(binding.ExternalUntypedList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//get: arg 1: expected native of type binding.ExternalUntypedList") + return env.NewError("Go(binding.ExternalUntypedList)//get: arg 1: " + "expected native of type binding.ExternalUntypedList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntypedList)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//get: arg 1: expected native") + return env.NewError("Go(binding.ExternalUntypedList)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object { items := make([]env.Object, len(res0)) for i, it := range res0 { - items[i] = *env.NewNative(ps.Idx, it, "Go(any)") + items[i] = *env.NewNative(ps.Idx, it, "Go(interface{})") } res0Obj = *env.NewBlock(*env.NewTSeries(items)) } @@ -122435,52 +122696,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalUntypedList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntypedList)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalUntypedList) - if !ok { + if vc, ok := v.Value.(binding.ExternalUntypedList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//get-item: arg 1: expected native of type binding.ExternalUntypedList") + return env.NewError("Go(binding.ExternalUntypedList)//get-item: arg 1: " + "expected native of type binding.ExternalUntypedList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntypedList)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//get-item: arg 1: expected native") + return env.NewError("Go(binding.ExternalUntypedList)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//get-item: arg 2: expected integer") + return env.NewError("Go(binding.ExternalUntypedList)//get-item: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -122503,35 +122747,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalUntypedList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntypedList)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalUntypedList) - if !ok { + if vc, ok := v.Value.(binding.ExternalUntypedList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//get-value: arg 1: expected native of type binding.ExternalUntypedList") + return env.NewError("Go(binding.ExternalUntypedList)//get-value: arg 1: " + "expected native of type binding.ExternalUntypedList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntypedList)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//get-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalUntypedList)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//get-value: arg 2: expected integer") + return env.NewError("Go(binding.ExternalUntypedList)//get-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object - res0Obj = *env.NewNative(ps.Idx, res0, "Go(any)") + res0Obj = *env.NewNative(ps.Idx, res0, "Go(interface{})") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -122554,24 +122798,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalUntypedList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//length: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntypedList)//length: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalUntypedList) - if !ok { + if vc, ok := v.Value.(binding.ExternalUntypedList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//length: arg 1: expected native of type binding.ExternalUntypedList") + return env.NewError("Go(binding.ExternalUntypedList)//length: arg 1: " + "expected native of type binding.ExternalUntypedList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//length: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntypedList)//length: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//length: arg 1: expected native") + return env.NewError("Go(binding.ExternalUntypedList)//length: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Length() var res0Obj env.Object @@ -122590,37 +122834,37 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalUntypedList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntypedList)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalUntypedList) - if !ok { + if vc, ok := v.Value.(binding.ExternalUntypedList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//prepend: arg 1: expected native of type binding.ExternalUntypedList") + return env.NewError("Go(binding.ExternalUntypedList)//prepend: arg 1: " + "expected native of type binding.ExternalUntypedList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntypedList)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//prepend: arg 1: expected native") + return env.NewError("Go(binding.ExternalUntypedList)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val any + var arg1Val interface{} switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//prepend: arg 2: expected native of type any") + return env.NewError("Go(binding.ExternalUntypedList)//prepend: arg 2: " + "expected native of type interface{}, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//prepend: arg 2: expected native") + return env.NewError("Go(binding.ExternalUntypedList)//prepend: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Prepend(arg1Val) var resErrObj env.Object @@ -122645,24 +122889,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalUntypedList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//reload: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntypedList)//reload: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalUntypedList) - if !ok { + if vc, ok := v.Value.(binding.ExternalUntypedList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//reload: arg 1: expected native of type binding.ExternalUntypedList") + return env.NewError("Go(binding.ExternalUntypedList)//reload: arg 1: " + "expected native of type binding.ExternalUntypedList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//reload: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntypedList)//reload: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//reload: arg 1: expected native") + return env.NewError("Go(binding.ExternalUntypedList)//reload: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Reload() var resErrObj env.Object @@ -122687,24 +122931,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalUntypedList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntypedList)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalUntypedList) - if !ok { + if vc, ok := v.Value.(binding.ExternalUntypedList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//remove-listener: arg 1: expected native of type binding.ExternalUntypedList") + return env.NewError("Go(binding.ExternalUntypedList)//remove-listener: arg 1: " + "expected native of type binding.ExternalUntypedList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntypedList)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalUntypedList)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -122713,24 +122957,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntypedList)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalUntypedList)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntypedList)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalUntypedList)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -122747,59 +122991,52 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalUntypedList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntypedList)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalUntypedList) - if !ok { + if vc, ok := v.Value.(binding.ExternalUntypedList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//set: arg 1: expected native of type binding.ExternalUntypedList") + return env.NewError("Go(binding.ExternalUntypedList)//set: arg 1: " + "expected native of type binding.ExternalUntypedList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntypedList)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//set: arg 1: expected native") + return env.NewError("Go(binding.ExternalUntypedList)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val []any + var arg1Val []interface{} switch v := arg1.(type) { case env.Block: - arg1Val = make([]any, len(v.Series.S)) + arg1Val = make([]interface{}, len(v.Series.S)) for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg1Val[i], ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + arg1Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//set: arg 2: block item: expected native of type any") + return env.NewError("Go(binding.ExternalUntypedList)//set: arg 2: " + "block item: " + "expected native of type interface{}, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//set: arg 2: block item: expected native") + return env.NewError("Go(binding.ExternalUntypedList)//set: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]any) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//set: arg 2: expected native of type []any") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntypedList)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//set: arg 2: expected block, native or nil") + return env.NewError("Go(binding.ExternalUntypedList)//set: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -122824,44 +123061,44 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalUntypedList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntypedList)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalUntypedList) - if !ok { + if vc, ok := v.Value.(binding.ExternalUntypedList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//set-value: arg 1: expected native of type binding.ExternalUntypedList") + return env.NewError("Go(binding.ExternalUntypedList)//set-value: arg 1: " + "expected native of type binding.ExternalUntypedList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntypedList)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//set-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalUntypedList)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//set-value: arg 2: expected integer") + return env.NewError("Go(binding.ExternalUntypedList)//set-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } - var arg2Val any + var arg2Val interface{} switch v := arg2.(type) { case env.Native: - var ok bool - arg2Val, ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//set-value: arg 3: expected native of type any") + return env.NewError("Go(binding.ExternalUntypedList)//set-value: arg 3: " + "expected native of type interface{}, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedList)//set-value: arg 3: expected native") + return env.NewError("Go(binding.ExternalUntypedList)//set-value: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -122886,24 +123123,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalUntypedMap(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntypedMap)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalUntypedMap) - if !ok { + if vc, ok := v.Value.(binding.ExternalUntypedMap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//add-listener: arg 1: expected native of type binding.ExternalUntypedMap") + return env.NewError("Go(binding.ExternalUntypedMap)//add-listener: arg 1: " + "expected native of type binding.ExternalUntypedMap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntypedMap)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalUntypedMap)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -122912,24 +123149,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntypedMap)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalUntypedMap)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntypedMap)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalUntypedMap)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -122946,31 +123183,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalUntypedMap(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//delete: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntypedMap)//delete: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalUntypedMap) - if !ok { + if vc, ok := v.Value.(binding.ExternalUntypedMap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//delete: arg 1: expected native of type binding.ExternalUntypedMap") + return env.NewError("Go(binding.ExternalUntypedMap)//delete: arg 1: " + "expected native of type binding.ExternalUntypedMap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//delete: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntypedMap)//delete: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//delete: arg 1: expected native") + return env.NewError("Go(binding.ExternalUntypedMap)//delete: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//delete: arg 2: expected string") + return env.NewError("Go(binding.ExternalUntypedMap)//delete: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.Delete(arg1Val) return arg0 @@ -122987,24 +123224,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalUntypedMap(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntypedMap)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalUntypedMap) - if !ok { + if vc, ok := v.Value.(binding.ExternalUntypedMap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//get: arg 1: expected native of type binding.ExternalUntypedMap") + return env.NewError("Go(binding.ExternalUntypedMap)//get: arg 1: " + "expected native of type binding.ExternalUntypedMap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntypedMap)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//get: arg 1: expected native") + return env.NewError("Go(binding.ExternalUntypedMap)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object @@ -123012,7 +123249,7 @@ var Builtins = map[string]*env.Builtin{ data := make(map[string]any, len(res0)) for mKey, mVal := range res0 { var dVal env.Object - dVal = *env.NewNative(ps.Idx, mVal, "Go(any)") + dVal = *env.NewNative(ps.Idx, mVal, "Go(interface{})") data[mKey] = dVal } res0Obj = *env.NewDict(data) @@ -123039,52 +123276,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalUntypedMap(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntypedMap)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalUntypedMap) - if !ok { + if vc, ok := v.Value.(binding.ExternalUntypedMap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//get-item: arg 1: expected native of type binding.ExternalUntypedMap") + return env.NewError("Go(binding.ExternalUntypedMap)//get-item: arg 1: " + "expected native of type binding.ExternalUntypedMap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntypedMap)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//get-item: arg 1: expected native") + return env.NewError("Go(binding.ExternalUntypedMap)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//get-item: arg 2: expected string") + return env.NewError("Go(binding.ExternalUntypedMap)//get-item: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -123107,35 +123327,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalUntypedMap(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntypedMap)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalUntypedMap) - if !ok { + if vc, ok := v.Value.(binding.ExternalUntypedMap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//get-value: arg 1: expected native of type binding.ExternalUntypedMap") + return env.NewError("Go(binding.ExternalUntypedMap)//get-value: arg 1: " + "expected native of type binding.ExternalUntypedMap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntypedMap)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//get-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalUntypedMap)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//get-value: arg 2: expected string") + return env.NewError("Go(binding.ExternalUntypedMap)//get-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object - res0Obj = *env.NewNative(ps.Idx, res0, "Go(any)") + res0Obj = *env.NewNative(ps.Idx, res0, "Go(interface{})") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -123158,24 +123378,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalUntypedMap(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//keys: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntypedMap)//keys: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalUntypedMap) - if !ok { + if vc, ok := v.Value.(binding.ExternalUntypedMap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//keys: arg 1: expected native of type binding.ExternalUntypedMap") + return env.NewError("Go(binding.ExternalUntypedMap)//keys: arg 1: " + "expected native of type binding.ExternalUntypedMap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//keys: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntypedMap)//keys: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//keys: arg 1: expected native") + return env.NewError("Go(binding.ExternalUntypedMap)//keys: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Keys() var res0Obj env.Object @@ -123200,24 +123420,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalUntypedMap(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//reload: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntypedMap)//reload: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalUntypedMap) - if !ok { + if vc, ok := v.Value.(binding.ExternalUntypedMap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//reload: arg 1: expected native of type binding.ExternalUntypedMap") + return env.NewError("Go(binding.ExternalUntypedMap)//reload: arg 1: " + "expected native of type binding.ExternalUntypedMap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//reload: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntypedMap)//reload: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//reload: arg 1: expected native") + return env.NewError("Go(binding.ExternalUntypedMap)//reload: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Reload() var resErrObj env.Object @@ -123242,24 +123462,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalUntypedMap(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntypedMap)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalUntypedMap) - if !ok { + if vc, ok := v.Value.(binding.ExternalUntypedMap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//remove-listener: arg 1: expected native of type binding.ExternalUntypedMap") + return env.NewError("Go(binding.ExternalUntypedMap)//remove-listener: arg 1: " + "expected native of type binding.ExternalUntypedMap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntypedMap)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.ExternalUntypedMap)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -123268,24 +123488,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntypedMap)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.ExternalUntypedMap)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntypedMap)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.ExternalUntypedMap)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -123302,91 +123522,84 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalUntypedMap(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntypedMap)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalUntypedMap) - if !ok { + if vc, ok := v.Value.(binding.ExternalUntypedMap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//set: arg 1: expected native of type binding.ExternalUntypedMap") + return env.NewError("Go(binding.ExternalUntypedMap)//set: arg 1: " + "expected native of type binding.ExternalUntypedMap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntypedMap)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//set: arg 1: expected native") + return env.NewError("Go(binding.ExternalUntypedMap)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val map[string]any + var arg1Val map[string]interface{} switch v := arg1.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//set: arg 2: expected block to have length of multiple of 2") + return env.NewError("Go(binding.ExternalUntypedMap)//set: arg 2: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } - arg1Val = make(map[string]any, len(v.Series.S)/2) + arg1Val = make(map[string]interface{}, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//set: arg 2: map key: expected string") + return env.NewError("Go(binding.ExternalUntypedMap)//set: arg 2: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } - var mapV any + var mapV interface{} switch v := v.Series.S[i+1].(type) { case env.Native: - var ok bool - mapV, ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + mapV = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//set: arg 2: map value: expected native of type any") + return env.NewError("Go(binding.ExternalUntypedMap)//set: arg 2: " + "map value: " + "expected native of type interface{}, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//set: arg 2: map value: expected native") + return env.NewError("Go(binding.ExternalUntypedMap)//set: arg 2: " + "map value: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } case env.Dict: - arg1Val = make(map[string]any, len(v.Data)) + arg1Val = make(map[string]interface{}, len(v.Data)) for dictK, dictV := range v.Data { mapK := dictK - var mapV any + var mapV interface{} switch v := dictV.(type) { case env.Native: - var ok bool - mapV, ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + mapV = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//set: arg 2: map value: expected native of type any") + return env.NewError("Go(binding.ExternalUntypedMap)//set: arg 2: " + "map value: " + "expected native of type interface{}, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//set: arg 2: map value: expected native") + return env.NewError("Go(binding.ExternalUntypedMap)//set: arg 2: " + "map value: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } - case env.Native: - var ok bool - arg1Val, ok = v.Value.(map[string]any) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//set: arg 2: expected native of type map[string]any") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntypedMap)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//set: arg 2: expected native, block, dict or nil") + return env.NewError("Go(binding.ExternalUntypedMap)//set: arg 2: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -123411,44 +123624,44 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_ExternalUntypedMap(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.ExternalUntypedMap)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.ExternalUntypedMap) - if !ok { + if vc, ok := v.Value.(binding.ExternalUntypedMap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//set-value: arg 1: expected native of type binding.ExternalUntypedMap") + return env.NewError("Go(binding.ExternalUntypedMap)//set-value: arg 1: " + "expected native of type binding.ExternalUntypedMap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.ExternalUntypedMap)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//set-value: arg 1: expected native") + return env.NewError("Go(binding.ExternalUntypedMap)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//set-value: arg 2: expected string") + return env.NewError("Go(binding.ExternalUntypedMap)//set-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } - var arg2Val any + var arg2Val interface{} switch v := arg2.(type) { case env.Native: - var ok bool - arg2Val, ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//set-value: arg 3: expected native of type any") + return env.NewError("Go(binding.ExternalUntypedMap)//set-value: arg 3: " + "expected native of type interface{}, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.ExternalUntypedMap)//set-value: arg 3: expected native") + return env.NewError("Go(binding.ExternalUntypedMap)//set-value: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -123473,24 +123686,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Float(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Float)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Float)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Float) - if !ok { + if vc, ok := v.Value.(binding.Float); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Float)//add-listener: arg 1: expected native of type binding.Float") + return env.NewError("Go(binding.Float)//add-listener: arg 1: " + "expected native of type binding.Float, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Float)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Float)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Float)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.Float)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -123499,24 +123712,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Float)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.Float)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Float)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.Float)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Float)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.Float)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Float)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.Float)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -123533,24 +123746,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Float(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Float)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Float)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Float) - if !ok { + if vc, ok := v.Value.(binding.Float); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Float)//get: arg 1: expected native of type binding.Float") + return env.NewError("Go(binding.Float)//get: arg 1: " + "expected native of type binding.Float, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Float)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Float)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Float)//get: arg 1: expected native") + return env.NewError("Go(binding.Float)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object @@ -123577,24 +123790,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Float(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Float)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Float)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Float) - if !ok { + if vc, ok := v.Value.(binding.Float); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Float)//remove-listener: arg 1: expected native of type binding.Float") + return env.NewError("Go(binding.Float)//remove-listener: arg 1: " + "expected native of type binding.Float, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Float)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Float)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Float)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.Float)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -123603,24 +123816,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Float)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.Float)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Float)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.Float)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Float)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.Float)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Float)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.Float)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -123637,31 +123850,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Float(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Float)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Float)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Float) - if !ok { + if vc, ok := v.Value.(binding.Float); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Float)//set: arg 1: expected native of type binding.Float") + return env.NewError("Go(binding.Float)//set: arg 1: " + "expected native of type binding.Float, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Float)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Float)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Float)//set: arg 1: expected native") + return env.NewError("Go(binding.Float)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val float64 - if v, ok := arg1.(env.Decimal); ok { - arg1Val = float64(v.Value) + if vc, ok := arg1.(env.Decimal); ok { + arg1Val = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.Float)//set: arg 2: expected decimal") + return env.NewError("Go(binding.Float)//set: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -123686,24 +123899,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_FloatList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.FloatList)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.FloatList) - if !ok { + if vc, ok := v.Value.(binding.FloatList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//add-listener: arg 1: expected native of type binding.FloatList") + return env.NewError("Go(binding.FloatList)//add-listener: arg 1: " + "expected native of type binding.FloatList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.FloatList)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.FloatList)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -123712,24 +123925,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.FloatList)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.FloatList)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.FloatList)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.FloatList)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -123746,31 +123959,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_FloatList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.FloatList)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.FloatList) - if !ok { + if vc, ok := v.Value.(binding.FloatList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//append: arg 1: expected native of type binding.FloatList") + return env.NewError("Go(binding.FloatList)//append: arg 1: " + "expected native of type binding.FloatList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.FloatList)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//append: arg 1: expected native") + return env.NewError("Go(binding.FloatList)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val float64 - if v, ok := arg1.(env.Decimal); ok { - arg1Val = float64(v.Value) + if vc, ok := arg1.(env.Decimal); ok { + arg1Val = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//append: arg 2: expected decimal") + return env.NewError("Go(binding.FloatList)//append: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } resErr := arg0Val.Append(arg1Val) var resErrObj env.Object @@ -123795,24 +124008,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_FloatList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.FloatList)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.FloatList) - if !ok { + if vc, ok := v.Value.(binding.FloatList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//get: arg 1: expected native of type binding.FloatList") + return env.NewError("Go(binding.FloatList)//get: arg 1: " + "expected native of type binding.FloatList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.FloatList)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//get: arg 1: expected native") + return env.NewError("Go(binding.FloatList)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object @@ -123845,52 +124058,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_FloatList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.FloatList)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.FloatList) - if !ok { + if vc, ok := v.Value.(binding.FloatList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//get-item: arg 1: expected native of type binding.FloatList") + return env.NewError("Go(binding.FloatList)//get-item: arg 1: " + "expected native of type binding.FloatList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.FloatList)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//get-item: arg 1: expected native") + return env.NewError("Go(binding.FloatList)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//get-item: arg 2: expected integer") + return env.NewError("Go(binding.FloatList)//get-item: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -123913,31 +124109,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_FloatList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.FloatList)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.FloatList) - if !ok { + if vc, ok := v.Value.(binding.FloatList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//get-value: arg 1: expected native of type binding.FloatList") + return env.NewError("Go(binding.FloatList)//get-value: arg 1: " + "expected native of type binding.FloatList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.FloatList)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//get-value: arg 1: expected native") + return env.NewError("Go(binding.FloatList)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//get-value: arg 2: expected integer") + return env.NewError("Go(binding.FloatList)//get-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object @@ -123964,24 +124160,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_FloatList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//length: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.FloatList)//length: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.FloatList) - if !ok { + if vc, ok := v.Value.(binding.FloatList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//length: arg 1: expected native of type binding.FloatList") + return env.NewError("Go(binding.FloatList)//length: arg 1: " + "expected native of type binding.FloatList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//length: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.FloatList)//length: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//length: arg 1: expected native") + return env.NewError("Go(binding.FloatList)//length: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Length() var res0Obj env.Object @@ -124000,31 +124196,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_FloatList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.FloatList)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.FloatList) - if !ok { + if vc, ok := v.Value.(binding.FloatList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//prepend: arg 1: expected native of type binding.FloatList") + return env.NewError("Go(binding.FloatList)//prepend: arg 1: " + "expected native of type binding.FloatList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.FloatList)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//prepend: arg 1: expected native") + return env.NewError("Go(binding.FloatList)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val float64 - if v, ok := arg1.(env.Decimal); ok { - arg1Val = float64(v.Value) + if vc, ok := arg1.(env.Decimal); ok { + arg1Val = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//prepend: arg 2: expected decimal") + return env.NewError("Go(binding.FloatList)//prepend: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } resErr := arg0Val.Prepend(arg1Val) var resErrObj env.Object @@ -124049,24 +124245,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_FloatList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.FloatList)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.FloatList) - if !ok { + if vc, ok := v.Value.(binding.FloatList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//remove-listener: arg 1: expected native of type binding.FloatList") + return env.NewError("Go(binding.FloatList)//remove-listener: arg 1: " + "expected native of type binding.FloatList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.FloatList)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.FloatList)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -124075,24 +124271,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.FloatList)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.FloatList)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.FloatList)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.FloatList)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -124109,53 +124305,46 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_FloatList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.FloatList)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.FloatList) - if !ok { + if vc, ok := v.Value.(binding.FloatList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//set: arg 1: expected native of type binding.FloatList") + return env.NewError("Go(binding.FloatList)//set: arg 1: " + "expected native of type binding.FloatList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.FloatList)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//set: arg 1: expected native") + return env.NewError("Go(binding.FloatList)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []float64 switch v := arg1.(type) { case env.Block: arg1Val = make([]float64, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.Decimal); ok { - arg1Val[i] = float64(v.Value) + if vc, ok := it.(env.Decimal); ok { + arg1Val[i] = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//set: arg 2: block item: expected decimal") + return env.NewError("Go(binding.FloatList)//set: arg 2: " + "block item: " + "expected decimal, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]float64) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//set: arg 2: expected native of type []float64") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.FloatList)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//set: arg 2: expected block, native or nil") + return env.NewError("Go(binding.FloatList)//set: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -124180,38 +124369,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_FloatList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.FloatList)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.FloatList) - if !ok { + if vc, ok := v.Value.(binding.FloatList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//set-value: arg 1: expected native of type binding.FloatList") + return env.NewError("Go(binding.FloatList)//set-value: arg 1: " + "expected native of type binding.FloatList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.FloatList)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//set-value: arg 1: expected native") + return env.NewError("Go(binding.FloatList)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//set-value: arg 2: expected integer") + return env.NewError("Go(binding.FloatList)//set-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val float64 - if v, ok := arg2.(env.Decimal); ok { - arg2Val = float64(v.Value) + if vc, ok := arg2.(env.Decimal); ok { + arg2Val = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatList)//set-value: arg 3: expected decimal") + return env.NewError("Go(binding.FloatList)//set-value: arg 3: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg2)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -124236,24 +124425,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_FloatTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.FloatTree)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.FloatTree) - if !ok { + if vc, ok := v.Value.(binding.FloatTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//add-listener: arg 1: expected native of type binding.FloatTree") + return env.NewError("Go(binding.FloatTree)//add-listener: arg 1: " + "expected native of type binding.FloatTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.FloatTree)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.FloatTree)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -124262,24 +124451,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.FloatTree)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.FloatTree)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.FloatTree)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.FloatTree)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -124296,45 +124485,45 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_FloatTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.FloatTree)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.FloatTree) - if !ok { + if vc, ok := v.Value.(binding.FloatTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//append: arg 1: expected native of type binding.FloatTree") + return env.NewError("Go(binding.FloatTree)//append: arg 1: " + "expected native of type binding.FloatTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.FloatTree)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//append: arg 1: expected native") + return env.NewError("Go(binding.FloatTree)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//append: arg 2: expected string") + return env.NewError("Go(binding.FloatTree)//append: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//append: arg 3: expected string") + return env.NewError("Go(binding.FloatTree)//append: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val float64 - if v, ok := arg3.(env.Decimal); ok { - arg3Val = float64(v.Value) + if vc, ok := arg3.(env.Decimal); ok { + arg3Val = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//append: arg 4: expected decimal") + return env.NewError("Go(binding.FloatTree)//append: arg 4: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg3)) } resErr := arg0Val.Append(arg1Val, arg2Val, arg3Val) var resErrObj env.Object @@ -124359,31 +124548,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_FloatTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//child-i-ds: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.FloatTree)//child-i-ds: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.FloatTree) - if !ok { + if vc, ok := v.Value.(binding.FloatTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//child-i-ds: arg 1: expected native of type binding.FloatTree") + return env.NewError("Go(binding.FloatTree)//child-i-ds: arg 1: " + "expected native of type binding.FloatTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//child-i-ds: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.FloatTree)//child-i-ds: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//child-i-ds: arg 1: expected native") + return env.NewError("Go(binding.FloatTree)//child-i-ds: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//child-i-ds: arg 2: expected string") + return env.NewError("Go(binding.FloatTree)//child-i-ds: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := arg0Val.ChildIDs(arg1Val) var res0Obj env.Object @@ -124408,24 +124597,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_FloatTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.FloatTree)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.FloatTree) - if !ok { + if vc, ok := v.Value.(binding.FloatTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//get: arg 1: expected native of type binding.FloatTree") + return env.NewError("Go(binding.FloatTree)//get: arg 1: " + "expected native of type binding.FloatTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.FloatTree)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//get: arg 1: expected native") + return env.NewError("Go(binding.FloatTree)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, res1, resErr := arg0Val.Get() var res0Obj env.Object @@ -124479,52 +124668,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_FloatTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.FloatTree)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.FloatTree) - if !ok { + if vc, ok := v.Value.(binding.FloatTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//get-item: arg 1: expected native of type binding.FloatTree") + return env.NewError("Go(binding.FloatTree)//get-item: arg 1: " + "expected native of type binding.FloatTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.FloatTree)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//get-item: arg 1: expected native") + return env.NewError("Go(binding.FloatTree)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//get-item: arg 2: expected string") + return env.NewError("Go(binding.FloatTree)//get-item: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -124547,31 +124719,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_FloatTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.FloatTree)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.FloatTree) - if !ok { + if vc, ok := v.Value.(binding.FloatTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//get-value: arg 1: expected native of type binding.FloatTree") + return env.NewError("Go(binding.FloatTree)//get-value: arg 1: " + "expected native of type binding.FloatTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.FloatTree)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//get-value: arg 1: expected native") + return env.NewError("Go(binding.FloatTree)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//get-value: arg 2: expected string") + return env.NewError("Go(binding.FloatTree)//get-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object @@ -124598,45 +124770,45 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_FloatTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.FloatTree)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.FloatTree) - if !ok { + if vc, ok := v.Value.(binding.FloatTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//prepend: arg 1: expected native of type binding.FloatTree") + return env.NewError("Go(binding.FloatTree)//prepend: arg 1: " + "expected native of type binding.FloatTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.FloatTree)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//prepend: arg 1: expected native") + return env.NewError("Go(binding.FloatTree)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//prepend: arg 2: expected string") + return env.NewError("Go(binding.FloatTree)//prepend: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//prepend: arg 3: expected string") + return env.NewError("Go(binding.FloatTree)//prepend: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val float64 - if v, ok := arg3.(env.Decimal); ok { - arg3Val = float64(v.Value) + if vc, ok := arg3.(env.Decimal); ok { + arg3Val = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//prepend: arg 4: expected decimal") + return env.NewError("Go(binding.FloatTree)//prepend: arg 4: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg3)) } resErr := arg0Val.Prepend(arg1Val, arg2Val, arg3Val) var resErrObj env.Object @@ -124661,24 +124833,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_FloatTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.FloatTree)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.FloatTree) - if !ok { + if vc, ok := v.Value.(binding.FloatTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//remove-listener: arg 1: expected native of type binding.FloatTree") + return env.NewError("Go(binding.FloatTree)//remove-listener: arg 1: " + "expected native of type binding.FloatTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.FloatTree)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.FloatTree)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -124687,24 +124859,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.FloatTree)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.FloatTree)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.FloatTree)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.FloatTree)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -124721,69 +124893,62 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_FloatTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.FloatTree)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.FloatTree) - if !ok { + if vc, ok := v.Value.(binding.FloatTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set: arg 1: expected native of type binding.FloatTree") + return env.NewError("Go(binding.FloatTree)//set: arg 1: " + "expected native of type binding.FloatTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.FloatTree)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set: arg 1: expected native") + return env.NewError("Go(binding.FloatTree)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val map[string][]string switch v := arg1.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set: arg 2: expected block to have length of multiple of 2") + return env.NewError("Go(binding.FloatTree)//set: arg 2: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } arg1Val = make(map[string][]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set: arg 2: map key: expected string") + return env.NewError("Go(binding.FloatTree)//set: arg 2: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV []string switch v := v.Series.S[i+1].(type) { case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set: arg 2: map value: block item: expected string") + return env.NewError("Go(binding.FloatTree)//set: arg 2: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set: arg 2: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set: arg 2: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.FloatTree)//set: arg 2: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set: arg 2: map value: expected block, native or nil") + return env.NewError("Go(binding.FloatTree)//set: arg 2: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } @@ -124796,71 +124961,57 @@ var Builtins = map[string]*env.Builtin{ case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set: arg 2: map value: block item: expected string") + return env.NewError("Go(binding.FloatTree)//set: arg 2: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set: arg 2: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set: arg 2: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.FloatTree)//set: arg 2: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set: arg 2: map value: expected block, native or nil") + return env.NewError("Go(binding.FloatTree)//set: arg 2: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } - case env.Native: - var ok bool - arg1Val, ok = v.Value.(map[string][]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set: arg 2: expected native of type map[string][]string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.FloatTree)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set: arg 2: expected native, block, dict or nil") + return env.NewError("Go(binding.FloatTree)//set: arg 2: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } var arg2Val map[string]float64 switch v := arg2.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set: arg 3: expected block to have length of multiple of 2") + return env.NewError("Go(binding.FloatTree)//set: arg 3: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } arg2Val = make(map[string]float64, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set: arg 3: map key: expected string") + return env.NewError("Go(binding.FloatTree)//set: arg 3: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV float64 - if v, ok := v.Series.S[i+1].(env.Decimal); ok { - mapV = float64(v.Value) + if vc, ok := v.Series.S[i+1].(env.Decimal); ok { + mapV = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set: arg 3: map value: expected decimal") + return env.NewError("Go(binding.FloatTree)//set: arg 3: " + "map value: " + "expected decimal, but got " + objectDebugString(ps.Idx, v.Series.S[i+1])) } arg2Val[mapK] = mapV } @@ -124869,30 +125020,23 @@ var Builtins = map[string]*env.Builtin{ for dictK, dictV := range v.Data { mapK := dictK var mapV float64 - if v, ok := dictV.(env.Decimal); ok { - mapV = float64(v.Value) + if vc, ok := dictV.(env.Decimal); ok { + mapV = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set: arg 3: map value: expected decimal") + return env.NewError("Go(binding.FloatTree)//set: arg 3: " + "map value: " + "expected decimal, but got " + objectDebugString(ps.Idx, dictV)) } arg2Val[mapK] = mapV } - case env.Native: - var ok bool - arg2Val, ok = v.Value.(map[string]float64) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set: arg 3: expected native of type map[string]float64") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(binding.FloatTree)//set: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set: arg 3: expected native, block, dict or nil") + return env.NewError("Go(binding.FloatTree)//set: arg 3: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val, arg2Val) var resErrObj env.Object @@ -124917,38 +125061,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_FloatTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.FloatTree)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.FloatTree) - if !ok { + if vc, ok := v.Value.(binding.FloatTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set-value: arg 1: expected native of type binding.FloatTree") + return env.NewError("Go(binding.FloatTree)//set-value: arg 1: " + "expected native of type binding.FloatTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.FloatTree)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set-value: arg 1: expected native") + return env.NewError("Go(binding.FloatTree)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set-value: arg 2: expected string") + return env.NewError("Go(binding.FloatTree)//set-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val float64 - if v, ok := arg2.(env.Decimal); ok { - arg2Val = float64(v.Value) + if vc, ok := arg2.(env.Decimal); ok { + arg2Val = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.FloatTree)//set-value: arg 3: expected decimal") + return env.NewError("Go(binding.FloatTree)//set-value: arg 3: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg2)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -124973,24 +125117,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Int(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Int)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Int)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Int) - if !ok { + if vc, ok := v.Value.(binding.Int); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Int)//add-listener: arg 1: expected native of type binding.Int") + return env.NewError("Go(binding.Int)//add-listener: arg 1: " + "expected native of type binding.Int, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Int)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Int)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Int)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.Int)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -124999,24 +125143,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Int)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.Int)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Int)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.Int)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Int)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.Int)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Int)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.Int)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -125033,24 +125177,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Int(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Int)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Int)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Int) - if !ok { + if vc, ok := v.Value.(binding.Int); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Int)//get: arg 1: expected native of type binding.Int") + return env.NewError("Go(binding.Int)//get: arg 1: " + "expected native of type binding.Int, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Int)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Int)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Int)//get: arg 1: expected native") + return env.NewError("Go(binding.Int)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object @@ -125077,24 +125221,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Int(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Int)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Int)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Int) - if !ok { + if vc, ok := v.Value.(binding.Int); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Int)//remove-listener: arg 1: expected native of type binding.Int") + return env.NewError("Go(binding.Int)//remove-listener: arg 1: " + "expected native of type binding.Int, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Int)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Int)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Int)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.Int)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -125103,24 +125247,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Int)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.Int)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Int)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.Int)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Int)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.Int)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Int)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.Int)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -125137,31 +125281,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Int(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Int)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Int)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Int) - if !ok { + if vc, ok := v.Value.(binding.Int); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Int)//set: arg 1: expected native of type binding.Int") + return env.NewError("Go(binding.Int)//set: arg 1: " + "expected native of type binding.Int, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Int)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Int)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Int)//set: arg 1: expected native") + return env.NewError("Go(binding.Int)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.Int)//set: arg 2: expected integer") + return env.NewError("Go(binding.Int)//set: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -125186,24 +125330,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_IntList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.IntList)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.IntList) - if !ok { + if vc, ok := v.Value.(binding.IntList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//add-listener: arg 1: expected native of type binding.IntList") + return env.NewError("Go(binding.IntList)//add-listener: arg 1: " + "expected native of type binding.IntList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.IntList)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.IntList)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -125212,24 +125356,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.IntList)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.IntList)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.IntList)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.IntList)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -125246,31 +125390,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_IntList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.IntList)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.IntList) - if !ok { + if vc, ok := v.Value.(binding.IntList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//append: arg 1: expected native of type binding.IntList") + return env.NewError("Go(binding.IntList)//append: arg 1: " + "expected native of type binding.IntList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.IntList)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//append: arg 1: expected native") + return env.NewError("Go(binding.IntList)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//append: arg 2: expected integer") + return env.NewError("Go(binding.IntList)//append: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } resErr := arg0Val.Append(arg1Val) var resErrObj env.Object @@ -125295,24 +125439,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_IntList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.IntList)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.IntList) - if !ok { + if vc, ok := v.Value.(binding.IntList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//get: arg 1: expected native of type binding.IntList") + return env.NewError("Go(binding.IntList)//get: arg 1: " + "expected native of type binding.IntList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.IntList)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//get: arg 1: expected native") + return env.NewError("Go(binding.IntList)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object @@ -125345,52 +125489,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_IntList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.IntList)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.IntList) - if !ok { + if vc, ok := v.Value.(binding.IntList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//get-item: arg 1: expected native of type binding.IntList") + return env.NewError("Go(binding.IntList)//get-item: arg 1: " + "expected native of type binding.IntList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.IntList)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//get-item: arg 1: expected native") + return env.NewError("Go(binding.IntList)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//get-item: arg 2: expected integer") + return env.NewError("Go(binding.IntList)//get-item: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -125413,31 +125540,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_IntList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.IntList)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.IntList) - if !ok { + if vc, ok := v.Value.(binding.IntList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//get-value: arg 1: expected native of type binding.IntList") + return env.NewError("Go(binding.IntList)//get-value: arg 1: " + "expected native of type binding.IntList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.IntList)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//get-value: arg 1: expected native") + return env.NewError("Go(binding.IntList)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//get-value: arg 2: expected integer") + return env.NewError("Go(binding.IntList)//get-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object @@ -125464,24 +125591,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_IntList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//length: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.IntList)//length: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.IntList) - if !ok { + if vc, ok := v.Value.(binding.IntList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//length: arg 1: expected native of type binding.IntList") + return env.NewError("Go(binding.IntList)//length: arg 1: " + "expected native of type binding.IntList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//length: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.IntList)//length: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//length: arg 1: expected native") + return env.NewError("Go(binding.IntList)//length: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Length() var res0Obj env.Object @@ -125500,31 +125627,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_IntList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.IntList)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.IntList) - if !ok { + if vc, ok := v.Value.(binding.IntList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//prepend: arg 1: expected native of type binding.IntList") + return env.NewError("Go(binding.IntList)//prepend: arg 1: " + "expected native of type binding.IntList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.IntList)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//prepend: arg 1: expected native") + return env.NewError("Go(binding.IntList)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//prepend: arg 2: expected integer") + return env.NewError("Go(binding.IntList)//prepend: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } resErr := arg0Val.Prepend(arg1Val) var resErrObj env.Object @@ -125549,24 +125676,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_IntList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.IntList)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.IntList) - if !ok { + if vc, ok := v.Value.(binding.IntList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//remove-listener: arg 1: expected native of type binding.IntList") + return env.NewError("Go(binding.IntList)//remove-listener: arg 1: " + "expected native of type binding.IntList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.IntList)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.IntList)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -125575,24 +125702,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.IntList)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.IntList)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.IntList)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.IntList)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -125609,53 +125736,46 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_IntList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.IntList)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.IntList) - if !ok { + if vc, ok := v.Value.(binding.IntList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//set: arg 1: expected native of type binding.IntList") + return env.NewError("Go(binding.IntList)//set: arg 1: " + "expected native of type binding.IntList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.IntList)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//set: arg 1: expected native") + return env.NewError("Go(binding.IntList)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []int switch v := arg1.(type) { case env.Block: arg1Val = make([]int, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.Integer); ok { - arg1Val[i] = int(v.Value) + if vc, ok := it.(env.Integer); ok { + arg1Val[i] = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//set: arg 2: block item: expected integer") + return env.NewError("Go(binding.IntList)//set: arg 2: " + "block item: " + "expected integer, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]int) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//set: arg 2: expected native of type []int") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.IntList)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//set: arg 2: expected block, native or nil") + return env.NewError("Go(binding.IntList)//set: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -125680,38 +125800,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_IntList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.IntList)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.IntList) - if !ok { + if vc, ok := v.Value.(binding.IntList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//set-value: arg 1: expected native of type binding.IntList") + return env.NewError("Go(binding.IntList)//set-value: arg 1: " + "expected native of type binding.IntList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.IntList)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//set-value: arg 1: expected native") + return env.NewError("Go(binding.IntList)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//set-value: arg 2: expected integer") + return env.NewError("Go(binding.IntList)//set-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val int - if v, ok := arg2.(env.Integer); ok { - arg2Val = int(v.Value) + if vc, ok := arg2.(env.Integer); ok { + arg2Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntList)//set-value: arg 3: expected integer") + return env.NewError("Go(binding.IntList)//set-value: arg 3: " + "expected integer, but got " + objectDebugString(ps.Idx, arg2)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -125736,24 +125856,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_IntTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.IntTree)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.IntTree) - if !ok { + if vc, ok := v.Value.(binding.IntTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//add-listener: arg 1: expected native of type binding.IntTree") + return env.NewError("Go(binding.IntTree)//add-listener: arg 1: " + "expected native of type binding.IntTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.IntTree)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.IntTree)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -125762,24 +125882,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.IntTree)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.IntTree)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.IntTree)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.IntTree)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -125796,45 +125916,45 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_IntTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.IntTree)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.IntTree) - if !ok { + if vc, ok := v.Value.(binding.IntTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//append: arg 1: expected native of type binding.IntTree") + return env.NewError("Go(binding.IntTree)//append: arg 1: " + "expected native of type binding.IntTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.IntTree)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//append: arg 1: expected native") + return env.NewError("Go(binding.IntTree)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//append: arg 2: expected string") + return env.NewError("Go(binding.IntTree)//append: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//append: arg 3: expected string") + return env.NewError("Go(binding.IntTree)//append: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val int - if v, ok := arg3.(env.Integer); ok { - arg3Val = int(v.Value) + if vc, ok := arg3.(env.Integer); ok { + arg3Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//append: arg 4: expected integer") + return env.NewError("Go(binding.IntTree)//append: arg 4: " + "expected integer, but got " + objectDebugString(ps.Idx, arg3)) } resErr := arg0Val.Append(arg1Val, arg2Val, arg3Val) var resErrObj env.Object @@ -125859,31 +125979,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_IntTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//child-i-ds: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.IntTree)//child-i-ds: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.IntTree) - if !ok { + if vc, ok := v.Value.(binding.IntTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//child-i-ds: arg 1: expected native of type binding.IntTree") + return env.NewError("Go(binding.IntTree)//child-i-ds: arg 1: " + "expected native of type binding.IntTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//child-i-ds: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.IntTree)//child-i-ds: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//child-i-ds: arg 1: expected native") + return env.NewError("Go(binding.IntTree)//child-i-ds: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//child-i-ds: arg 2: expected string") + return env.NewError("Go(binding.IntTree)//child-i-ds: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := arg0Val.ChildIDs(arg1Val) var res0Obj env.Object @@ -125908,24 +126028,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_IntTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.IntTree)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.IntTree) - if !ok { + if vc, ok := v.Value.(binding.IntTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//get: arg 1: expected native of type binding.IntTree") + return env.NewError("Go(binding.IntTree)//get: arg 1: " + "expected native of type binding.IntTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.IntTree)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//get: arg 1: expected native") + return env.NewError("Go(binding.IntTree)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, res1, resErr := arg0Val.Get() var res0Obj env.Object @@ -125979,52 +126099,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_IntTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.IntTree)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.IntTree) - if !ok { + if vc, ok := v.Value.(binding.IntTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//get-item: arg 1: expected native of type binding.IntTree") + return env.NewError("Go(binding.IntTree)//get-item: arg 1: " + "expected native of type binding.IntTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.IntTree)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//get-item: arg 1: expected native") + return env.NewError("Go(binding.IntTree)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//get-item: arg 2: expected string") + return env.NewError("Go(binding.IntTree)//get-item: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -126047,31 +126150,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_IntTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.IntTree)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.IntTree) - if !ok { + if vc, ok := v.Value.(binding.IntTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//get-value: arg 1: expected native of type binding.IntTree") + return env.NewError("Go(binding.IntTree)//get-value: arg 1: " + "expected native of type binding.IntTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.IntTree)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//get-value: arg 1: expected native") + return env.NewError("Go(binding.IntTree)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//get-value: arg 2: expected string") + return env.NewError("Go(binding.IntTree)//get-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object @@ -126098,45 +126201,45 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_IntTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.IntTree)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.IntTree) - if !ok { + if vc, ok := v.Value.(binding.IntTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//prepend: arg 1: expected native of type binding.IntTree") + return env.NewError("Go(binding.IntTree)//prepend: arg 1: " + "expected native of type binding.IntTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.IntTree)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//prepend: arg 1: expected native") + return env.NewError("Go(binding.IntTree)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//prepend: arg 2: expected string") + return env.NewError("Go(binding.IntTree)//prepend: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//prepend: arg 3: expected string") + return env.NewError("Go(binding.IntTree)//prepend: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val int - if v, ok := arg3.(env.Integer); ok { - arg3Val = int(v.Value) + if vc, ok := arg3.(env.Integer); ok { + arg3Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//prepend: arg 4: expected integer") + return env.NewError("Go(binding.IntTree)//prepend: arg 4: " + "expected integer, but got " + objectDebugString(ps.Idx, arg3)) } resErr := arg0Val.Prepend(arg1Val, arg2Val, arg3Val) var resErrObj env.Object @@ -126161,24 +126264,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_IntTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.IntTree)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.IntTree) - if !ok { + if vc, ok := v.Value.(binding.IntTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//remove-listener: arg 1: expected native of type binding.IntTree") + return env.NewError("Go(binding.IntTree)//remove-listener: arg 1: " + "expected native of type binding.IntTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.IntTree)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.IntTree)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -126187,24 +126290,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.IntTree)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.IntTree)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.IntTree)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.IntTree)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -126221,69 +126324,62 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_IntTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.IntTree)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.IntTree) - if !ok { + if vc, ok := v.Value.(binding.IntTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set: arg 1: expected native of type binding.IntTree") + return env.NewError("Go(binding.IntTree)//set: arg 1: " + "expected native of type binding.IntTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.IntTree)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set: arg 1: expected native") + return env.NewError("Go(binding.IntTree)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val map[string][]string switch v := arg1.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set: arg 2: expected block to have length of multiple of 2") + return env.NewError("Go(binding.IntTree)//set: arg 2: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } arg1Val = make(map[string][]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set: arg 2: map key: expected string") + return env.NewError("Go(binding.IntTree)//set: arg 2: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV []string switch v := v.Series.S[i+1].(type) { case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set: arg 2: map value: block item: expected string") + return env.NewError("Go(binding.IntTree)//set: arg 2: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set: arg 2: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set: arg 2: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.IntTree)//set: arg 2: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set: arg 2: map value: expected block, native or nil") + return env.NewError("Go(binding.IntTree)//set: arg 2: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } @@ -126296,71 +126392,57 @@ var Builtins = map[string]*env.Builtin{ case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set: arg 2: map value: block item: expected string") + return env.NewError("Go(binding.IntTree)//set: arg 2: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set: arg 2: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set: arg 2: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.IntTree)//set: arg 2: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set: arg 2: map value: expected block, native or nil") + return env.NewError("Go(binding.IntTree)//set: arg 2: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } - case env.Native: - var ok bool - arg1Val, ok = v.Value.(map[string][]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set: arg 2: expected native of type map[string][]string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.IntTree)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set: arg 2: expected native, block, dict or nil") + return env.NewError("Go(binding.IntTree)//set: arg 2: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } var arg2Val map[string]int switch v := arg2.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set: arg 3: expected block to have length of multiple of 2") + return env.NewError("Go(binding.IntTree)//set: arg 3: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } arg2Val = make(map[string]int, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set: arg 3: map key: expected string") + return env.NewError("Go(binding.IntTree)//set: arg 3: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV int - if v, ok := v.Series.S[i+1].(env.Integer); ok { - mapV = int(v.Value) + if vc, ok := v.Series.S[i+1].(env.Integer); ok { + mapV = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set: arg 3: map value: expected integer") + return env.NewError("Go(binding.IntTree)//set: arg 3: " + "map value: " + "expected integer, but got " + objectDebugString(ps.Idx, v.Series.S[i+1])) } arg2Val[mapK] = mapV } @@ -126369,30 +126451,23 @@ var Builtins = map[string]*env.Builtin{ for dictK, dictV := range v.Data { mapK := dictK var mapV int - if v, ok := dictV.(env.Integer); ok { - mapV = int(v.Value) + if vc, ok := dictV.(env.Integer); ok { + mapV = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set: arg 3: map value: expected integer") + return env.NewError("Go(binding.IntTree)//set: arg 3: " + "map value: " + "expected integer, but got " + objectDebugString(ps.Idx, dictV)) } arg2Val[mapK] = mapV } - case env.Native: - var ok bool - arg2Val, ok = v.Value.(map[string]int) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set: arg 3: expected native of type map[string]int") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(binding.IntTree)//set: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set: arg 3: expected native, block, dict or nil") + return env.NewError("Go(binding.IntTree)//set: arg 3: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val, arg2Val) var resErrObj env.Object @@ -126417,38 +126492,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_IntTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.IntTree)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.IntTree) - if !ok { + if vc, ok := v.Value.(binding.IntTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set-value: arg 1: expected native of type binding.IntTree") + return env.NewError("Go(binding.IntTree)//set-value: arg 1: " + "expected native of type binding.IntTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.IntTree)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set-value: arg 1: expected native") + return env.NewError("Go(binding.IntTree)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set-value: arg 2: expected string") + return env.NewError("Go(binding.IntTree)//set-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val int - if v, ok := arg2.(env.Integer); ok { - arg2Val = int(v.Value) + if vc, ok := arg2.(env.Integer); ok { + arg2Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.IntTree)//set-value: arg 3: expected integer") + return env.NewError("Go(binding.IntTree)//set-value: arg 3: " + "expected integer, but got " + objectDebugString(ps.Idx, arg2)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -126473,24 +126548,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Rune(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Rune)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Rune)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Rune) - if !ok { + if vc, ok := v.Value.(binding.Rune); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Rune)//add-listener: arg 1: expected native of type binding.Rune") + return env.NewError("Go(binding.Rune)//add-listener: arg 1: " + "expected native of type binding.Rune, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Rune)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Rune)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Rune)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.Rune)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -126499,24 +126574,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Rune)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.Rune)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Rune)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.Rune)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Rune)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.Rune)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Rune)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.Rune)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -126533,24 +126608,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Rune(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Rune)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Rune)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Rune) - if !ok { + if vc, ok := v.Value.(binding.Rune); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Rune)//get: arg 1: expected native of type binding.Rune") + return env.NewError("Go(binding.Rune)//get: arg 1: " + "expected native of type binding.Rune, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Rune)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Rune)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Rune)//get: arg 1: expected native") + return env.NewError("Go(binding.Rune)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object @@ -126577,24 +126652,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Rune(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Rune)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Rune)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Rune) - if !ok { + if vc, ok := v.Value.(binding.Rune); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Rune)//remove-listener: arg 1: expected native of type binding.Rune") + return env.NewError("Go(binding.Rune)//remove-listener: arg 1: " + "expected native of type binding.Rune, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Rune)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Rune)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Rune)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.Rune)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -126603,24 +126678,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Rune)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.Rune)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Rune)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.Rune)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Rune)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.Rune)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Rune)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.Rune)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -126637,37 +126712,37 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Rune(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Rune)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Rune)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Rune) - if !ok { + if vc, ok := v.Value.(binding.Rune); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Rune)//set: arg 1: expected native of type binding.Rune") + return env.NewError("Go(binding.Rune)//set: arg 1: " + "expected native of type binding.Rune, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Rune)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Rune)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Rune)//set: arg 1: expected native") + return env.NewError("Go(binding.Rune)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val rune switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Rune)//set: arg 2: expected native of type rune") + return env.NewError("Go(binding.Rune)//set: arg 2: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.Rune)//set: arg 2: expected native") + return env.NewError("Go(binding.Rune)//set: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -126692,24 +126767,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_RuneList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.RuneList)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.RuneList) - if !ok { + if vc, ok := v.Value.(binding.RuneList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//add-listener: arg 1: expected native of type binding.RuneList") + return env.NewError("Go(binding.RuneList)//add-listener: arg 1: " + "expected native of type binding.RuneList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.RuneList)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.RuneList)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -126718,24 +126793,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.RuneList)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.RuneList)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.RuneList)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.RuneList)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -126752,37 +126827,37 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_RuneList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.RuneList)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.RuneList) - if !ok { + if vc, ok := v.Value.(binding.RuneList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//append: arg 1: expected native of type binding.RuneList") + return env.NewError("Go(binding.RuneList)//append: arg 1: " + "expected native of type binding.RuneList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.RuneList)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//append: arg 1: expected native") + return env.NewError("Go(binding.RuneList)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val rune switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//append: arg 2: expected native of type rune") + return env.NewError("Go(binding.RuneList)//append: arg 2: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//append: arg 2: expected native") + return env.NewError("Go(binding.RuneList)//append: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Append(arg1Val) var resErrObj env.Object @@ -126807,24 +126882,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_RuneList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.RuneList)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.RuneList) - if !ok { + if vc, ok := v.Value.(binding.RuneList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//get: arg 1: expected native of type binding.RuneList") + return env.NewError("Go(binding.RuneList)//get: arg 1: " + "expected native of type binding.RuneList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.RuneList)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//get: arg 1: expected native") + return env.NewError("Go(binding.RuneList)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object @@ -126857,52 +126932,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_RuneList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.RuneList)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.RuneList) - if !ok { + if vc, ok := v.Value.(binding.RuneList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//get-item: arg 1: expected native of type binding.RuneList") + return env.NewError("Go(binding.RuneList)//get-item: arg 1: " + "expected native of type binding.RuneList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.RuneList)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//get-item: arg 1: expected native") + return env.NewError("Go(binding.RuneList)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//get-item: arg 2: expected integer") + return env.NewError("Go(binding.RuneList)//get-item: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -126925,31 +126983,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_RuneList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.RuneList)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.RuneList) - if !ok { + if vc, ok := v.Value.(binding.RuneList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//get-value: arg 1: expected native of type binding.RuneList") + return env.NewError("Go(binding.RuneList)//get-value: arg 1: " + "expected native of type binding.RuneList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.RuneList)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//get-value: arg 1: expected native") + return env.NewError("Go(binding.RuneList)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//get-value: arg 2: expected integer") + return env.NewError("Go(binding.RuneList)//get-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object @@ -126976,24 +127034,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_RuneList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//length: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.RuneList)//length: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.RuneList) - if !ok { + if vc, ok := v.Value.(binding.RuneList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//length: arg 1: expected native of type binding.RuneList") + return env.NewError("Go(binding.RuneList)//length: arg 1: " + "expected native of type binding.RuneList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//length: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.RuneList)//length: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//length: arg 1: expected native") + return env.NewError("Go(binding.RuneList)//length: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Length() var res0Obj env.Object @@ -127012,37 +127070,37 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_RuneList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.RuneList)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.RuneList) - if !ok { + if vc, ok := v.Value.(binding.RuneList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//prepend: arg 1: expected native of type binding.RuneList") + return env.NewError("Go(binding.RuneList)//prepend: arg 1: " + "expected native of type binding.RuneList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.RuneList)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//prepend: arg 1: expected native") + return env.NewError("Go(binding.RuneList)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val rune switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//prepend: arg 2: expected native of type rune") + return env.NewError("Go(binding.RuneList)//prepend: arg 2: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//prepend: arg 2: expected native") + return env.NewError("Go(binding.RuneList)//prepend: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Prepend(arg1Val) var resErrObj env.Object @@ -127067,24 +127125,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_RuneList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.RuneList)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.RuneList) - if !ok { + if vc, ok := v.Value.(binding.RuneList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//remove-listener: arg 1: expected native of type binding.RuneList") + return env.NewError("Go(binding.RuneList)//remove-listener: arg 1: " + "expected native of type binding.RuneList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.RuneList)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.RuneList)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -127093,24 +127151,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.RuneList)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.RuneList)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.RuneList)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.RuneList)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -127127,24 +127185,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_RuneList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.RuneList)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.RuneList) - if !ok { + if vc, ok := v.Value.(binding.RuneList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//set: arg 1: expected native of type binding.RuneList") + return env.NewError("Go(binding.RuneList)//set: arg 1: " + "expected native of type binding.RuneList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.RuneList)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//set: arg 1: expected native") + return env.NewError("Go(binding.RuneList)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []rune switch v := arg1.(type) { @@ -127153,33 +127211,26 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg1Val[i], ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg1Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//set: arg 2: block item: expected native of type rune") + return env.NewError("Go(binding.RuneList)//set: arg 2: " + "block item: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//set: arg 2: block item: expected native") + return env.NewError("Go(binding.RuneList)//set: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]rune) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//set: arg 2: expected native of type []rune") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.RuneList)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//set: arg 2: expected block, native or nil") + return env.NewError("Go(binding.RuneList)//set: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -127204,44 +127255,44 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_RuneList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.RuneList)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.RuneList) - if !ok { + if vc, ok := v.Value.(binding.RuneList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//set-value: arg 1: expected native of type binding.RuneList") + return env.NewError("Go(binding.RuneList)//set-value: arg 1: " + "expected native of type binding.RuneList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.RuneList)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//set-value: arg 1: expected native") + return env.NewError("Go(binding.RuneList)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//set-value: arg 2: expected integer") + return env.NewError("Go(binding.RuneList)//set-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val rune switch v := arg2.(type) { case env.Native: - var ok bool - arg2Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//set-value: arg 3: expected native of type rune") + return env.NewError("Go(binding.RuneList)//set-value: arg 3: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneList)//set-value: arg 3: expected native") + return env.NewError("Go(binding.RuneList)//set-value: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -127266,24 +127317,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_RuneTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.RuneTree)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.RuneTree) - if !ok { + if vc, ok := v.Value.(binding.RuneTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//add-listener: arg 1: expected native of type binding.RuneTree") + return env.NewError("Go(binding.RuneTree)//add-listener: arg 1: " + "expected native of type binding.RuneTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.RuneTree)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.RuneTree)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -127292,24 +127343,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.RuneTree)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.RuneTree)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.RuneTree)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.RuneTree)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -127326,51 +127377,51 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_RuneTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.RuneTree)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.RuneTree) - if !ok { + if vc, ok := v.Value.(binding.RuneTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//append: arg 1: expected native of type binding.RuneTree") + return env.NewError("Go(binding.RuneTree)//append: arg 1: " + "expected native of type binding.RuneTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.RuneTree)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//append: arg 1: expected native") + return env.NewError("Go(binding.RuneTree)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//append: arg 2: expected string") + return env.NewError("Go(binding.RuneTree)//append: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//append: arg 3: expected string") + return env.NewError("Go(binding.RuneTree)//append: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val rune switch v := arg3.(type) { case env.Native: - var ok bool - arg3Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg3Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//append: arg 4: expected native of type rune") + return env.NewError("Go(binding.RuneTree)//append: arg 4: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//append: arg 4: expected native") + return env.NewError("Go(binding.RuneTree)//append: arg 4: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Append(arg1Val, arg2Val, arg3Val) var resErrObj env.Object @@ -127395,31 +127446,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_RuneTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//child-i-ds: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.RuneTree)//child-i-ds: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.RuneTree) - if !ok { + if vc, ok := v.Value.(binding.RuneTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//child-i-ds: arg 1: expected native of type binding.RuneTree") + return env.NewError("Go(binding.RuneTree)//child-i-ds: arg 1: " + "expected native of type binding.RuneTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//child-i-ds: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.RuneTree)//child-i-ds: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//child-i-ds: arg 1: expected native") + return env.NewError("Go(binding.RuneTree)//child-i-ds: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//child-i-ds: arg 2: expected string") + return env.NewError("Go(binding.RuneTree)//child-i-ds: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := arg0Val.ChildIDs(arg1Val) var res0Obj env.Object @@ -127444,24 +127495,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_RuneTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.RuneTree)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.RuneTree) - if !ok { + if vc, ok := v.Value.(binding.RuneTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//get: arg 1: expected native of type binding.RuneTree") + return env.NewError("Go(binding.RuneTree)//get: arg 1: " + "expected native of type binding.RuneTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.RuneTree)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//get: arg 1: expected native") + return env.NewError("Go(binding.RuneTree)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, res1, resErr := arg0Val.Get() var res0Obj env.Object @@ -127515,52 +127566,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_RuneTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.RuneTree)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.RuneTree) - if !ok { + if vc, ok := v.Value.(binding.RuneTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//get-item: arg 1: expected native of type binding.RuneTree") + return env.NewError("Go(binding.RuneTree)//get-item: arg 1: " + "expected native of type binding.RuneTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.RuneTree)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//get-item: arg 1: expected native") + return env.NewError("Go(binding.RuneTree)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//get-item: arg 2: expected string") + return env.NewError("Go(binding.RuneTree)//get-item: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -127583,31 +127617,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_RuneTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.RuneTree)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.RuneTree) - if !ok { + if vc, ok := v.Value.(binding.RuneTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//get-value: arg 1: expected native of type binding.RuneTree") + return env.NewError("Go(binding.RuneTree)//get-value: arg 1: " + "expected native of type binding.RuneTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.RuneTree)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//get-value: arg 1: expected native") + return env.NewError("Go(binding.RuneTree)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//get-value: arg 2: expected string") + return env.NewError("Go(binding.RuneTree)//get-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object @@ -127634,51 +127668,51 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_RuneTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.RuneTree)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.RuneTree) - if !ok { + if vc, ok := v.Value.(binding.RuneTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//prepend: arg 1: expected native of type binding.RuneTree") + return env.NewError("Go(binding.RuneTree)//prepend: arg 1: " + "expected native of type binding.RuneTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.RuneTree)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//prepend: arg 1: expected native") + return env.NewError("Go(binding.RuneTree)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//prepend: arg 2: expected string") + return env.NewError("Go(binding.RuneTree)//prepend: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//prepend: arg 3: expected string") + return env.NewError("Go(binding.RuneTree)//prepend: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val rune switch v := arg3.(type) { case env.Native: - var ok bool - arg3Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg3Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//prepend: arg 4: expected native of type rune") + return env.NewError("Go(binding.RuneTree)//prepend: arg 4: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//prepend: arg 4: expected native") + return env.NewError("Go(binding.RuneTree)//prepend: arg 4: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Prepend(arg1Val, arg2Val, arg3Val) var resErrObj env.Object @@ -127703,24 +127737,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_RuneTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.RuneTree)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.RuneTree) - if !ok { + if vc, ok := v.Value.(binding.RuneTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//remove-listener: arg 1: expected native of type binding.RuneTree") + return env.NewError("Go(binding.RuneTree)//remove-listener: arg 1: " + "expected native of type binding.RuneTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.RuneTree)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.RuneTree)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -127729,24 +127763,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.RuneTree)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.RuneTree)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.RuneTree)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.RuneTree)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -127763,69 +127797,62 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_RuneTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.RuneTree)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.RuneTree) - if !ok { + if vc, ok := v.Value.(binding.RuneTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set: arg 1: expected native of type binding.RuneTree") + return env.NewError("Go(binding.RuneTree)//set: arg 1: " + "expected native of type binding.RuneTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.RuneTree)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set: arg 1: expected native") + return env.NewError("Go(binding.RuneTree)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val map[string][]string switch v := arg1.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set: arg 2: expected block to have length of multiple of 2") + return env.NewError("Go(binding.RuneTree)//set: arg 2: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } arg1Val = make(map[string][]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set: arg 2: map key: expected string") + return env.NewError("Go(binding.RuneTree)//set: arg 2: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV []string switch v := v.Series.S[i+1].(type) { case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set: arg 2: map value: block item: expected string") + return env.NewError("Go(binding.RuneTree)//set: arg 2: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set: arg 2: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set: arg 2: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.RuneTree)//set: arg 2: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set: arg 2: map value: expected block, native or nil") + return env.NewError("Go(binding.RuneTree)//set: arg 2: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } @@ -127838,77 +127865,63 @@ var Builtins = map[string]*env.Builtin{ case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set: arg 2: map value: block item: expected string") + return env.NewError("Go(binding.RuneTree)//set: arg 2: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set: arg 2: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set: arg 2: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.RuneTree)//set: arg 2: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set: arg 2: map value: expected block, native or nil") + return env.NewError("Go(binding.RuneTree)//set: arg 2: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } - case env.Native: - var ok bool - arg1Val, ok = v.Value.(map[string][]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set: arg 2: expected native of type map[string][]string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.RuneTree)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set: arg 2: expected native, block, dict or nil") + return env.NewError("Go(binding.RuneTree)//set: arg 2: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } var arg2Val map[string]rune switch v := arg2.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set: arg 3: expected block to have length of multiple of 2") + return env.NewError("Go(binding.RuneTree)//set: arg 3: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } arg2Val = make(map[string]rune, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set: arg 3: map key: expected string") + return env.NewError("Go(binding.RuneTree)//set: arg 3: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV rune switch v := v.Series.S[i+1].(type) { case env.Native: - var ok bool - mapV, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + mapV = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set: arg 3: map value: expected native of type rune") + return env.NewError("Go(binding.RuneTree)//set: arg 3: " + "map value: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set: arg 3: map value: expected native") + return env.NewError("Go(binding.RuneTree)//set: arg 3: " + "map value: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg2Val[mapK] = mapV } @@ -127919,34 +127932,27 @@ var Builtins = map[string]*env.Builtin{ var mapV rune switch v := dictV.(type) { case env.Native: - var ok bool - mapV, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + mapV = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set: arg 3: map value: expected native of type rune") + return env.NewError("Go(binding.RuneTree)//set: arg 3: " + "map value: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set: arg 3: map value: expected native") + return env.NewError("Go(binding.RuneTree)//set: arg 3: " + "map value: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg2Val[mapK] = mapV } - case env.Native: - var ok bool - arg2Val, ok = v.Value.(map[string]rune) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set: arg 3: expected native of type map[string]rune") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(binding.RuneTree)//set: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set: arg 3: expected native, block, dict or nil") + return env.NewError("Go(binding.RuneTree)//set: arg 3: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val, arg2Val) var resErrObj env.Object @@ -127971,44 +127977,44 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_RuneTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.RuneTree)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.RuneTree) - if !ok { + if vc, ok := v.Value.(binding.RuneTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set-value: arg 1: expected native of type binding.RuneTree") + return env.NewError("Go(binding.RuneTree)//set-value: arg 1: " + "expected native of type binding.RuneTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.RuneTree)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set-value: arg 1: expected native") + return env.NewError("Go(binding.RuneTree)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set-value: arg 2: expected string") + return env.NewError("Go(binding.RuneTree)//set-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val rune switch v := arg2.(type) { case env.Native: - var ok bool - arg2Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set-value: arg 3: expected native of type rune") + return env.NewError("Go(binding.RuneTree)//set-value: arg 3: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.RuneTree)//set-value: arg 3: expected native") + return env.NewError("Go(binding.RuneTree)//set-value: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -128033,24 +128039,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_String(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.String)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.String)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.String) - if !ok { + if vc, ok := v.Value.(binding.String); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.String)//add-listener: arg 1: expected native of type binding.String") + return env.NewError("Go(binding.String)//add-listener: arg 1: " + "expected native of type binding.String, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.String)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.String)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.String)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.String)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -128059,24 +128065,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.String)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.String)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.String)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.String)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.String)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.String)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.String)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.String)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -128093,24 +128099,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_String(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.String)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.String)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.String) - if !ok { + if vc, ok := v.Value.(binding.String); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.String)//get: arg 1: expected native of type binding.String") + return env.NewError("Go(binding.String)//get: arg 1: " + "expected native of type binding.String, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.String)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.String)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.String)//get: arg 1: expected native") + return env.NewError("Go(binding.String)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object @@ -128137,24 +128143,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_String(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.String)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.String)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.String) - if !ok { + if vc, ok := v.Value.(binding.String); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.String)//remove-listener: arg 1: expected native of type binding.String") + return env.NewError("Go(binding.String)//remove-listener: arg 1: " + "expected native of type binding.String, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.String)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.String)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.String)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.String)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -128163,24 +128169,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.String)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.String)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.String)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.String)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.String)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.String)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.String)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.String)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -128197,31 +128203,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_String(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.String)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.String)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.String) - if !ok { + if vc, ok := v.Value.(binding.String); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.String)//set: arg 1: expected native of type binding.String") + return env.NewError("Go(binding.String)//set: arg 1: " + "expected native of type binding.String, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.String)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.String)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.String)//set: arg 1: expected native") + return env.NewError("Go(binding.String)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.String)//set: arg 2: expected string") + return env.NewError("Go(binding.String)//set: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -128246,24 +128252,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_StringList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.StringList)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.StringList) - if !ok { + if vc, ok := v.Value.(binding.StringList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//add-listener: arg 1: expected native of type binding.StringList") + return env.NewError("Go(binding.StringList)//add-listener: arg 1: " + "expected native of type binding.StringList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.StringList)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.StringList)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -128272,24 +128278,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.StringList)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.StringList)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.StringList)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.StringList)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -128306,31 +128312,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_StringList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.StringList)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.StringList) - if !ok { + if vc, ok := v.Value.(binding.StringList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//append: arg 1: expected native of type binding.StringList") + return env.NewError("Go(binding.StringList)//append: arg 1: " + "expected native of type binding.StringList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.StringList)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//append: arg 1: expected native") + return env.NewError("Go(binding.StringList)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//append: arg 2: expected string") + return env.NewError("Go(binding.StringList)//append: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } resErr := arg0Val.Append(arg1Val) var resErrObj env.Object @@ -128355,24 +128361,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_StringList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.StringList)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.StringList) - if !ok { + if vc, ok := v.Value.(binding.StringList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//get: arg 1: expected native of type binding.StringList") + return env.NewError("Go(binding.StringList)//get: arg 1: " + "expected native of type binding.StringList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.StringList)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//get: arg 1: expected native") + return env.NewError("Go(binding.StringList)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object @@ -128405,52 +128411,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_StringList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.StringList)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.StringList) - if !ok { + if vc, ok := v.Value.(binding.StringList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//get-item: arg 1: expected native of type binding.StringList") + return env.NewError("Go(binding.StringList)//get-item: arg 1: " + "expected native of type binding.StringList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.StringList)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//get-item: arg 1: expected native") + return env.NewError("Go(binding.StringList)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//get-item: arg 2: expected integer") + return env.NewError("Go(binding.StringList)//get-item: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -128473,31 +128462,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_StringList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.StringList)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.StringList) - if !ok { + if vc, ok := v.Value.(binding.StringList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//get-value: arg 1: expected native of type binding.StringList") + return env.NewError("Go(binding.StringList)//get-value: arg 1: " + "expected native of type binding.StringList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.StringList)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//get-value: arg 1: expected native") + return env.NewError("Go(binding.StringList)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//get-value: arg 2: expected integer") + return env.NewError("Go(binding.StringList)//get-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object @@ -128524,24 +128513,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_StringList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//length: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.StringList)//length: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.StringList) - if !ok { + if vc, ok := v.Value.(binding.StringList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//length: arg 1: expected native of type binding.StringList") + return env.NewError("Go(binding.StringList)//length: arg 1: " + "expected native of type binding.StringList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//length: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.StringList)//length: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//length: arg 1: expected native") + return env.NewError("Go(binding.StringList)//length: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Length() var res0Obj env.Object @@ -128560,31 +128549,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_StringList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.StringList)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.StringList) - if !ok { + if vc, ok := v.Value.(binding.StringList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//prepend: arg 1: expected native of type binding.StringList") + return env.NewError("Go(binding.StringList)//prepend: arg 1: " + "expected native of type binding.StringList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.StringList)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//prepend: arg 1: expected native") + return env.NewError("Go(binding.StringList)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//prepend: arg 2: expected string") + return env.NewError("Go(binding.StringList)//prepend: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } resErr := arg0Val.Prepend(arg1Val) var resErrObj env.Object @@ -128609,24 +128598,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_StringList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.StringList)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.StringList) - if !ok { + if vc, ok := v.Value.(binding.StringList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//remove-listener: arg 1: expected native of type binding.StringList") + return env.NewError("Go(binding.StringList)//remove-listener: arg 1: " + "expected native of type binding.StringList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.StringList)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.StringList)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -128635,24 +128624,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.StringList)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.StringList)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.StringList)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.StringList)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -128669,53 +128658,46 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_StringList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.StringList)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.StringList) - if !ok { + if vc, ok := v.Value.(binding.StringList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//set: arg 1: expected native of type binding.StringList") + return env.NewError("Go(binding.StringList)//set: arg 1: " + "expected native of type binding.StringList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.StringList)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//set: arg 1: expected native") + return env.NewError("Go(binding.StringList)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []string switch v := arg1.(type) { case env.Block: arg1Val = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - arg1Val[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + arg1Val[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//set: arg 2: block item: expected string") + return env.NewError("Go(binding.StringList)//set: arg 2: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//set: arg 2: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.StringList)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//set: arg 2: expected block, native or nil") + return env.NewError("Go(binding.StringList)//set: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -128740,38 +128722,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_StringList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.StringList)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.StringList) - if !ok { + if vc, ok := v.Value.(binding.StringList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//set-value: arg 1: expected native of type binding.StringList") + return env.NewError("Go(binding.StringList)//set-value: arg 1: " + "expected native of type binding.StringList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.StringList)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//set-value: arg 1: expected native") + return env.NewError("Go(binding.StringList)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//set-value: arg 2: expected integer") + return env.NewError("Go(binding.StringList)//set-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringList)//set-value: arg 3: expected string") + return env.NewError("Go(binding.StringList)//set-value: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -128796,24 +128778,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_StringTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.StringTree)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.StringTree) - if !ok { + if vc, ok := v.Value.(binding.StringTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//add-listener: arg 1: expected native of type binding.StringTree") + return env.NewError("Go(binding.StringTree)//add-listener: arg 1: " + "expected native of type binding.StringTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.StringTree)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.StringTree)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -128822,24 +128804,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.StringTree)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.StringTree)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.StringTree)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.StringTree)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -128856,45 +128838,45 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_StringTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.StringTree)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.StringTree) - if !ok { + if vc, ok := v.Value.(binding.StringTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//append: arg 1: expected native of type binding.StringTree") + return env.NewError("Go(binding.StringTree)//append: arg 1: " + "expected native of type binding.StringTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.StringTree)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//append: arg 1: expected native") + return env.NewError("Go(binding.StringTree)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//append: arg 2: expected string") + return env.NewError("Go(binding.StringTree)//append: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//append: arg 3: expected string") + return env.NewError("Go(binding.StringTree)//append: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val string - if v, ok := arg3.(env.String); ok { - arg3Val = string(v.Value) + if vc, ok := arg3.(env.String); ok { + arg3Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//append: arg 4: expected string") + return env.NewError("Go(binding.StringTree)//append: arg 4: " + "expected string, but got " + objectDebugString(ps.Idx, arg3)) } resErr := arg0Val.Append(arg1Val, arg2Val, arg3Val) var resErrObj env.Object @@ -128919,31 +128901,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_StringTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//child-i-ds: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.StringTree)//child-i-ds: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.StringTree) - if !ok { + if vc, ok := v.Value.(binding.StringTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//child-i-ds: arg 1: expected native of type binding.StringTree") + return env.NewError("Go(binding.StringTree)//child-i-ds: arg 1: " + "expected native of type binding.StringTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//child-i-ds: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.StringTree)//child-i-ds: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//child-i-ds: arg 1: expected native") + return env.NewError("Go(binding.StringTree)//child-i-ds: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//child-i-ds: arg 2: expected string") + return env.NewError("Go(binding.StringTree)//child-i-ds: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := arg0Val.ChildIDs(arg1Val) var res0Obj env.Object @@ -128968,24 +128950,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_StringTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.StringTree)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.StringTree) - if !ok { + if vc, ok := v.Value.(binding.StringTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//get: arg 1: expected native of type binding.StringTree") + return env.NewError("Go(binding.StringTree)//get: arg 1: " + "expected native of type binding.StringTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.StringTree)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//get: arg 1: expected native") + return env.NewError("Go(binding.StringTree)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, res1, resErr := arg0Val.Get() var res0Obj env.Object @@ -129039,52 +129021,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_StringTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.StringTree)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.StringTree) - if !ok { + if vc, ok := v.Value.(binding.StringTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//get-item: arg 1: expected native of type binding.StringTree") + return env.NewError("Go(binding.StringTree)//get-item: arg 1: " + "expected native of type binding.StringTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.StringTree)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//get-item: arg 1: expected native") + return env.NewError("Go(binding.StringTree)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//get-item: arg 2: expected string") + return env.NewError("Go(binding.StringTree)//get-item: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -129107,31 +129072,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_StringTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.StringTree)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.StringTree) - if !ok { + if vc, ok := v.Value.(binding.StringTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//get-value: arg 1: expected native of type binding.StringTree") + return env.NewError("Go(binding.StringTree)//get-value: arg 1: " + "expected native of type binding.StringTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.StringTree)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//get-value: arg 1: expected native") + return env.NewError("Go(binding.StringTree)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//get-value: arg 2: expected string") + return env.NewError("Go(binding.StringTree)//get-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object @@ -129158,45 +129123,45 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_StringTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.StringTree)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.StringTree) - if !ok { + if vc, ok := v.Value.(binding.StringTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//prepend: arg 1: expected native of type binding.StringTree") + return env.NewError("Go(binding.StringTree)//prepend: arg 1: " + "expected native of type binding.StringTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.StringTree)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//prepend: arg 1: expected native") + return env.NewError("Go(binding.StringTree)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//prepend: arg 2: expected string") + return env.NewError("Go(binding.StringTree)//prepend: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//prepend: arg 3: expected string") + return env.NewError("Go(binding.StringTree)//prepend: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val string - if v, ok := arg3.(env.String); ok { - arg3Val = string(v.Value) + if vc, ok := arg3.(env.String); ok { + arg3Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//prepend: arg 4: expected string") + return env.NewError("Go(binding.StringTree)//prepend: arg 4: " + "expected string, but got " + objectDebugString(ps.Idx, arg3)) } resErr := arg0Val.Prepend(arg1Val, arg2Val, arg3Val) var resErrObj env.Object @@ -129221,24 +129186,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_StringTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.StringTree)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.StringTree) - if !ok { + if vc, ok := v.Value.(binding.StringTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//remove-listener: arg 1: expected native of type binding.StringTree") + return env.NewError("Go(binding.StringTree)//remove-listener: arg 1: " + "expected native of type binding.StringTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.StringTree)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.StringTree)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -129247,24 +129212,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.StringTree)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.StringTree)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.StringTree)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.StringTree)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -129281,69 +129246,62 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_StringTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.StringTree)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.StringTree) - if !ok { + if vc, ok := v.Value.(binding.StringTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set: arg 1: expected native of type binding.StringTree") + return env.NewError("Go(binding.StringTree)//set: arg 1: " + "expected native of type binding.StringTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.StringTree)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set: arg 1: expected native") + return env.NewError("Go(binding.StringTree)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val map[string][]string switch v := arg1.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set: arg 2: expected block to have length of multiple of 2") + return env.NewError("Go(binding.StringTree)//set: arg 2: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } arg1Val = make(map[string][]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set: arg 2: map key: expected string") + return env.NewError("Go(binding.StringTree)//set: arg 2: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV []string switch v := v.Series.S[i+1].(type) { case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set: arg 2: map value: block item: expected string") + return env.NewError("Go(binding.StringTree)//set: arg 2: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set: arg 2: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set: arg 2: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.StringTree)//set: arg 2: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set: arg 2: map value: expected block, native or nil") + return env.NewError("Go(binding.StringTree)//set: arg 2: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } @@ -129356,71 +129314,57 @@ var Builtins = map[string]*env.Builtin{ case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set: arg 2: map value: block item: expected string") + return env.NewError("Go(binding.StringTree)//set: arg 2: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set: arg 2: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set: arg 2: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.StringTree)//set: arg 2: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set: arg 2: map value: expected block, native or nil") + return env.NewError("Go(binding.StringTree)//set: arg 2: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } - case env.Native: - var ok bool - arg1Val, ok = v.Value.(map[string][]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set: arg 2: expected native of type map[string][]string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.StringTree)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set: arg 2: expected native, block, dict or nil") + return env.NewError("Go(binding.StringTree)//set: arg 2: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } var arg2Val map[string]string switch v := arg2.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set: arg 3: expected block to have length of multiple of 2") + return env.NewError("Go(binding.StringTree)//set: arg 3: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } arg2Val = make(map[string]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set: arg 3: map key: expected string") + return env.NewError("Go(binding.StringTree)//set: arg 3: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV string - if v, ok := v.Series.S[i+1].(env.String); ok { - mapV = string(v.Value) + if vc, ok := v.Series.S[i+1].(env.String); ok { + mapV = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set: arg 3: map value: expected string") + return env.NewError("Go(binding.StringTree)//set: arg 3: " + "map value: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+1])) } arg2Val[mapK] = mapV } @@ -129429,30 +129373,23 @@ var Builtins = map[string]*env.Builtin{ for dictK, dictV := range v.Data { mapK := dictK var mapV string - if v, ok := dictV.(env.String); ok { - mapV = string(v.Value) + if vc, ok := dictV.(env.String); ok { + mapV = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set: arg 3: map value: expected string") + return env.NewError("Go(binding.StringTree)//set: arg 3: " + "map value: " + "expected string, but got " + objectDebugString(ps.Idx, dictV)) } arg2Val[mapK] = mapV } - case env.Native: - var ok bool - arg2Val, ok = v.Value.(map[string]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set: arg 3: expected native of type map[string]string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(binding.StringTree)//set: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set: arg 3: expected native, block, dict or nil") + return env.NewError("Go(binding.StringTree)//set: arg 3: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val, arg2Val) var resErrObj env.Object @@ -129477,38 +129414,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_StringTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.StringTree)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.StringTree) - if !ok { + if vc, ok := v.Value.(binding.StringTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set-value: arg 1: expected native of type binding.StringTree") + return env.NewError("Go(binding.StringTree)//set-value: arg 1: " + "expected native of type binding.StringTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.StringTree)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set-value: arg 1: expected native") + return env.NewError("Go(binding.StringTree)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set-value: arg 2: expected string") + return env.NewError("Go(binding.StringTree)//set-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.StringTree)//set-value: arg 3: expected string") + return env.NewError("Go(binding.StringTree)//set-value: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -129533,24 +129470,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Struct(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Struct)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Struct) - if !ok { + if vc, ok := v.Value.(binding.Struct); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//add-listener: arg 1: expected native of type binding.Struct") + return env.NewError("Go(binding.Struct)//add-listener: arg 1: " + "expected native of type binding.Struct, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Struct)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.Struct)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -129559,24 +129496,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.Struct)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.Struct)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.Struct)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.Struct)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -129593,52 +129530,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Struct(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Struct)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Struct) - if !ok { + if vc, ok := v.Value.(binding.Struct); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//get-item: arg 1: expected native of type binding.Struct") + return env.NewError("Go(binding.Struct)//get-item: arg 1: " + "expected native of type binding.Struct, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Struct)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//get-item: arg 1: expected native") + return env.NewError("Go(binding.Struct)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//get-item: arg 2: expected string") + return env.NewError("Go(binding.Struct)//get-item: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -129661,35 +129581,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Struct(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Struct)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Struct) - if !ok { + if vc, ok := v.Value.(binding.Struct); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//get-value: arg 1: expected native of type binding.Struct") + return env.NewError("Go(binding.Struct)//get-value: arg 1: " + "expected native of type binding.Struct, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Struct)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//get-value: arg 1: expected native") + return env.NewError("Go(binding.Struct)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//get-value: arg 2: expected string") + return env.NewError("Go(binding.Struct)//get-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object - res0Obj = *env.NewNative(ps.Idx, res0, "Go(any)") + res0Obj = *env.NewNative(ps.Idx, res0, "Go(interface{})") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -129712,24 +129632,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Struct(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//keys: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Struct)//keys: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Struct) - if !ok { + if vc, ok := v.Value.(binding.Struct); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//keys: arg 1: expected native of type binding.Struct") + return env.NewError("Go(binding.Struct)//keys: arg 1: " + "expected native of type binding.Struct, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//keys: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Struct)//keys: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//keys: arg 1: expected native") + return env.NewError("Go(binding.Struct)//keys: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Keys() var res0Obj env.Object @@ -129754,24 +129674,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Struct(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//reload: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Struct)//reload: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Struct) - if !ok { + if vc, ok := v.Value.(binding.Struct); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//reload: arg 1: expected native of type binding.Struct") + return env.NewError("Go(binding.Struct)//reload: arg 1: " + "expected native of type binding.Struct, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//reload: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Struct)//reload: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//reload: arg 1: expected native") + return env.NewError("Go(binding.Struct)//reload: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Reload() var resErrObj env.Object @@ -129796,24 +129716,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Struct(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Struct)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Struct) - if !ok { + if vc, ok := v.Value.(binding.Struct); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//remove-listener: arg 1: expected native of type binding.Struct") + return env.NewError("Go(binding.Struct)//remove-listener: arg 1: " + "expected native of type binding.Struct, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Struct)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.Struct)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -129822,24 +129742,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.Struct)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.Struct)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.Struct)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.Struct)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -129856,44 +129776,44 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Struct(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Struct)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Struct) - if !ok { + if vc, ok := v.Value.(binding.Struct); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//set-value: arg 1: expected native of type binding.Struct") + return env.NewError("Go(binding.Struct)//set-value: arg 1: " + "expected native of type binding.Struct, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Struct)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//set-value: arg 1: expected native") + return env.NewError("Go(binding.Struct)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//set-value: arg 2: expected string") + return env.NewError("Go(binding.Struct)//set-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } - var arg2Val any + var arg2Val interface{} switch v := arg2.(type) { case env.Native: - var ok bool - arg2Val, ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//set-value: arg 3: expected native of type any") + return env.NewError("Go(binding.Struct)//set-value: arg 3: " + "expected native of type interface{}, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.Struct)//set-value: arg 3: expected native") + return env.NewError("Go(binding.Struct)//set-value: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -129918,24 +129838,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URI)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.URI)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.URI) - if !ok { + if vc, ok := v.Value.(binding.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URI)//add-listener: arg 1: expected native of type binding.URI") + return env.NewError("Go(binding.URI)//add-listener: arg 1: " + "expected native of type binding.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URI)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.URI)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URI)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.URI)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -129944,24 +129864,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URI)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.URI)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URI)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.URI)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URI)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.URI)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URI)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.URI)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -129978,45 +129898,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URI)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.URI)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.URI) - if !ok { + if vc, ok := v.Value.(binding.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URI)//get: arg 1: expected native of type binding.URI") + return env.NewError("Go(binding.URI)//get: arg 1: " + "expected native of type binding.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URI)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.URI)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URI)//get: arg 1: expected native") + return env.NewError("Go(binding.URI)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URI)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URI)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -130039,24 +129942,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URI)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.URI)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.URI) - if !ok { + if vc, ok := v.Value.(binding.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URI)//remove-listener: arg 1: expected native of type binding.URI") + return env.NewError("Go(binding.URI)//remove-listener: arg 1: " + "expected native of type binding.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URI)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.URI)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URI)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.URI)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -130065,24 +129968,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URI)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.URI)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URI)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.URI)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URI)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.URI)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URI)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.URI)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -130099,24 +130002,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URI)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.URI)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.URI) - if !ok { + if vc, ok := v.Value.(binding.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URI)//set: arg 1: expected native of type binding.URI") + return env.NewError("Go(binding.URI)//set: arg 1: " + "expected native of type binding.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URI)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.URI)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URI)//set: arg 1: expected native") + return env.NewError("Go(binding.URI)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -130125,24 +130028,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URI)//set: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.URI)//set: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URI)//set: arg 2: expected native of type fyne.URI") + return env.NewError("Go(binding.URI)//set: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URI)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.URI)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URI)//set: arg 2: expected native") + return env.NewError("Go(binding.URI)//set: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -130167,24 +130070,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_URIList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.URIList)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.URIList) - if !ok { + if vc, ok := v.Value.(binding.URIList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//add-listener: arg 1: expected native of type binding.URIList") + return env.NewError("Go(binding.URIList)//add-listener: arg 1: " + "expected native of type binding.URIList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.URIList)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.URIList)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -130193,24 +130096,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.URIList)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.URIList)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.URIList)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.URIList)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -130227,24 +130130,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_URIList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.URIList)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.URIList) - if !ok { + if vc, ok := v.Value.(binding.URIList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//append: arg 1: expected native of type binding.URIList") + return env.NewError("Go(binding.URIList)//append: arg 1: " + "expected native of type binding.URIList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.URIList)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//append: arg 1: expected native") + return env.NewError("Go(binding.URIList)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -130253,24 +130156,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//append: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.URIList)//append: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//append: arg 2: expected native of type fyne.URI") + return env.NewError("Go(binding.URIList)//append: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//append: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.URIList)//append: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//append: arg 2: expected native") + return env.NewError("Go(binding.URIList)//append: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Append(arg1Val) var resErrObj env.Object @@ -130295,48 +130198,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_URIList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.URIList)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.URIList) - if !ok { + if vc, ok := v.Value.(binding.URIList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//get: arg 1: expected native of type binding.URIList") + return env.NewError("Go(binding.URIList)//get: arg 1: " + "expected native of type binding.URIList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.URIList)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//get: arg 1: expected native") + return env.NewError("Go(binding.URIList)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object { items := make([]env.Object, len(res0)) for i, it := range res0 { - { - typ := reflect.TypeOf(it) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - items[i] = *env.NewNative(ps.Idx, it, typRyeName) - } else { - items[i] = *env.NewNative(ps.Idx, it, "Go(fyne.URI)") - } - } + items[i] = ifaceToNative(ps.Idx, it, "Go(fyne.URI)") } res0Obj = *env.NewBlock(*env.NewTSeries(items)) } @@ -130362,52 +130248,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_URIList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.URIList)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.URIList) - if !ok { + if vc, ok := v.Value.(binding.URIList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//get-item: arg 1: expected native of type binding.URIList") + return env.NewError("Go(binding.URIList)//get-item: arg 1: " + "expected native of type binding.URIList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.URIList)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//get-item: arg 1: expected native") + return env.NewError("Go(binding.URIList)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//get-item: arg 2: expected integer") + return env.NewError("Go(binding.URIList)//get-item: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -130430,52 +130299,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_URIList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.URIList)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.URIList) - if !ok { + if vc, ok := v.Value.(binding.URIList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//get-value: arg 1: expected native of type binding.URIList") + return env.NewError("Go(binding.URIList)//get-value: arg 1: " + "expected native of type binding.URIList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.URIList)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//get-value: arg 1: expected native") + return env.NewError("Go(binding.URIList)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//get-value: arg 2: expected integer") + return env.NewError("Go(binding.URIList)//get-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URI)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URI)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -130498,24 +130350,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_URIList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//length: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.URIList)//length: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.URIList) - if !ok { + if vc, ok := v.Value.(binding.URIList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//length: arg 1: expected native of type binding.URIList") + return env.NewError("Go(binding.URIList)//length: arg 1: " + "expected native of type binding.URIList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//length: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.URIList)//length: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//length: arg 1: expected native") + return env.NewError("Go(binding.URIList)//length: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Length() var res0Obj env.Object @@ -130534,24 +130386,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_URIList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.URIList)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.URIList) - if !ok { + if vc, ok := v.Value.(binding.URIList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//prepend: arg 1: expected native of type binding.URIList") + return env.NewError("Go(binding.URIList)//prepend: arg 1: " + "expected native of type binding.URIList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.URIList)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//prepend: arg 1: expected native") + return env.NewError("Go(binding.URIList)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -130560,24 +130412,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//prepend: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.URIList)//prepend: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//prepend: arg 2: expected native of type fyne.URI") + return env.NewError("Go(binding.URIList)//prepend: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//prepend: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.URIList)//prepend: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//prepend: arg 2: expected native") + return env.NewError("Go(binding.URIList)//prepend: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Prepend(arg1Val) var resErrObj env.Object @@ -130602,24 +130454,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_URIList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.URIList)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.URIList) - if !ok { + if vc, ok := v.Value.(binding.URIList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//remove-listener: arg 1: expected native of type binding.URIList") + return env.NewError("Go(binding.URIList)//remove-listener: arg 1: " + "expected native of type binding.URIList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.URIList)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.URIList)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -130628,24 +130480,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.URIList)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.URIList)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.URIList)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.URIList)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -130662,24 +130514,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_URIList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.URIList)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.URIList) - if !ok { + if vc, ok := v.Value.(binding.URIList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//set: arg 1: expected native of type binding.URIList") + return env.NewError("Go(binding.URIList)//set: arg 1: " + "expected native of type binding.URIList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.URIList)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//set: arg 1: expected native") + return env.NewError("Go(binding.URIList)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []fyne.URI switch v := arg1.(type) { @@ -130692,42 +130544,35 @@ var Builtins = map[string]*env.Builtin{ arg1Val[i], err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//set: arg 2: block item: " + err.Error() + "") + return env.NewError("Go(binding.URIList)//set: arg 2: " + "block item: " + err.Error()) } case env.Native: - var ok bool - arg1Val[i], ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//set: arg 2: block item: expected native of type fyne.URI") + return env.NewError("Go(binding.URIList)//set: arg 2: " + "block item: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//set: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("Go(binding.URIList)//set: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val[i] = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//set: arg 2: block item: expected native") + return env.NewError("Go(binding.URIList)//set: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]fyne.URI) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//set: arg 2: expected native of type []fyne.URI") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.URIList)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//set: arg 2: expected block, native or nil") + return env.NewError("Go(binding.URIList)//set: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -130752,31 +130597,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_URIList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.URIList)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.URIList) - if !ok { + if vc, ok := v.Value.(binding.URIList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//set-value: arg 1: expected native of type binding.URIList") + return env.NewError("Go(binding.URIList)//set-value: arg 1: " + "expected native of type binding.URIList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.URIList)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//set-value: arg 1: expected native") + return env.NewError("Go(binding.URIList)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//set-value: arg 2: expected integer") + return env.NewError("Go(binding.URIList)//set-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val fyne.URI switch v := arg2.(type) { @@ -130785,24 +130630,24 @@ var Builtins = map[string]*env.Builtin{ arg2Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//set-value: arg 3: " + err.Error() + "") + return env.NewError("Go(binding.URIList)//set-value: arg 3: " + err.Error()) } case env.Native: - var ok bool - arg2Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//set-value: arg 3: expected native of type fyne.URI") + return env.NewError("Go(binding.URIList)//set-value: arg 3: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//set-value: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(binding.URIList)//set-value: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URIList)//set-value: arg 3: expected native") + return env.NewError("Go(binding.URIList)//set-value: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -130827,24 +130672,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_URITree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.URITree)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.URITree) - if !ok { + if vc, ok := v.Value.(binding.URITree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//add-listener: arg 1: expected native of type binding.URITree") + return env.NewError("Go(binding.URITree)//add-listener: arg 1: " + "expected native of type binding.URITree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.URITree)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.URITree)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -130853,24 +130698,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.URITree)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.URITree)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.URITree)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.URITree)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -130887,38 +130732,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_URITree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.URITree)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.URITree) - if !ok { + if vc, ok := v.Value.(binding.URITree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//append: arg 1: expected native of type binding.URITree") + return env.NewError("Go(binding.URITree)//append: arg 1: " + "expected native of type binding.URITree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.URITree)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//append: arg 1: expected native") + return env.NewError("Go(binding.URITree)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//append: arg 2: expected string") + return env.NewError("Go(binding.URITree)//append: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//append: arg 3: expected string") + return env.NewError("Go(binding.URITree)//append: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val fyne.URI switch v := arg3.(type) { @@ -130927,24 +130772,24 @@ var Builtins = map[string]*env.Builtin{ arg3Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//append: arg 4: " + err.Error() + "") + return env.NewError("Go(binding.URITree)//append: arg 4: " + err.Error()) } case env.Native: - var ok bool - arg3Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg3Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//append: arg 4: expected native of type fyne.URI") + return env.NewError("Go(binding.URITree)//append: arg 4: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//append: arg 4: expected integer to be 0 or nil") + return env.NewError("Go(binding.URITree)//append: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//append: arg 4: expected native") + return env.NewError("Go(binding.URITree)//append: arg 4: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Append(arg1Val, arg2Val, arg3Val) var resErrObj env.Object @@ -130969,31 +130814,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_URITree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//child-i-ds: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.URITree)//child-i-ds: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.URITree) - if !ok { + if vc, ok := v.Value.(binding.URITree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//child-i-ds: arg 1: expected native of type binding.URITree") + return env.NewError("Go(binding.URITree)//child-i-ds: arg 1: " + "expected native of type binding.URITree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//child-i-ds: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.URITree)//child-i-ds: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//child-i-ds: arg 1: expected native") + return env.NewError("Go(binding.URITree)//child-i-ds: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//child-i-ds: arg 2: expected string") + return env.NewError("Go(binding.URITree)//child-i-ds: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := arg0Val.ChildIDs(arg1Val) var res0Obj env.Object @@ -131018,24 +130863,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_URITree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.URITree)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.URITree) - if !ok { + if vc, ok := v.Value.(binding.URITree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//get: arg 1: expected native of type binding.URITree") + return env.NewError("Go(binding.URITree)//get: arg 1: " + "expected native of type binding.URITree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.URITree)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//get: arg 1: expected native") + return env.NewError("Go(binding.URITree)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, res1, resErr := arg0Val.Get() var res0Obj env.Object @@ -131059,24 +130904,7 @@ var Builtins = map[string]*env.Builtin{ data := make(map[string]any, len(res1)) for mKey, mVal := range res1 { var dVal env.Object - { - typ := reflect.TypeOf(mVal) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - dVal = *env.NewNative(ps.Idx, mVal, typRyeName) - } else { - dVal = *env.NewNative(ps.Idx, mVal, "Go(fyne.URI)") - } - } + dVal = ifaceToNative(ps.Idx, mVal, "Go(fyne.URI)") data[mKey] = dVal } res1Obj = *env.NewDict(data) @@ -131106,52 +130934,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_URITree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.URITree)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.URITree) - if !ok { + if vc, ok := v.Value.(binding.URITree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//get-item: arg 1: expected native of type binding.URITree") + return env.NewError("Go(binding.URITree)//get-item: arg 1: " + "expected native of type binding.URITree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.URITree)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//get-item: arg 1: expected native") + return env.NewError("Go(binding.URITree)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//get-item: arg 2: expected string") + return env.NewError("Go(binding.URITree)//get-item: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -131174,52 +130985,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_URITree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.URITree)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.URITree) - if !ok { + if vc, ok := v.Value.(binding.URITree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//get-value: arg 1: expected native of type binding.URITree") + return env.NewError("Go(binding.URITree)//get-value: arg 1: " + "expected native of type binding.URITree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.URITree)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//get-value: arg 1: expected native") + return env.NewError("Go(binding.URITree)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//get-value: arg 2: expected string") + return env.NewError("Go(binding.URITree)//get-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URI)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URI)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -131242,38 +131036,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_URITree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.URITree)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.URITree) - if !ok { + if vc, ok := v.Value.(binding.URITree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//prepend: arg 1: expected native of type binding.URITree") + return env.NewError("Go(binding.URITree)//prepend: arg 1: " + "expected native of type binding.URITree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.URITree)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//prepend: arg 1: expected native") + return env.NewError("Go(binding.URITree)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//prepend: arg 2: expected string") + return env.NewError("Go(binding.URITree)//prepend: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//prepend: arg 3: expected string") + return env.NewError("Go(binding.URITree)//prepend: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val fyne.URI switch v := arg3.(type) { @@ -131282,24 +131076,24 @@ var Builtins = map[string]*env.Builtin{ arg3Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//prepend: arg 4: " + err.Error() + "") + return env.NewError("Go(binding.URITree)//prepend: arg 4: " + err.Error()) } case env.Native: - var ok bool - arg3Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg3Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//prepend: arg 4: expected native of type fyne.URI") + return env.NewError("Go(binding.URITree)//prepend: arg 4: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//prepend: arg 4: expected integer to be 0 or nil") + return env.NewError("Go(binding.URITree)//prepend: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//prepend: arg 4: expected native") + return env.NewError("Go(binding.URITree)//prepend: arg 4: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Prepend(arg1Val, arg2Val, arg3Val) var resErrObj env.Object @@ -131324,24 +131118,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_URITree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.URITree)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.URITree) - if !ok { + if vc, ok := v.Value.(binding.URITree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//remove-listener: arg 1: expected native of type binding.URITree") + return env.NewError("Go(binding.URITree)//remove-listener: arg 1: " + "expected native of type binding.URITree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.URITree)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.URITree)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -131350,24 +131144,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.URITree)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.URITree)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.URITree)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.URITree)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -131384,69 +131178,62 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_URITree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.URITree)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.URITree) - if !ok { + if vc, ok := v.Value.(binding.URITree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 1: expected native of type binding.URITree") + return env.NewError("Go(binding.URITree)//set: arg 1: " + "expected native of type binding.URITree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.URITree)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 1: expected native") + return env.NewError("Go(binding.URITree)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val map[string][]string switch v := arg1.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 2: expected block to have length of multiple of 2") + return env.NewError("Go(binding.URITree)//set: arg 2: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } arg1Val = make(map[string][]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 2: map key: expected string") + return env.NewError("Go(binding.URITree)//set: arg 2: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV []string switch v := v.Series.S[i+1].(type) { case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 2: map value: block item: expected string") + return env.NewError("Go(binding.URITree)//set: arg 2: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 2: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 2: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.URITree)//set: arg 2: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 2: map value: expected block, native or nil") + return env.NewError("Go(binding.URITree)//set: arg 2: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } @@ -131459,64 +131246,50 @@ var Builtins = map[string]*env.Builtin{ case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 2: map value: block item: expected string") + return env.NewError("Go(binding.URITree)//set: arg 2: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 2: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 2: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.URITree)//set: arg 2: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 2: map value: expected block, native or nil") + return env.NewError("Go(binding.URITree)//set: arg 2: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } - case env.Native: - var ok bool - arg1Val, ok = v.Value.(map[string][]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 2: expected native of type map[string][]string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.URITree)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 2: expected native, block, dict or nil") + return env.NewError("Go(binding.URITree)//set: arg 2: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } var arg2Val map[string]fyne.URI switch v := arg2.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 3: expected block to have length of multiple of 2") + return env.NewError("Go(binding.URITree)//set: arg 3: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } arg2Val = make(map[string]fyne.URI, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 3: map key: expected string") + return env.NewError("Go(binding.URITree)//set: arg 3: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV fyne.URI switch v := v.Series.S[i+1].(type) { @@ -131525,24 +131298,24 @@ var Builtins = map[string]*env.Builtin{ mapV, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 3: map value: " + err.Error() + "") + return env.NewError("Go(binding.URITree)//set: arg 3: " + "map value: " + err.Error()) } case env.Native: - var ok bool - mapV, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + mapV = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 3: map value: expected native of type fyne.URI") + return env.NewError("Go(binding.URITree)//set: arg 3: " + "map value: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 3: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.URITree)//set: arg 3: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 3: map value: expected native") + return env.NewError("Go(binding.URITree)//set: arg 3: " + "map value: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg2Val[mapK] = mapV } @@ -131557,43 +131330,36 @@ var Builtins = map[string]*env.Builtin{ mapV, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 3: map value: " + err.Error() + "") + return env.NewError("Go(binding.URITree)//set: arg 3: " + "map value: " + err.Error()) } case env.Native: - var ok bool - mapV, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + mapV = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 3: map value: expected native of type fyne.URI") + return env.NewError("Go(binding.URITree)//set: arg 3: " + "map value: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 3: map value: expected integer to be 0 or nil") + return env.NewError("Go(binding.URITree)//set: arg 3: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 3: map value: expected native") + return env.NewError("Go(binding.URITree)//set: arg 3: " + "map value: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg2Val[mapK] = mapV } - case env.Native: - var ok bool - arg2Val, ok = v.Value.(map[string]fyne.URI) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 3: expected native of type map[string]fyne.URI") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(binding.URITree)//set: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set: arg 3: expected native, block, dict or nil") + return env.NewError("Go(binding.URITree)//set: arg 3: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val, arg2Val) var resErrObj env.Object @@ -131618,31 +131384,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_URITree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.URITree)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.URITree) - if !ok { + if vc, ok := v.Value.(binding.URITree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set-value: arg 1: expected native of type binding.URITree") + return env.NewError("Go(binding.URITree)//set-value: arg 1: " + "expected native of type binding.URITree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.URITree)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set-value: arg 1: expected native") + return env.NewError("Go(binding.URITree)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set-value: arg 2: expected string") + return env.NewError("Go(binding.URITree)//set-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val fyne.URI switch v := arg2.(type) { @@ -131651,24 +131417,24 @@ var Builtins = map[string]*env.Builtin{ arg2Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set-value: arg 3: " + err.Error() + "") + return env.NewError("Go(binding.URITree)//set-value: arg 3: " + err.Error()) } case env.Native: - var ok bool - arg2Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set-value: arg 3: expected native of type fyne.URI") + return env.NewError("Go(binding.URITree)//set-value: arg 3: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set-value: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(binding.URITree)//set-value: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.URITree)//set-value: arg 3: expected native") + return env.NewError("Go(binding.URITree)//set-value: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -131693,24 +131459,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Untyped(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Untyped)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Untyped)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Untyped) - if !ok { + if vc, ok := v.Value.(binding.Untyped); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Untyped)//add-listener: arg 1: expected native of type binding.Untyped") + return env.NewError("Go(binding.Untyped)//add-listener: arg 1: " + "expected native of type binding.Untyped, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Untyped)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Untyped)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Untyped)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.Untyped)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -131719,24 +131485,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Untyped)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.Untyped)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Untyped)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.Untyped)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Untyped)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.Untyped)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Untyped)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.Untyped)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -131753,28 +131519,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Untyped(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Untyped)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Untyped)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Untyped) - if !ok { + if vc, ok := v.Value.(binding.Untyped); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Untyped)//get: arg 1: expected native of type binding.Untyped") + return env.NewError("Go(binding.Untyped)//get: arg 1: " + "expected native of type binding.Untyped, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Untyped)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Untyped)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Untyped)//get: arg 1: expected native") + return env.NewError("Go(binding.Untyped)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object - res0Obj = *env.NewNative(ps.Idx, res0, "Go(any)") + res0Obj = *env.NewNative(ps.Idx, res0, "Go(interface{})") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -131797,24 +131563,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Untyped(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Untyped)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Untyped)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Untyped) - if !ok { + if vc, ok := v.Value.(binding.Untyped); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Untyped)//remove-listener: arg 1: expected native of type binding.Untyped") + return env.NewError("Go(binding.Untyped)//remove-listener: arg 1: " + "expected native of type binding.Untyped, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Untyped)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Untyped)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Untyped)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.Untyped)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -131823,24 +131589,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Untyped)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.Untyped)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Untyped)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.Untyped)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Untyped)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.Untyped)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Untyped)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.Untyped)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -131857,37 +131623,37 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Untyped(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.Untyped)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.Untyped)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Untyped) - if !ok { + if vc, ok := v.Value.(binding.Untyped); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Untyped)//set: arg 1: expected native of type binding.Untyped") + return env.NewError("Go(binding.Untyped)//set: arg 1: " + "expected native of type binding.Untyped, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.Untyped)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.Untyped)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.Untyped)//set: arg 1: expected native") + return env.NewError("Go(binding.Untyped)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val any + var arg1Val interface{} switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.Untyped)//set: arg 2: expected native of type any") + return env.NewError("Go(binding.Untyped)//set: arg 2: " + "expected native of type interface{}, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.Untyped)//set: arg 2: expected native") + return env.NewError("Go(binding.Untyped)//set: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -131912,24 +131678,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_UntypedList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.UntypedList)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.UntypedList) - if !ok { + if vc, ok := v.Value.(binding.UntypedList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//add-listener: arg 1: expected native of type binding.UntypedList") + return env.NewError("Go(binding.UntypedList)//add-listener: arg 1: " + "expected native of type binding.UntypedList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.UntypedList)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.UntypedList)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -131938,24 +131704,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.UntypedList)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.UntypedList)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.UntypedList)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.UntypedList)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -131972,37 +131738,37 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_UntypedList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//append: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.UntypedList)//append: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.UntypedList) - if !ok { + if vc, ok := v.Value.(binding.UntypedList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//append: arg 1: expected native of type binding.UntypedList") + return env.NewError("Go(binding.UntypedList)//append: arg 1: " + "expected native of type binding.UntypedList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//append: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.UntypedList)//append: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//append: arg 1: expected native") + return env.NewError("Go(binding.UntypedList)//append: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val any + var arg1Val interface{} switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//append: arg 2: expected native of type any") + return env.NewError("Go(binding.UntypedList)//append: arg 2: " + "expected native of type interface{}, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//append: arg 2: expected native") + return env.NewError("Go(binding.UntypedList)//append: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Append(arg1Val) var resErrObj env.Object @@ -132027,31 +131793,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_UntypedList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.UntypedList)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.UntypedList) - if !ok { + if vc, ok := v.Value.(binding.UntypedList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//get: arg 1: expected native of type binding.UntypedList") + return env.NewError("Go(binding.UntypedList)//get: arg 1: " + "expected native of type binding.UntypedList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.UntypedList)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//get: arg 1: expected native") + return env.NewError("Go(binding.UntypedList)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object { items := make([]env.Object, len(res0)) for i, it := range res0 { - items[i] = *env.NewNative(ps.Idx, it, "Go(any)") + items[i] = *env.NewNative(ps.Idx, it, "Go(interface{})") } res0Obj = *env.NewBlock(*env.NewTSeries(items)) } @@ -132077,52 +131843,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_UntypedList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.UntypedList)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.UntypedList) - if !ok { + if vc, ok := v.Value.(binding.UntypedList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//get-item: arg 1: expected native of type binding.UntypedList") + return env.NewError("Go(binding.UntypedList)//get-item: arg 1: " + "expected native of type binding.UntypedList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.UntypedList)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//get-item: arg 1: expected native") + return env.NewError("Go(binding.UntypedList)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//get-item: arg 2: expected integer") + return env.NewError("Go(binding.UntypedList)//get-item: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -132145,35 +131894,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_UntypedList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.UntypedList)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.UntypedList) - if !ok { + if vc, ok := v.Value.(binding.UntypedList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//get-value: arg 1: expected native of type binding.UntypedList") + return env.NewError("Go(binding.UntypedList)//get-value: arg 1: " + "expected native of type binding.UntypedList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.UntypedList)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//get-value: arg 1: expected native") + return env.NewError("Go(binding.UntypedList)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//get-value: arg 2: expected integer") + return env.NewError("Go(binding.UntypedList)//get-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object - res0Obj = *env.NewNative(ps.Idx, res0, "Go(any)") + res0Obj = *env.NewNative(ps.Idx, res0, "Go(interface{})") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -132196,24 +131945,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_UntypedList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//length: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.UntypedList)//length: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.UntypedList) - if !ok { + if vc, ok := v.Value.(binding.UntypedList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//length: arg 1: expected native of type binding.UntypedList") + return env.NewError("Go(binding.UntypedList)//length: arg 1: " + "expected native of type binding.UntypedList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//length: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.UntypedList)//length: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//length: arg 1: expected native") + return env.NewError("Go(binding.UntypedList)//length: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Length() var res0Obj env.Object @@ -132232,37 +131981,37 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_UntypedList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//prepend: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.UntypedList)//prepend: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.UntypedList) - if !ok { + if vc, ok := v.Value.(binding.UntypedList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//prepend: arg 1: expected native of type binding.UntypedList") + return env.NewError("Go(binding.UntypedList)//prepend: arg 1: " + "expected native of type binding.UntypedList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//prepend: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.UntypedList)//prepend: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//prepend: arg 1: expected native") + return env.NewError("Go(binding.UntypedList)//prepend: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val any + var arg1Val interface{} switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//prepend: arg 2: expected native of type any") + return env.NewError("Go(binding.UntypedList)//prepend: arg 2: " + "expected native of type interface{}, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//prepend: arg 2: expected native") + return env.NewError("Go(binding.UntypedList)//prepend: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Prepend(arg1Val) var resErrObj env.Object @@ -132287,24 +132036,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_UntypedList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.UntypedList)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.UntypedList) - if !ok { + if vc, ok := v.Value.(binding.UntypedList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//remove-listener: arg 1: expected native of type binding.UntypedList") + return env.NewError("Go(binding.UntypedList)//remove-listener: arg 1: " + "expected native of type binding.UntypedList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.UntypedList)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.UntypedList)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -132313,24 +132062,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.UntypedList)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.UntypedList)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.UntypedList)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.UntypedList)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -132347,59 +132096,52 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_UntypedList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.UntypedList)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.UntypedList) - if !ok { + if vc, ok := v.Value.(binding.UntypedList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//set: arg 1: expected native of type binding.UntypedList") + return env.NewError("Go(binding.UntypedList)//set: arg 1: " + "expected native of type binding.UntypedList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.UntypedList)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//set: arg 1: expected native") + return env.NewError("Go(binding.UntypedList)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val []any + var arg1Val []interface{} switch v := arg1.(type) { case env.Block: - arg1Val = make([]any, len(v.Series.S)) + arg1Val = make([]interface{}, len(v.Series.S)) for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg1Val[i], ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + arg1Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//set: arg 2: block item: expected native of type any") + return env.NewError("Go(binding.UntypedList)//set: arg 2: " + "block item: " + "expected native of type interface{}, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//set: arg 2: block item: expected native") + return env.NewError("Go(binding.UntypedList)//set: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]any) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//set: arg 2: expected native of type []any") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.UntypedList)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//set: arg 2: expected block, native or nil") + return env.NewError("Go(binding.UntypedList)//set: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -132424,44 +132166,44 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_UntypedList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.UntypedList)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.UntypedList) - if !ok { + if vc, ok := v.Value.(binding.UntypedList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//set-value: arg 1: expected native of type binding.UntypedList") + return env.NewError("Go(binding.UntypedList)//set-value: arg 1: " + "expected native of type binding.UntypedList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.UntypedList)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//set-value: arg 1: expected native") + return env.NewError("Go(binding.UntypedList)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val int - if v, ok := arg1.(env.Integer); ok { - arg1Val = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + arg1Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//set-value: arg 2: expected integer") + return env.NewError("Go(binding.UntypedList)//set-value: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } - var arg2Val any + var arg2Val interface{} switch v := arg2.(type) { case env.Native: - var ok bool - arg2Val, ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//set-value: arg 3: expected native of type any") + return env.NewError("Go(binding.UntypedList)//set-value: arg 3: " + "expected native of type interface{}, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedList)//set-value: arg 3: expected native") + return env.NewError("Go(binding.UntypedList)//set-value: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -132486,24 +132228,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_UntypedMap(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//add-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.UntypedMap)//add-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.UntypedMap) - if !ok { + if vc, ok := v.Value.(binding.UntypedMap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//add-listener: arg 1: expected native of type binding.UntypedMap") + return env.NewError("Go(binding.UntypedMap)//add-listener: arg 1: " + "expected native of type binding.UntypedMap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//add-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.UntypedMap)//add-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//add-listener: arg 1: expected native") + return env.NewError("Go(binding.UntypedMap)//add-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -132512,24 +132254,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//add-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.UntypedMap)//add-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//add-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.UntypedMap)//add-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//add-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.UntypedMap)//add-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//add-listener: arg 2: expected native") + return env.NewError("Go(binding.UntypedMap)//add-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddListener(arg1Val) return arg0 @@ -132546,31 +132288,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_UntypedMap(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//delete: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.UntypedMap)//delete: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.UntypedMap) - if !ok { + if vc, ok := v.Value.(binding.UntypedMap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//delete: arg 1: expected native of type binding.UntypedMap") + return env.NewError("Go(binding.UntypedMap)//delete: arg 1: " + "expected native of type binding.UntypedMap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//delete: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.UntypedMap)//delete: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//delete: arg 1: expected native") + return env.NewError("Go(binding.UntypedMap)//delete: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//delete: arg 2: expected string") + return env.NewError("Go(binding.UntypedMap)//delete: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.Delete(arg1Val) return arg0 @@ -132587,24 +132329,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_UntypedMap(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//get: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.UntypedMap)//get: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.UntypedMap) - if !ok { + if vc, ok := v.Value.(binding.UntypedMap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//get: arg 1: expected native of type binding.UntypedMap") + return env.NewError("Go(binding.UntypedMap)//get: arg 1: " + "expected native of type binding.UntypedMap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//get: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.UntypedMap)//get: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//get: arg 1: expected native") + return env.NewError("Go(binding.UntypedMap)//get: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Get() var res0Obj env.Object @@ -132612,7 +132354,7 @@ var Builtins = map[string]*env.Builtin{ data := make(map[string]any, len(res0)) for mKey, mVal := range res0 { var dVal env.Object - dVal = *env.NewNative(ps.Idx, mVal, "Go(any)") + dVal = *env.NewNative(ps.Idx, mVal, "Go(interface{})") data[mKey] = dVal } res0Obj = *env.NewDict(data) @@ -132639,52 +132381,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_UntypedMap(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//get-item: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.UntypedMap)//get-item: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.UntypedMap) - if !ok { + if vc, ok := v.Value.(binding.UntypedMap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//get-item: arg 1: expected native of type binding.UntypedMap") + return env.NewError("Go(binding.UntypedMap)//get-item: arg 1: " + "expected native of type binding.UntypedMap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//get-item: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.UntypedMap)//get-item: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//get-item: arg 1: expected native") + return env.NewError("Go(binding.UntypedMap)//get-item: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//get-item: arg 2: expected string") + return env.NewError("Go(binding.UntypedMap)//get-item: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetItem(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataItem)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataItem)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -132707,35 +132432,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_UntypedMap(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//get-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.UntypedMap)//get-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.UntypedMap) - if !ok { + if vc, ok := v.Value.(binding.UntypedMap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//get-value: arg 1: expected native of type binding.UntypedMap") + return env.NewError("Go(binding.UntypedMap)//get-value: arg 1: " + "expected native of type binding.UntypedMap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//get-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.UntypedMap)//get-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//get-value: arg 1: expected native") + return env.NewError("Go(binding.UntypedMap)//get-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//get-value: arg 2: expected string") + return env.NewError("Go(binding.UntypedMap)//get-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.GetValue(arg1Val) var res0Obj env.Object - res0Obj = *env.NewNative(ps.Idx, res0, "Go(any)") + res0Obj = *env.NewNative(ps.Idx, res0, "Go(interface{})") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -132758,24 +132483,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_UntypedMap(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//keys: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.UntypedMap)//keys: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.UntypedMap) - if !ok { + if vc, ok := v.Value.(binding.UntypedMap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//keys: arg 1: expected native of type binding.UntypedMap") + return env.NewError("Go(binding.UntypedMap)//keys: arg 1: " + "expected native of type binding.UntypedMap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//keys: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.UntypedMap)//keys: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//keys: arg 1: expected native") + return env.NewError("Go(binding.UntypedMap)//keys: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Keys() var res0Obj env.Object @@ -132800,24 +132525,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_UntypedMap(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//remove-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.UntypedMap)//remove-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.UntypedMap) - if !ok { + if vc, ok := v.Value.(binding.UntypedMap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//remove-listener: arg 1: expected native of type binding.UntypedMap") + return env.NewError("Go(binding.UntypedMap)//remove-listener: arg 1: " + "expected native of type binding.UntypedMap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//remove-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.UntypedMap)//remove-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//remove-listener: arg 1: expected native") + return env.NewError("Go(binding.UntypedMap)//remove-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val binding.DataListener switch v := arg1.(type) { @@ -132826,24 +132551,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_DataListener(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//remove-listener: arg 2: " + err.Error() + "") + return env.NewError("Go(binding.UntypedMap)//remove-listener: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.DataListener) - if !ok { + if vc, ok := v.Value.(binding.DataListener); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//remove-listener: arg 2: expected native of type binding.DataListener") + return env.NewError("Go(binding.UntypedMap)//remove-listener: arg 2: " + "expected native of type binding.DataListener, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//remove-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.UntypedMap)//remove-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//remove-listener: arg 2: expected native") + return env.NewError("Go(binding.UntypedMap)//remove-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveListener(arg1Val) return arg0 @@ -132860,91 +132585,84 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_UntypedMap(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//set: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.UntypedMap)//set: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.UntypedMap) - if !ok { + if vc, ok := v.Value.(binding.UntypedMap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//set: arg 1: expected native of type binding.UntypedMap") + return env.NewError("Go(binding.UntypedMap)//set: arg 1: " + "expected native of type binding.UntypedMap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//set: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.UntypedMap)//set: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//set: arg 1: expected native") + return env.NewError("Go(binding.UntypedMap)//set: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val map[string]any + var arg1Val map[string]interface{} switch v := arg1.(type) { case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//set: arg 2: expected block to have length of multiple of 2") + return env.NewError("Go(binding.UntypedMap)//set: arg 2: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } - arg1Val = make(map[string]any, len(v.Series.S)/2) + arg1Val = make(map[string]interface{}, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//set: arg 2: map key: expected string") + return env.NewError("Go(binding.UntypedMap)//set: arg 2: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } - var mapV any + var mapV interface{} switch v := v.Series.S[i+1].(type) { case env.Native: - var ok bool - mapV, ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + mapV = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//set: arg 2: map value: expected native of type any") + return env.NewError("Go(binding.UntypedMap)//set: arg 2: " + "map value: " + "expected native of type interface{}, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//set: arg 2: map value: expected native") + return env.NewError("Go(binding.UntypedMap)//set: arg 2: " + "map value: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } case env.Dict: - arg1Val = make(map[string]any, len(v.Data)) + arg1Val = make(map[string]interface{}, len(v.Data)) for dictK, dictV := range v.Data { mapK := dictK - var mapV any + var mapV interface{} switch v := dictV.(type) { case env.Native: - var ok bool - mapV, ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + mapV = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//set: arg 2: map value: expected native of type any") + return env.NewError("Go(binding.UntypedMap)//set: arg 2: " + "map value: " + "expected native of type interface{}, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//set: arg 2: map value: expected native") + return env.NewError("Go(binding.UntypedMap)//set: arg 2: " + "map value: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg1Val[mapK] = mapV } - case env.Native: - var ok bool - arg1Val, ok = v.Value.(map[string]any) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//set: arg 2: expected native of type map[string]any") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//set: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(binding.UntypedMap)//set: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//set: arg 2: expected native, block, dict or nil") + return env.NewError("Go(binding.UntypedMap)//set: arg 2: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Set(arg1Val) var resErrObj env.Object @@ -132969,44 +132687,44 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_UntypedMap(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//set-value: arg 1: " + err.Error() + "") + return env.NewError("Go(binding.UntypedMap)//set-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.UntypedMap) - if !ok { + if vc, ok := v.Value.(binding.UntypedMap); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//set-value: arg 1: expected native of type binding.UntypedMap") + return env.NewError("Go(binding.UntypedMap)//set-value: arg 1: " + "expected native of type binding.UntypedMap, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//set-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(binding.UntypedMap)//set-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//set-value: arg 1: expected native") + return env.NewError("Go(binding.UntypedMap)//set-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//set-value: arg 2: expected string") + return env.NewError("Go(binding.UntypedMap)//set-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } - var arg2Val any + var arg2Val interface{} switch v := arg2.(type) { case env.Native: - var ok bool - arg2Val, ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//set-value: arg 3: expected native of type any") + return env.NewError("Go(binding.UntypedMap)//set-value: arg 3: " + "expected native of type interface{}, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(binding.UntypedMap)//set-value: arg 3: expected native") + return env.NewError("Go(binding.UntypedMap)//set-value: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.SetValue(arg1Val, arg2Val) var resErrObj env.Object @@ -133031,24 +132749,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_desktop_App(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(desktop.App)//set-system-tray-icon: arg 1: " + err.Error() + "") + return env.NewError("Go(desktop.App)//set-system-tray-icon: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(desktop.App) - if !ok { + if vc, ok := v.Value.(desktop.App); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.App)//set-system-tray-icon: arg 1: expected native of type desktop.App") + return env.NewError("Go(desktop.App)//set-system-tray-icon: arg 1: " + "expected native of type desktop.App, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.App)//set-system-tray-icon: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(desktop.App)//set-system-tray-icon: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.App)//set-system-tray-icon: arg 1: expected native") + return env.NewError("Go(desktop.App)//set-system-tray-icon: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Resource switch v := arg1.(type) { @@ -133057,24 +132775,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Resource(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(desktop.App)//set-system-tray-icon: arg 2: " + err.Error() + "") + return env.NewError("Go(desktop.App)//set-system-tray-icon: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.App)//set-system-tray-icon: arg 2: expected native of type fyne.Resource") + return env.NewError("Go(desktop.App)//set-system-tray-icon: arg 2: " + "expected native of type fyne.Resource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.App)//set-system-tray-icon: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(desktop.App)//set-system-tray-icon: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.App)//set-system-tray-icon: arg 2: expected native") + return env.NewError("Go(desktop.App)//set-system-tray-icon: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetSystemTrayIcon(arg1Val) return arg0 @@ -133091,43 +132809,43 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_desktop_App(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(desktop.App)//set-system-tray-menu: arg 1: " + err.Error() + "") + return env.NewError("Go(desktop.App)//set-system-tray-menu: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(desktop.App) - if !ok { + if vc, ok := v.Value.(desktop.App); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.App)//set-system-tray-menu: arg 1: expected native of type desktop.App") + return env.NewError("Go(desktop.App)//set-system-tray-menu: arg 1: " + "expected native of type desktop.App, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.App)//set-system-tray-menu: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(desktop.App)//set-system-tray-menu: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.App)//set-system-tray-menu: arg 1: expected native") + return env.NewError("Go(desktop.App)//set-system-tray-menu: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.Menu switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Menu) - if !ok { + if vc, ok := v.Value.(*fyne.Menu); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.App)//set-system-tray-menu: arg 2: expected native of type *fyne.Menu") + return env.NewError("Go(desktop.App)//set-system-tray-menu: arg 2: " + "expected native of type *fyne.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.App)//set-system-tray-menu: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(desktop.App)//set-system-tray-menu: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.App)//set-system-tray-menu: arg 2: expected native") + return env.NewError("Go(desktop.App)//set-system-tray-menu: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetSystemTrayMenu(arg1Val) return arg0 @@ -133144,28 +132862,50 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_desktop_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(desktop.Canvas)//on-key-down: arg 1: " + err.Error() + "") + return env.NewError("Go(desktop.Canvas)//on-key-down: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(desktop.Canvas) - if !ok { + if vc, ok := v.Value.(desktop.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.Canvas)//on-key-down: arg 1: expected native of type desktop.Canvas") + return env.NewError("Go(desktop.Canvas)//on-key-down: arg 1: " + "expected native of type desktop.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.Canvas)//on-key-down: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(desktop.Canvas)//on-key-down: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.Canvas)//on-key-down: arg 1: expected native") + return env.NewError("Go(desktop.Canvas)//on-key-down: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.OnKeyDown() var res0Obj env.Object - res0Obj = *env.NewNative(ps.Idx, res0, "Go(func(*fyne.KeyEvent))") + res0Obj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val *fyne.KeyEvent + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + arg0Val = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(desktop.Canvas)//on-key-down: arg 1: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(desktop.Canvas)//on-key-down: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg0Val = nil + default: + ps.FailureFlag = true + return env.NewError("Go(desktop.Canvas)//on-key-down: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + res0(arg0Val) + return nil + }, 1, false, false, "Returned func") return res0Obj }, }, @@ -133180,28 +132920,50 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_desktop_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(desktop.Canvas)//on-key-up: arg 1: " + err.Error() + "") + return env.NewError("Go(desktop.Canvas)//on-key-up: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(desktop.Canvas) - if !ok { + if vc, ok := v.Value.(desktop.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.Canvas)//on-key-up: arg 1: expected native of type desktop.Canvas") + return env.NewError("Go(desktop.Canvas)//on-key-up: arg 1: " + "expected native of type desktop.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.Canvas)//on-key-up: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(desktop.Canvas)//on-key-up: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.Canvas)//on-key-up: arg 1: expected native") + return env.NewError("Go(desktop.Canvas)//on-key-up: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.OnKeyUp() var res0Obj env.Object - res0Obj = *env.NewNative(ps.Idx, res0, "Go(func(*fyne.KeyEvent))") + res0Obj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val *fyne.KeyEvent + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + arg0Val = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(desktop.Canvas)//on-key-up: arg 1: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(desktop.Canvas)//on-key-up: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg0Val = nil + default: + ps.FailureFlag = true + return env.NewError("Go(desktop.Canvas)//on-key-up: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + res0(arg0Val) + return nil + }, 1, false, false, "Returned func") return res0Obj }, }, @@ -133216,48 +132978,48 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_desktop_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(desktop.Canvas)//set-on-key-down: arg 1: " + err.Error() + "") + return env.NewError("Go(desktop.Canvas)//set-on-key-down: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(desktop.Canvas) - if !ok { + if vc, ok := v.Value.(desktop.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.Canvas)//set-on-key-down: arg 1: expected native of type desktop.Canvas") + return env.NewError("Go(desktop.Canvas)//set-on-key-down: arg 1: " + "expected native of type desktop.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.Canvas)//set-on-key-down: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(desktop.Canvas)//set-on-key-down: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.Canvas)//set-on-key-down: arg 1: expected native") + return env.NewError("Go(desktop.Canvas)//set-on-key-down: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func(*fyne.KeyEvent) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(desktop.Canvas)//set-on-key-down: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(desktop.Canvas)//set-on-key-down: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg1Val = func(arg0 *fyne.KeyEvent) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*fyne.KeyEvent)") + arg1Val = func(farg0 *fyne.KeyEvent) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*fyne.KeyEvent)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.Canvas)//set-on-key-down: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(desktop.Canvas)//set-on-key-down: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.Canvas)//set-on-key-down: arg 2: expected function or nil") + return env.NewError("Go(desktop.Canvas)//set-on-key-down: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } arg0Val.SetOnKeyDown(arg1Val) return arg0 @@ -133274,48 +133036,48 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_desktop_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(desktop.Canvas)//set-on-key-up: arg 1: " + err.Error() + "") + return env.NewError("Go(desktop.Canvas)//set-on-key-up: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(desktop.Canvas) - if !ok { + if vc, ok := v.Value.(desktop.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.Canvas)//set-on-key-up: arg 1: expected native of type desktop.Canvas") + return env.NewError("Go(desktop.Canvas)//set-on-key-up: arg 1: " + "expected native of type desktop.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.Canvas)//set-on-key-up: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(desktop.Canvas)//set-on-key-up: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.Canvas)//set-on-key-up: arg 1: expected native") + return env.NewError("Go(desktop.Canvas)//set-on-key-up: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func(*fyne.KeyEvent) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(desktop.Canvas)//set-on-key-up: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(desktop.Canvas)//set-on-key-up: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg1Val = func(arg0 *fyne.KeyEvent) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*fyne.KeyEvent)") + arg1Val = func(farg0 *fyne.KeyEvent) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*fyne.KeyEvent)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.Canvas)//set-on-key-up: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(desktop.Canvas)//set-on-key-up: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.Canvas)//set-on-key-up: arg 2: expected function or nil") + return env.NewError("Go(desktop.Canvas)//set-on-key-up: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } arg0Val.SetOnKeyUp(arg1Val) return arg0 @@ -133332,24 +133094,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_desktop_Cursor(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(desktop.Cursor)//image: arg 1: " + err.Error() + "") + return env.NewError("Go(desktop.Cursor)//image: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(desktop.Cursor) - if !ok { + if vc, ok := v.Value.(desktop.Cursor); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.Cursor)//image: arg 1: expected native of type desktop.Cursor") + return env.NewError("Go(desktop.Cursor)//image: arg 1: " + "expected native of type desktop.Cursor, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.Cursor)//image: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(desktop.Cursor)//image: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.Cursor)//image: arg 1: expected native") + return env.NewError("Go(desktop.Cursor)//image: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, res1, res2 := arg0Val.Image() var res0Obj env.Object @@ -133376,45 +133138,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_desktop_Cursorable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(desktop.Cursorable)//cursor: arg 1: " + err.Error() + "") + return env.NewError("Go(desktop.Cursorable)//cursor: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(desktop.Cursorable) - if !ok { + if vc, ok := v.Value.(desktop.Cursorable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.Cursorable)//cursor: arg 1: expected native of type desktop.Cursorable") + return env.NewError("Go(desktop.Cursorable)//cursor: arg 1: " + "expected native of type desktop.Cursorable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.Cursorable)//cursor: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(desktop.Cursorable)//cursor: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.Cursorable)//cursor: arg 1: expected native") + return env.NewError("Go(desktop.Cursorable)//cursor: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Cursor() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(desktop.Cursor)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(desktop.Cursor)") return res0Obj }, }, @@ -133429,45 +133174,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_desktop_Driver(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(desktop.Driver)//create-splash-window: arg 1: " + err.Error() + "") + return env.NewError("Go(desktop.Driver)//create-splash-window: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(desktop.Driver) - if !ok { + if vc, ok := v.Value.(desktop.Driver); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.Driver)//create-splash-window: arg 1: expected native of type desktop.Driver") + return env.NewError("Go(desktop.Driver)//create-splash-window: arg 1: " + "expected native of type desktop.Driver, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.Driver)//create-splash-window: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(desktop.Driver)//create-splash-window: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.Driver)//create-splash-window: arg 1: expected native") + return env.NewError("Go(desktop.Driver)//create-splash-window: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateSplashWindow() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Window)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Window)") return res0Obj }, }, @@ -133482,24 +133210,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_desktop_Driver(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(desktop.Driver)//current-key-modifiers: arg 1: " + err.Error() + "") + return env.NewError("Go(desktop.Driver)//current-key-modifiers: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(desktop.Driver) - if !ok { + if vc, ok := v.Value.(desktop.Driver); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.Driver)//current-key-modifiers: arg 1: expected native of type desktop.Driver") + return env.NewError("Go(desktop.Driver)//current-key-modifiers: arg 1: " + "expected native of type desktop.Driver, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.Driver)//current-key-modifiers: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(desktop.Driver)//current-key-modifiers: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.Driver)//current-key-modifiers: arg 1: expected native") + return env.NewError("Go(desktop.Driver)//current-key-modifiers: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CurrentKeyModifiers() var res0Obj env.Object @@ -133518,43 +133246,43 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_desktop_Hoverable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(desktop.Hoverable)//mouse-in: arg 1: " + err.Error() + "") + return env.NewError("Go(desktop.Hoverable)//mouse-in: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(desktop.Hoverable) - if !ok { + if vc, ok := v.Value.(desktop.Hoverable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.Hoverable)//mouse-in: arg 1: expected native of type desktop.Hoverable") + return env.NewError("Go(desktop.Hoverable)//mouse-in: arg 1: " + "expected native of type desktop.Hoverable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.Hoverable)//mouse-in: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(desktop.Hoverable)//mouse-in: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.Hoverable)//mouse-in: arg 1: expected native") + return env.NewError("Go(desktop.Hoverable)//mouse-in: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *desktop.MouseEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.Hoverable)//mouse-in: arg 2: expected native of type *desktop.MouseEvent") + return env.NewError("Go(desktop.Hoverable)//mouse-in: arg 2: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.Hoverable)//mouse-in: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(desktop.Hoverable)//mouse-in: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.Hoverable)//mouse-in: arg 2: expected native") + return env.NewError("Go(desktop.Hoverable)//mouse-in: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.MouseIn(arg1Val) return arg0 @@ -133571,43 +133299,43 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_desktop_Hoverable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(desktop.Hoverable)//mouse-moved: arg 1: " + err.Error() + "") + return env.NewError("Go(desktop.Hoverable)//mouse-moved: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(desktop.Hoverable) - if !ok { + if vc, ok := v.Value.(desktop.Hoverable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.Hoverable)//mouse-moved: arg 1: expected native of type desktop.Hoverable") + return env.NewError("Go(desktop.Hoverable)//mouse-moved: arg 1: " + "expected native of type desktop.Hoverable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.Hoverable)//mouse-moved: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(desktop.Hoverable)//mouse-moved: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.Hoverable)//mouse-moved: arg 1: expected native") + return env.NewError("Go(desktop.Hoverable)//mouse-moved: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *desktop.MouseEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.Hoverable)//mouse-moved: arg 2: expected native of type *desktop.MouseEvent") + return env.NewError("Go(desktop.Hoverable)//mouse-moved: arg 2: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.Hoverable)//mouse-moved: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(desktop.Hoverable)//mouse-moved: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.Hoverable)//mouse-moved: arg 2: expected native") + return env.NewError("Go(desktop.Hoverable)//mouse-moved: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.MouseMoved(arg1Val) return arg0 @@ -133624,24 +133352,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_desktop_Hoverable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(desktop.Hoverable)//mouse-out: arg 1: " + err.Error() + "") + return env.NewError("Go(desktop.Hoverable)//mouse-out: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(desktop.Hoverable) - if !ok { + if vc, ok := v.Value.(desktop.Hoverable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.Hoverable)//mouse-out: arg 1: expected native of type desktop.Hoverable") + return env.NewError("Go(desktop.Hoverable)//mouse-out: arg 1: " + "expected native of type desktop.Hoverable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.Hoverable)//mouse-out: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(desktop.Hoverable)//mouse-out: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.Hoverable)//mouse-out: arg 1: expected native") + return env.NewError("Go(desktop.Hoverable)//mouse-out: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.MouseOut() return arg0 @@ -133658,24 +133386,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_desktop_Keyable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//focus-gained: arg 1: " + err.Error() + "") + return env.NewError("Go(desktop.Keyable)//focus-gained: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(desktop.Keyable) - if !ok { + if vc, ok := v.Value.(desktop.Keyable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//focus-gained: arg 1: expected native of type desktop.Keyable") + return env.NewError("Go(desktop.Keyable)//focus-gained: arg 1: " + "expected native of type desktop.Keyable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//focus-gained: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(desktop.Keyable)//focus-gained: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//focus-gained: arg 1: expected native") + return env.NewError("Go(desktop.Keyable)//focus-gained: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusGained() return arg0 @@ -133692,24 +133420,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_desktop_Keyable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//focus-lost: arg 1: " + err.Error() + "") + return env.NewError("Go(desktop.Keyable)//focus-lost: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(desktop.Keyable) - if !ok { + if vc, ok := v.Value.(desktop.Keyable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//focus-lost: arg 1: expected native of type desktop.Keyable") + return env.NewError("Go(desktop.Keyable)//focus-lost: arg 1: " + "expected native of type desktop.Keyable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//focus-lost: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(desktop.Keyable)//focus-lost: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//focus-lost: arg 1: expected native") + return env.NewError("Go(desktop.Keyable)//focus-lost: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusLost() return arg0 @@ -133726,43 +133454,43 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_desktop_Keyable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//key-down: arg 1: " + err.Error() + "") + return env.NewError("Go(desktop.Keyable)//key-down: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(desktop.Keyable) - if !ok { + if vc, ok := v.Value.(desktop.Keyable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//key-down: arg 1: expected native of type desktop.Keyable") + return env.NewError("Go(desktop.Keyable)//key-down: arg 1: " + "expected native of type desktop.Keyable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//key-down: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(desktop.Keyable)//key-down: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//key-down: arg 1: expected native") + return env.NewError("Go(desktop.Keyable)//key-down: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.KeyEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.KeyEvent) - if !ok { + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//key-down: arg 2: expected native of type *fyne.KeyEvent") + return env.NewError("Go(desktop.Keyable)//key-down: arg 2: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//key-down: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(desktop.Keyable)//key-down: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//key-down: arg 2: expected native") + return env.NewError("Go(desktop.Keyable)//key-down: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.KeyDown(arg1Val) return arg0 @@ -133779,43 +133507,43 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_desktop_Keyable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//key-up: arg 1: " + err.Error() + "") + return env.NewError("Go(desktop.Keyable)//key-up: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(desktop.Keyable) - if !ok { + if vc, ok := v.Value.(desktop.Keyable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//key-up: arg 1: expected native of type desktop.Keyable") + return env.NewError("Go(desktop.Keyable)//key-up: arg 1: " + "expected native of type desktop.Keyable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//key-up: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(desktop.Keyable)//key-up: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//key-up: arg 1: expected native") + return env.NewError("Go(desktop.Keyable)//key-up: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.KeyEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.KeyEvent) - if !ok { + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//key-up: arg 2: expected native of type *fyne.KeyEvent") + return env.NewError("Go(desktop.Keyable)//key-up: arg 2: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//key-up: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(desktop.Keyable)//key-up: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//key-up: arg 2: expected native") + return env.NewError("Go(desktop.Keyable)//key-up: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.KeyUp(arg1Val) return arg0 @@ -133832,43 +133560,43 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_desktop_Keyable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//typed-key: arg 1: " + err.Error() + "") + return env.NewError("Go(desktop.Keyable)//typed-key: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(desktop.Keyable) - if !ok { + if vc, ok := v.Value.(desktop.Keyable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//typed-key: arg 1: expected native of type desktop.Keyable") + return env.NewError("Go(desktop.Keyable)//typed-key: arg 1: " + "expected native of type desktop.Keyable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//typed-key: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(desktop.Keyable)//typed-key: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//typed-key: arg 1: expected native") + return env.NewError("Go(desktop.Keyable)//typed-key: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.KeyEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.KeyEvent) - if !ok { + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//typed-key: arg 2: expected native of type *fyne.KeyEvent") + return env.NewError("Go(desktop.Keyable)//typed-key: arg 2: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//typed-key: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(desktop.Keyable)//typed-key: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//typed-key: arg 2: expected native") + return env.NewError("Go(desktop.Keyable)//typed-key: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedKey(arg1Val) return arg0 @@ -133885,37 +133613,37 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_desktop_Keyable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//typed-rune: arg 1: " + err.Error() + "") + return env.NewError("Go(desktop.Keyable)//typed-rune: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(desktop.Keyable) - if !ok { + if vc, ok := v.Value.(desktop.Keyable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//typed-rune: arg 1: expected native of type desktop.Keyable") + return env.NewError("Go(desktop.Keyable)//typed-rune: arg 1: " + "expected native of type desktop.Keyable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//typed-rune: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(desktop.Keyable)//typed-rune: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//typed-rune: arg 1: expected native") + return env.NewError("Go(desktop.Keyable)//typed-rune: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val rune switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//typed-rune: arg 2: expected native of type rune") + return env.NewError("Go(desktop.Keyable)//typed-rune: arg 2: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(desktop.Keyable)//typed-rune: arg 2: expected native") + return env.NewError("Go(desktop.Keyable)//typed-rune: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedRune(arg1Val) return arg0 @@ -133932,43 +133660,43 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_desktop_Mouseable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(desktop.Mouseable)//mouse-down: arg 1: " + err.Error() + "") + return env.NewError("Go(desktop.Mouseable)//mouse-down: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(desktop.Mouseable) - if !ok { + if vc, ok := v.Value.(desktop.Mouseable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.Mouseable)//mouse-down: arg 1: expected native of type desktop.Mouseable") + return env.NewError("Go(desktop.Mouseable)//mouse-down: arg 1: " + "expected native of type desktop.Mouseable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.Mouseable)//mouse-down: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(desktop.Mouseable)//mouse-down: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.Mouseable)//mouse-down: arg 1: expected native") + return env.NewError("Go(desktop.Mouseable)//mouse-down: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *desktop.MouseEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.Mouseable)//mouse-down: arg 2: expected native of type *desktop.MouseEvent") + return env.NewError("Go(desktop.Mouseable)//mouse-down: arg 2: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.Mouseable)//mouse-down: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(desktop.Mouseable)//mouse-down: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.Mouseable)//mouse-down: arg 2: expected native") + return env.NewError("Go(desktop.Mouseable)//mouse-down: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.MouseDown(arg1Val) return arg0 @@ -133985,43 +133713,43 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_desktop_Mouseable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(desktop.Mouseable)//mouse-up: arg 1: " + err.Error() + "") + return env.NewError("Go(desktop.Mouseable)//mouse-up: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(desktop.Mouseable) - if !ok { + if vc, ok := v.Value.(desktop.Mouseable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.Mouseable)//mouse-up: arg 1: expected native of type desktop.Mouseable") + return env.NewError("Go(desktop.Mouseable)//mouse-up: arg 1: " + "expected native of type desktop.Mouseable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.Mouseable)//mouse-up: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(desktop.Mouseable)//mouse-up: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.Mouseable)//mouse-up: arg 1: expected native") + return env.NewError("Go(desktop.Mouseable)//mouse-up: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *desktop.MouseEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*desktop.MouseEvent) - if !ok { + if vc, ok := v.Value.(*desktop.MouseEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(desktop.Mouseable)//mouse-up: arg 2: expected native of type *desktop.MouseEvent") + return env.NewError("Go(desktop.Mouseable)//mouse-up: arg 2: " + "expected native of type *desktop.MouseEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(desktop.Mouseable)//mouse-up: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(desktop.Mouseable)//mouse-up: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(desktop.Mouseable)//mouse-up: arg 2: expected native") + return env.NewError("Go(desktop.Mouseable)//mouse-up: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.MouseUp(arg1Val) return arg0 @@ -134043,11 +133771,11 @@ var Builtins = map[string]*env.Builtin{ arg0Val = natVal } else { var u int - if v, ok := arg0.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg0.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(desktop.StandardCursor)//image: arg 1: expected integer") + return env.NewError("Go(desktop.StandardCursor)//image: arg 1: " + "expected integer, but got " + objectDebugString(ps.Idx, arg0)) } arg0Val = desktop.StandardCursor(u) } @@ -134077,24 +133805,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_dialog_Dialog(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//hide: arg 1: " + err.Error() + "") + return env.NewError("Go(dialog.Dialog)//hide: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(dialog.Dialog) - if !ok { + if vc, ok := v.Value.(dialog.Dialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//hide: arg 1: expected native of type dialog.Dialog") + return env.NewError("Go(dialog.Dialog)//hide: arg 1: " + "expected native of type dialog.Dialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(dialog.Dialog)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//hide: arg 1: expected native") + return env.NewError("Go(dialog.Dialog)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -134111,24 +133839,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_dialog_Dialog(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//min-size: arg 1: " + err.Error() + "") + return env.NewError("Go(dialog.Dialog)//min-size: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(dialog.Dialog) - if !ok { + if vc, ok := v.Value.(dialog.Dialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//min-size: arg 1: expected native of type dialog.Dialog") + return env.NewError("Go(dialog.Dialog)//min-size: arg 1: " + "expected native of type dialog.Dialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(dialog.Dialog)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//min-size: arg 1: expected native") + return env.NewError("Go(dialog.Dialog)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -134147,24 +133875,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_dialog_Dialog(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//refresh: arg 1: " + err.Error() + "") + return env.NewError("Go(dialog.Dialog)//refresh: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(dialog.Dialog) - if !ok { + if vc, ok := v.Value.(dialog.Dialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//refresh: arg 1: expected native of type dialog.Dialog") + return env.NewError("Go(dialog.Dialog)//refresh: arg 1: " + "expected native of type dialog.Dialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(dialog.Dialog)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//refresh: arg 1: expected native") + return env.NewError("Go(dialog.Dialog)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -134181,45 +133909,39 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_dialog_Dialog(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//resize: arg 1: " + err.Error() + "") + return env.NewError("Go(dialog.Dialog)//resize: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(dialog.Dialog) - if !ok { + if vc, ok := v.Value.(dialog.Dialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//resize: arg 1: expected native of type dialog.Dialog") + return env.NewError("Go(dialog.Dialog)//resize: arg 1: " + "expected native of type dialog.Dialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(dialog.Dialog)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//resize: arg 1: expected native") + return env.NewError("Go(dialog.Dialog)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(dialog.Dialog)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//resize: arg 2: expected native") + return env.NewError("Go(dialog.Dialog)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -134234,31 +133956,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_dialog_Dialog(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//set-dismiss-text: arg 1: " + err.Error() + "") + return env.NewError("Go(dialog.Dialog)//set-dismiss-text: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(dialog.Dialog) - if !ok { + if vc, ok := v.Value.(dialog.Dialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//set-dismiss-text: arg 1: expected native of type dialog.Dialog") + return env.NewError("Go(dialog.Dialog)//set-dismiss-text: arg 1: " + "expected native of type dialog.Dialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//set-dismiss-text: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(dialog.Dialog)//set-dismiss-text: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//set-dismiss-text: arg 1: expected native") + return env.NewError("Go(dialog.Dialog)//set-dismiss-text: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//set-dismiss-text: arg 2: expected string") + return env.NewError("Go(dialog.Dialog)//set-dismiss-text: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetDismissText(arg1Val) return arg0 @@ -134275,31 +133997,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_dialog_Dialog(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//set-on-closed: arg 1: " + err.Error() + "") + return env.NewError("Go(dialog.Dialog)//set-on-closed: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(dialog.Dialog) - if !ok { + if vc, ok := v.Value.(dialog.Dialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//set-on-closed: arg 1: expected native of type dialog.Dialog") + return env.NewError("Go(dialog.Dialog)//set-on-closed: arg 1: " + "expected native of type dialog.Dialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//set-on-closed: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(dialog.Dialog)//set-on-closed: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//set-on-closed: arg 1: expected native") + return env.NewError("Go(dialog.Dialog)//set-on-closed: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func() switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//set-on-closed: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(dialog.Dialog)//set-on-closed: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } arg1Val = func() { actualFn := fn @@ -134309,12 +134031,12 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//set-on-closed: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(dialog.Dialog)//set-on-closed: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//set-on-closed: arg 2: expected function or nil") + return env.NewError("Go(dialog.Dialog)//set-on-closed: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } arg0Val.SetOnClosed(arg1Val) return arg0 @@ -134331,24 +134053,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_dialog_Dialog(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//show: arg 1: " + err.Error() + "") + return env.NewError("Go(dialog.Dialog)//show: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(dialog.Dialog) - if !ok { + if vc, ok := v.Value.(dialog.Dialog); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//show: arg 1: expected native of type dialog.Dialog") + return env.NewError("Go(dialog.Dialog)//show: arg 1: " + "expected native of type dialog.Dialog, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(dialog.Dialog)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(dialog.Dialog)//show: arg 1: expected native") + return env.NewError("Go(dialog.Dialog)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -134365,45 +134087,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_App(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//cloud-provider: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.App)//cloud-provider: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.App) - if !ok { + if vc, ok := v.Value.(fyne.App); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//cloud-provider: arg 1: expected native of type fyne.App") + return env.NewError("Go(fyne.App)//cloud-provider: arg 1: " + "expected native of type fyne.App, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//cloud-provider: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.App)//cloud-provider: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.App)//cloud-provider: arg 1: expected native") + return env.NewError("Go(fyne.App)//cloud-provider: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CloudProvider() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.CloudProvider)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.CloudProvider)") return res0Obj }, }, @@ -134418,45 +134123,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_App(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//driver: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.App)//driver: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.App) - if !ok { + if vc, ok := v.Value.(fyne.App); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//driver: arg 1: expected native of type fyne.App") + return env.NewError("Go(fyne.App)//driver: arg 1: " + "expected native of type fyne.App, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//driver: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.App)//driver: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.App)//driver: arg 1: expected native") + return env.NewError("Go(fyne.App)//driver: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Driver() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Driver)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Driver)") return res0Obj }, }, @@ -134471,45 +134159,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_App(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//icon: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.App)//icon: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.App) - if !ok { + if vc, ok := v.Value.(fyne.App); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//icon: arg 1: expected native of type fyne.App") + return env.NewError("Go(fyne.App)//icon: arg 1: " + "expected native of type fyne.App, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//icon: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.App)//icon: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.App)//icon: arg 1: expected native") + return env.NewError("Go(fyne.App)//icon: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Icon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -134524,45 +134195,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_App(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//lifecycle: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.App)//lifecycle: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.App) - if !ok { + if vc, ok := v.Value.(fyne.App); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//lifecycle: arg 1: expected native of type fyne.App") + return env.NewError("Go(fyne.App)//lifecycle: arg 1: " + "expected native of type fyne.App, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//lifecycle: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.App)//lifecycle: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.App)//lifecycle: arg 1: expected native") + return env.NewError("Go(fyne.App)//lifecycle: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Lifecycle() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Lifecycle)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Lifecycle)") return res0Obj }, }, @@ -134577,24 +134231,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_App(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//metadata: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.App)//metadata: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.App) - if !ok { + if vc, ok := v.Value.(fyne.App); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//metadata: arg 1: expected native of type fyne.App") + return env.NewError("Go(fyne.App)//metadata: arg 1: " + "expected native of type fyne.App, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//metadata: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.App)//metadata: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.App)//metadata: arg 1: expected native") + return env.NewError("Go(fyne.App)//metadata: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Metadata() var res0Obj env.Object @@ -134613,52 +134267,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_App(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//window: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.App)//window: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.App) - if !ok { + if vc, ok := v.Value.(fyne.App); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//window: arg 1: expected native of type fyne.App") + return env.NewError("Go(fyne.App)//window: arg 1: " + "expected native of type fyne.App, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//window: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.App)//window: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.App)//window: arg 1: expected native") + return env.NewError("Go(fyne.App)//window: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//window: arg 2: expected string") + return env.NewError("Go(fyne.App)//window: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := arg0Val.NewWindow(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Window)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Window)") return res0Obj }, }, @@ -134673,43 +134310,43 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_App(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//open-url: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.App)//open-url: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.App) - if !ok { + if vc, ok := v.Value.(fyne.App); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//open-url: arg 1: expected native of type fyne.App") + return env.NewError("Go(fyne.App)//open-url: arg 1: " + "expected native of type fyne.App, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//open-url: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.App)//open-url: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.App)//open-url: arg 1: expected native") + return env.NewError("Go(fyne.App)//open-url: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *url.URL switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*url.URL) - if !ok { + if vc, ok := v.Value.(*url.URL); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//open-url: arg 2: expected native of type *url.URL") + return env.NewError("Go(fyne.App)//open-url: arg 2: " + "expected native of type *url.URL, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//open-url: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.App)//open-url: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.App)//open-url: arg 2: expected native") + return env.NewError("Go(fyne.App)//open-url: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.OpenURL(arg1Val) var resErrObj env.Object @@ -134734,45 +134371,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_App(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//preferences: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.App)//preferences: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.App) - if !ok { + if vc, ok := v.Value.(fyne.App); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//preferences: arg 1: expected native of type fyne.App") + return env.NewError("Go(fyne.App)//preferences: arg 1: " + "expected native of type fyne.App, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//preferences: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.App)//preferences: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.App)//preferences: arg 1: expected native") + return env.NewError("Go(fyne.App)//preferences: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Preferences() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Preferences)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Preferences)") return res0Obj }, }, @@ -134787,24 +134407,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_App(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//quit: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.App)//quit: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.App) - if !ok { + if vc, ok := v.Value.(fyne.App); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//quit: arg 1: expected native of type fyne.App") + return env.NewError("Go(fyne.App)//quit: arg 1: " + "expected native of type fyne.App, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//quit: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.App)//quit: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.App)//quit: arg 1: expected native") + return env.NewError("Go(fyne.App)//quit: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Quit() return arg0 @@ -134821,24 +134441,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_App(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//run: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.App)//run: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.App) - if !ok { + if vc, ok := v.Value.(fyne.App); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//run: arg 1: expected native of type fyne.App") + return env.NewError("Go(fyne.App)//run: arg 1: " + "expected native of type fyne.App, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//run: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.App)//run: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.App)//run: arg 1: expected native") + return env.NewError("Go(fyne.App)//run: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Run() return arg0 @@ -134855,43 +134475,43 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_App(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//send-notification: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.App)//send-notification: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.App) - if !ok { + if vc, ok := v.Value.(fyne.App); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//send-notification: arg 1: expected native of type fyne.App") + return env.NewError("Go(fyne.App)//send-notification: arg 1: " + "expected native of type fyne.App, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//send-notification: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.App)//send-notification: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.App)//send-notification: arg 1: expected native") + return env.NewError("Go(fyne.App)//send-notification: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.Notification switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Notification) - if !ok { + if vc, ok := v.Value.(*fyne.Notification); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//send-notification: arg 2: expected native of type *fyne.Notification") + return env.NewError("Go(fyne.App)//send-notification: arg 2: " + "expected native of type *fyne.Notification, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//send-notification: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.App)//send-notification: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.App)//send-notification: arg 2: expected native") + return env.NewError("Go(fyne.App)//send-notification: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SendNotification(arg1Val) return arg0 @@ -134908,24 +134528,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_App(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//set-cloud-provider: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.App)//set-cloud-provider: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.App) - if !ok { + if vc, ok := v.Value.(fyne.App); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//set-cloud-provider: arg 1: expected native of type fyne.App") + return env.NewError("Go(fyne.App)//set-cloud-provider: arg 1: " + "expected native of type fyne.App, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//set-cloud-provider: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.App)//set-cloud-provider: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.App)//set-cloud-provider: arg 1: expected native") + return env.NewError("Go(fyne.App)//set-cloud-provider: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.CloudProvider switch v := arg1.(type) { @@ -134934,24 +134554,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CloudProvider(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//set-cloud-provider: arg 2: " + err.Error() + "") + return env.NewError("Go(fyne.App)//set-cloud-provider: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CloudProvider) - if !ok { + if vc, ok := v.Value.(fyne.CloudProvider); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//set-cloud-provider: arg 2: expected native of type fyne.CloudProvider") + return env.NewError("Go(fyne.App)//set-cloud-provider: arg 2: " + "expected native of type fyne.CloudProvider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//set-cloud-provider: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.App)//set-cloud-provider: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.App)//set-cloud-provider: arg 2: expected native") + return env.NewError("Go(fyne.App)//set-cloud-provider: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetCloudProvider(arg1Val) return arg0 @@ -134968,24 +134588,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_App(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//set-icon: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.App)//set-icon: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.App) - if !ok { + if vc, ok := v.Value.(fyne.App); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//set-icon: arg 1: expected native of type fyne.App") + return env.NewError("Go(fyne.App)//set-icon: arg 1: " + "expected native of type fyne.App, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//set-icon: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.App)//set-icon: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.App)//set-icon: arg 1: expected native") + return env.NewError("Go(fyne.App)//set-icon: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Resource switch v := arg1.(type) { @@ -134994,24 +134614,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Resource(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//set-icon: arg 2: " + err.Error() + "") + return env.NewError("Go(fyne.App)//set-icon: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//set-icon: arg 2: expected native of type fyne.Resource") + return env.NewError("Go(fyne.App)//set-icon: arg 2: " + "expected native of type fyne.Resource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//set-icon: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.App)//set-icon: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.App)//set-icon: arg 2: expected native") + return env.NewError("Go(fyne.App)//set-icon: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetIcon(arg1Val) return arg0 @@ -135028,45 +134648,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_App(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//settings: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.App)//settings: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.App) - if !ok { + if vc, ok := v.Value.(fyne.App); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//settings: arg 1: expected native of type fyne.App") + return env.NewError("Go(fyne.App)//settings: arg 1: " + "expected native of type fyne.App, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//settings: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.App)//settings: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.App)//settings: arg 1: expected native") + return env.NewError("Go(fyne.App)//settings: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Settings() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Settings)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Settings)") return res0Obj }, }, @@ -135081,45 +134684,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_App(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//storage: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.App)//storage: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.App) - if !ok { + if vc, ok := v.Value.(fyne.App); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//storage: arg 1: expected native of type fyne.App") + return env.NewError("Go(fyne.App)//storage: arg 1: " + "expected native of type fyne.App, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//storage: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.App)//storage: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.App)//storage: arg 1: expected native") + return env.NewError("Go(fyne.App)//storage: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Storage() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Storage)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Storage)") return res0Obj }, }, @@ -135134,24 +134720,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_App(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//unique-id: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.App)//unique-id: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.App) - if !ok { + if vc, ok := v.Value.(fyne.App); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//unique-id: arg 1: expected native of type fyne.App") + return env.NewError("Go(fyne.App)//unique-id: arg 1: " + "expected native of type fyne.App, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.App)//unique-id: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.App)//unique-id: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.App)//unique-id: arg 1: expected native") + return env.NewError("Go(fyne.App)//unique-id: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.UniqueID() var res0Obj env.Object @@ -135170,24 +134756,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//add-shortcut: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Canvas)//add-shortcut: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//add-shortcut: arg 1: expected native of type fyne.Canvas") + return env.NewError("Go(fyne.Canvas)//add-shortcut: arg 1: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//add-shortcut: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Canvas)//add-shortcut: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//add-shortcut: arg 1: expected native") + return env.NewError("Go(fyne.Canvas)//add-shortcut: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Shortcut switch v := arg1.(type) { @@ -135196,65 +134782,48 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Shortcut(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//add-shortcut: arg 2: " + err.Error() + "") + return env.NewError("Go(fyne.Canvas)//add-shortcut: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Shortcut) - if !ok { + if vc, ok := v.Value.(fyne.Shortcut); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//add-shortcut: arg 2: expected native of type fyne.Shortcut") + return env.NewError("Go(fyne.Canvas)//add-shortcut: arg 2: " + "expected native of type fyne.Shortcut, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//add-shortcut: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Canvas)//add-shortcut: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//add-shortcut: arg 2: expected native") + return env.NewError("Go(fyne.Canvas)//add-shortcut: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg2Val func(fyne.Shortcut) switch fn := arg2.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//add-shortcut: arg 3: function has invalid number of arguments (expected 1)") + return env.NewError("Go(fyne.Canvas)//add-shortcut: arg 3: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg2Val = func(arg0 fyne.Shortcut) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.Shortcut)") - } - } + arg2Val = func(farg0 fyne.Shortcut) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.Shortcut)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//add-shortcut: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Canvas)//add-shortcut: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//add-shortcut: arg 3: expected function or nil") + return env.NewError("Go(fyne.Canvas)//add-shortcut: arg 3: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } arg0Val.AddShortcut(arg1Val, arg2Val) return arg0 @@ -135271,24 +134840,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//capture: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Canvas)//capture: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//capture: arg 1: expected native of type fyne.Canvas") + return env.NewError("Go(fyne.Canvas)//capture: arg 1: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//capture: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Canvas)//capture: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//capture: arg 1: expected native") + return env.NewError("Go(fyne.Canvas)//capture: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Capture() var res0Obj env.Object @@ -135307,45 +134876,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//content: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Canvas)//content: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//content: arg 1: expected native of type fyne.Canvas") + return env.NewError("Go(fyne.Canvas)//content: arg 1: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//content: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Canvas)//content: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//content: arg 1: expected native") + return env.NewError("Go(fyne.Canvas)//content: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Content() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.CanvasObject)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.CanvasObject)") return res0Obj }, }, @@ -135360,24 +134912,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//focus: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Canvas)//focus: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//focus: arg 1: expected native of type fyne.Canvas") + return env.NewError("Go(fyne.Canvas)//focus: arg 1: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//focus: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Canvas)//focus: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//focus: arg 1: expected native") + return env.NewError("Go(fyne.Canvas)//focus: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Focusable switch v := arg1.(type) { @@ -135386,24 +134938,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Focusable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//focus: arg 2: " + err.Error() + "") + return env.NewError("Go(fyne.Canvas)//focus: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Focusable) - if !ok { + if vc, ok := v.Value.(fyne.Focusable); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//focus: arg 2: expected native of type fyne.Focusable") + return env.NewError("Go(fyne.Canvas)//focus: arg 2: " + "expected native of type fyne.Focusable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//focus: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Canvas)//focus: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//focus: arg 2: expected native") + return env.NewError("Go(fyne.Canvas)//focus: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Focus(arg1Val) return arg0 @@ -135420,24 +134972,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//focus-next: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Canvas)//focus-next: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//focus-next: arg 1: expected native of type fyne.Canvas") + return env.NewError("Go(fyne.Canvas)//focus-next: arg 1: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//focus-next: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Canvas)//focus-next: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//focus-next: arg 1: expected native") + return env.NewError("Go(fyne.Canvas)//focus-next: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusNext() return arg0 @@ -135454,24 +135006,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//focus-previous: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Canvas)//focus-previous: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//focus-previous: arg 1: expected native of type fyne.Canvas") + return env.NewError("Go(fyne.Canvas)//focus-previous: arg 1: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//focus-previous: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Canvas)//focus-previous: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//focus-previous: arg 1: expected native") + return env.NewError("Go(fyne.Canvas)//focus-previous: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusPrevious() return arg0 @@ -135488,45 +135040,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//focused: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Canvas)//focused: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//focused: arg 1: expected native of type fyne.Canvas") + return env.NewError("Go(fyne.Canvas)//focused: arg 1: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//focused: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Canvas)//focused: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//focused: arg 1: expected native") + return env.NewError("Go(fyne.Canvas)//focused: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Focused() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Focusable)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Focusable)") return res0Obj }, }, @@ -135541,24 +135076,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//interactive-area: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Canvas)//interactive-area: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//interactive-area: arg 1: expected native of type fyne.Canvas") + return env.NewError("Go(fyne.Canvas)//interactive-area: arg 1: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//interactive-area: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Canvas)//interactive-area: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//interactive-area: arg 1: expected native") + return env.NewError("Go(fyne.Canvas)//interactive-area: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, res1 := arg0Val.InteractiveArea() var res0Obj env.Object @@ -135582,28 +135117,50 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//on-typed-key: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Canvas)//on-typed-key: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//on-typed-key: arg 1: expected native of type fyne.Canvas") + return env.NewError("Go(fyne.Canvas)//on-typed-key: arg 1: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//on-typed-key: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Canvas)//on-typed-key: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//on-typed-key: arg 1: expected native") + return env.NewError("Go(fyne.Canvas)//on-typed-key: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.OnTypedKey() var res0Obj env.Object - res0Obj = *env.NewNative(ps.Idx, res0, "Go(func(*fyne.KeyEvent))") + res0Obj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val *fyne.KeyEvent + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + arg0Val = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(fyne.Canvas)//on-typed-key: arg 1: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(fyne.Canvas)//on-typed-key: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg0Val = nil + default: + ps.FailureFlag = true + return env.NewError("Go(fyne.Canvas)//on-typed-key: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + res0(arg0Val) + return nil + }, 1, false, false, "Returned func") return res0Obj }, }, @@ -135618,28 +135175,44 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//on-typed-rune: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Canvas)//on-typed-rune: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//on-typed-rune: arg 1: expected native of type fyne.Canvas") + return env.NewError("Go(fyne.Canvas)//on-typed-rune: arg 1: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//on-typed-rune: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Canvas)//on-typed-rune: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//on-typed-rune: arg 1: expected native") + return env.NewError("Go(fyne.Canvas)//on-typed-rune: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.OnTypedRune() var res0Obj env.Object - res0Obj = *env.NewNative(ps.Idx, res0, "Go(func(rune))") + res0Obj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val rune + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(rune); ok { + arg0Val = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(fyne.Canvas)//on-typed-rune: arg 1: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) + } + default: + ps.FailureFlag = true + return env.NewError("Go(fyne.Canvas)//on-typed-rune: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + res0(arg0Val) + return nil + }, 1, false, false, "Returned func") return res0Obj }, }, @@ -135654,45 +135227,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//overlays: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Canvas)//overlays: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//overlays: arg 1: expected native of type fyne.Canvas") + return env.NewError("Go(fyne.Canvas)//overlays: arg 1: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//overlays: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Canvas)//overlays: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//overlays: arg 1: expected native") + return env.NewError("Go(fyne.Canvas)//overlays: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Overlays() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.OverlayStack)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.OverlayStack)") return res0Obj }, }, @@ -135707,45 +135263,39 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//pixel-coordinate-for-position: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Canvas)//pixel-coordinate-for-position: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//pixel-coordinate-for-position: arg 1: expected native of type fyne.Canvas") + return env.NewError("Go(fyne.Canvas)//pixel-coordinate-for-position: arg 1: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//pixel-coordinate-for-position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Canvas)//pixel-coordinate-for-position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//pixel-coordinate-for-position: arg 1: expected native") + return env.NewError("Go(fyne.Canvas)//pixel-coordinate-for-position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//pixel-coordinate-for-position: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//pixel-coordinate-for-position: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Canvas)//pixel-coordinate-for-position: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//pixel-coordinate-for-position: arg 2: expected native") + return env.NewError("Go(fyne.Canvas)//pixel-coordinate-for-position: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - res0, res1 := arg0Val.PixelCoordinateForPosition(*arg1Val) + res0, res1 := arg0Val.PixelCoordinateForPosition(arg1Val) var res0Obj env.Object res0Obj = *env.NewInteger(int64(res0)) var res1Obj env.Object @@ -135767,24 +135317,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//refresh: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Canvas)//refresh: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//refresh: arg 1: expected native of type fyne.Canvas") + return env.NewError("Go(fyne.Canvas)//refresh: arg 1: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Canvas)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//refresh: arg 1: expected native") + return env.NewError("Go(fyne.Canvas)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.CanvasObject switch v := arg1.(type) { @@ -135793,24 +135343,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//refresh: arg 2: " + err.Error() + "") + return env.NewError("Go(fyne.Canvas)//refresh: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//refresh: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("Go(fyne.Canvas)//refresh: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//refresh: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Canvas)//refresh: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//refresh: arg 2: expected native") + return env.NewError("Go(fyne.Canvas)//refresh: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh(arg1Val) return arg0 @@ -135827,24 +135377,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//remove-shortcut: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Canvas)//remove-shortcut: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//remove-shortcut: arg 1: expected native of type fyne.Canvas") + return env.NewError("Go(fyne.Canvas)//remove-shortcut: arg 1: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//remove-shortcut: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Canvas)//remove-shortcut: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//remove-shortcut: arg 1: expected native") + return env.NewError("Go(fyne.Canvas)//remove-shortcut: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Shortcut switch v := arg1.(type) { @@ -135853,24 +135403,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Shortcut(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//remove-shortcut: arg 2: " + err.Error() + "") + return env.NewError("Go(fyne.Canvas)//remove-shortcut: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Shortcut) - if !ok { + if vc, ok := v.Value.(fyne.Shortcut); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//remove-shortcut: arg 2: expected native of type fyne.Shortcut") + return env.NewError("Go(fyne.Canvas)//remove-shortcut: arg 2: " + "expected native of type fyne.Shortcut, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//remove-shortcut: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Canvas)//remove-shortcut: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//remove-shortcut: arg 2: expected native") + return env.NewError("Go(fyne.Canvas)//remove-shortcut: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveShortcut(arg1Val) return arg0 @@ -135887,24 +135437,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//scale: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Canvas)//scale: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//scale: arg 1: expected native of type fyne.Canvas") + return env.NewError("Go(fyne.Canvas)//scale: arg 1: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//scale: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Canvas)//scale: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//scale: arg 1: expected native") + return env.NewError("Go(fyne.Canvas)//scale: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Scale() var res0Obj env.Object @@ -135923,24 +135473,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//set-content: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Canvas)//set-content: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//set-content: arg 1: expected native of type fyne.Canvas") + return env.NewError("Go(fyne.Canvas)//set-content: arg 1: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//set-content: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Canvas)//set-content: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//set-content: arg 1: expected native") + return env.NewError("Go(fyne.Canvas)//set-content: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.CanvasObject switch v := arg1.(type) { @@ -135949,24 +135499,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//set-content: arg 2: " + err.Error() + "") + return env.NewError("Go(fyne.Canvas)//set-content: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//set-content: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("Go(fyne.Canvas)//set-content: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//set-content: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Canvas)//set-content: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//set-content: arg 2: expected native") + return env.NewError("Go(fyne.Canvas)//set-content: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetContent(arg1Val) return arg0 @@ -135983,48 +135533,48 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//set-on-typed-key: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Canvas)//set-on-typed-key: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//set-on-typed-key: arg 1: expected native of type fyne.Canvas") + return env.NewError("Go(fyne.Canvas)//set-on-typed-key: arg 1: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//set-on-typed-key: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Canvas)//set-on-typed-key: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//set-on-typed-key: arg 1: expected native") + return env.NewError("Go(fyne.Canvas)//set-on-typed-key: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func(*fyne.KeyEvent) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//set-on-typed-key: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(fyne.Canvas)//set-on-typed-key: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg1Val = func(arg0 *fyne.KeyEvent) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*fyne.KeyEvent)") + arg1Val = func(farg0 *fyne.KeyEvent) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*fyne.KeyEvent)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//set-on-typed-key: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Canvas)//set-on-typed-key: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//set-on-typed-key: arg 2: expected function or nil") + return env.NewError("Go(fyne.Canvas)//set-on-typed-key: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } arg0Val.SetOnTypedKey(arg1Val) return arg0 @@ -136041,48 +135591,48 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//set-on-typed-rune: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Canvas)//set-on-typed-rune: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//set-on-typed-rune: arg 1: expected native of type fyne.Canvas") + return env.NewError("Go(fyne.Canvas)//set-on-typed-rune: arg 1: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//set-on-typed-rune: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Canvas)//set-on-typed-rune: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//set-on-typed-rune: arg 1: expected native") + return env.NewError("Go(fyne.Canvas)//set-on-typed-rune: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func(rune) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//set-on-typed-rune: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(fyne.Canvas)//set-on-typed-rune: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg1Val = func(arg0 rune) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(rune)") + arg1Val = func(farg0 rune) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(rune)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//set-on-typed-rune: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Canvas)//set-on-typed-rune: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//set-on-typed-rune: arg 2: expected function or nil") + return env.NewError("Go(fyne.Canvas)//set-on-typed-rune: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } arg0Val.SetOnTypedRune(arg1Val) return arg0 @@ -136099,24 +135649,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//size: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Canvas)//size: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//size: arg 1: expected native of type fyne.Canvas") + return env.NewError("Go(fyne.Canvas)//size: arg 1: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Canvas)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//size: arg 1: expected native") + return env.NewError("Go(fyne.Canvas)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -136135,24 +135685,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//unfocus: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Canvas)//unfocus: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//unfocus: arg 1: expected native of type fyne.Canvas") + return env.NewError("Go(fyne.Canvas)//unfocus: arg 1: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//unfocus: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Canvas)//unfocus: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Canvas)//unfocus: arg 1: expected native") + return env.NewError("Go(fyne.Canvas)//unfocus: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Unfocus() return arg0 @@ -136169,24 +135719,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//hide: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.CanvasObject)//hide: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//hide: arg 1: expected native of type fyne.CanvasObject") + return env.NewError("Go(fyne.CanvasObject)//hide: arg 1: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.CanvasObject)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//hide: arg 1: expected native") + return env.NewError("Go(fyne.CanvasObject)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -136203,24 +135753,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//min-size: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.CanvasObject)//min-size: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//min-size: arg 1: expected native of type fyne.CanvasObject") + return env.NewError("Go(fyne.CanvasObject)//min-size: arg 1: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.CanvasObject)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//min-size: arg 1: expected native") + return env.NewError("Go(fyne.CanvasObject)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -136239,45 +135789,39 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//move: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.CanvasObject)//move: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//move: arg 1: expected native of type fyne.CanvasObject") + return env.NewError("Go(fyne.CanvasObject)//move: arg 1: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.CanvasObject)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//move: arg 1: expected native") + return env.NewError("Go(fyne.CanvasObject)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.CanvasObject)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//move: arg 2: expected native") + return env.NewError("Go(fyne.CanvasObject)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -136292,24 +135836,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//position: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.CanvasObject)//position: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//position: arg 1: expected native of type fyne.CanvasObject") + return env.NewError("Go(fyne.CanvasObject)//position: arg 1: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.CanvasObject)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//position: arg 1: expected native") + return env.NewError("Go(fyne.CanvasObject)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -136328,24 +135872,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//refresh: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.CanvasObject)//refresh: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//refresh: arg 1: expected native of type fyne.CanvasObject") + return env.NewError("Go(fyne.CanvasObject)//refresh: arg 1: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.CanvasObject)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//refresh: arg 1: expected native") + return env.NewError("Go(fyne.CanvasObject)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -136362,45 +135906,39 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//resize: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.CanvasObject)//resize: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//resize: arg 1: expected native of type fyne.CanvasObject") + return env.NewError("Go(fyne.CanvasObject)//resize: arg 1: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.CanvasObject)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//resize: arg 1: expected native") + return env.NewError("Go(fyne.CanvasObject)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.CanvasObject)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//resize: arg 2: expected native") + return env.NewError("Go(fyne.CanvasObject)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -136415,24 +135953,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//show: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.CanvasObject)//show: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//show: arg 1: expected native of type fyne.CanvasObject") + return env.NewError("Go(fyne.CanvasObject)//show: arg 1: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.CanvasObject)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//show: arg 1: expected native") + return env.NewError("Go(fyne.CanvasObject)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -136449,24 +135987,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//size: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.CanvasObject)//size: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//size: arg 1: expected native of type fyne.CanvasObject") + return env.NewError("Go(fyne.CanvasObject)//size: arg 1: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.CanvasObject)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//size: arg 1: expected native") + return env.NewError("Go(fyne.CanvasObject)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -136485,24 +136023,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//visible: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.CanvasObject)//visible: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//visible: arg 1: expected native of type fyne.CanvasObject") + return env.NewError("Go(fyne.CanvasObject)//visible: arg 1: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.CanvasObject)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.CanvasObject)//visible: arg 1: expected native") + return env.NewError("Go(fyne.CanvasObject)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -136521,24 +136059,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Clipboard(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Clipboard)//content: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Clipboard)//content: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Clipboard) - if !ok { + if vc, ok := v.Value.(fyne.Clipboard); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Clipboard)//content: arg 1: expected native of type fyne.Clipboard") + return env.NewError("Go(fyne.Clipboard)//content: arg 1: " + "expected native of type fyne.Clipboard, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Clipboard)//content: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Clipboard)//content: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Clipboard)//content: arg 1: expected native") + return env.NewError("Go(fyne.Clipboard)//content: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Content() var res0Obj env.Object @@ -136557,31 +136095,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Clipboard(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Clipboard)//set-content: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Clipboard)//set-content: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Clipboard) - if !ok { + if vc, ok := v.Value.(fyne.Clipboard); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Clipboard)//set-content: arg 1: expected native of type fyne.Clipboard") + return env.NewError("Go(fyne.Clipboard)//set-content: arg 1: " + "expected native of type fyne.Clipboard, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Clipboard)//set-content: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Clipboard)//set-content: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Clipboard)//set-content: arg 1: expected native") + return env.NewError("Go(fyne.Clipboard)//set-content: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Clipboard)//set-content: arg 2: expected string") + return env.NewError("Go(fyne.Clipboard)//set-content: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetContent(arg1Val) return arg0 @@ -136598,24 +136136,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CloudProvider(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProvider)//cleanup: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.CloudProvider)//cleanup: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CloudProvider) - if !ok { + if vc, ok := v.Value.(fyne.CloudProvider); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProvider)//cleanup: arg 1: expected native of type fyne.CloudProvider") + return env.NewError("Go(fyne.CloudProvider)//cleanup: arg 1: " + "expected native of type fyne.CloudProvider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProvider)//cleanup: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.CloudProvider)//cleanup: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProvider)//cleanup: arg 1: expected native") + return env.NewError("Go(fyne.CloudProvider)//cleanup: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.App switch v := arg1.(type) { @@ -136624,24 +136162,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_App(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProvider)//cleanup: arg 2: " + err.Error() + "") + return env.NewError("Go(fyne.CloudProvider)//cleanup: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.App) - if !ok { + if vc, ok := v.Value.(fyne.App); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProvider)//cleanup: arg 2: expected native of type fyne.App") + return env.NewError("Go(fyne.CloudProvider)//cleanup: arg 2: " + "expected native of type fyne.App, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProvider)//cleanup: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.CloudProvider)//cleanup: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProvider)//cleanup: arg 2: expected native") + return env.NewError("Go(fyne.CloudProvider)//cleanup: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Cleanup(arg1Val) return arg0 @@ -136658,24 +136196,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CloudProvider(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProvider)//provider-description: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.CloudProvider)//provider-description: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CloudProvider) - if !ok { + if vc, ok := v.Value.(fyne.CloudProvider); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProvider)//provider-description: arg 1: expected native of type fyne.CloudProvider") + return env.NewError("Go(fyne.CloudProvider)//provider-description: arg 1: " + "expected native of type fyne.CloudProvider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProvider)//provider-description: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.CloudProvider)//provider-description: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProvider)//provider-description: arg 1: expected native") + return env.NewError("Go(fyne.CloudProvider)//provider-description: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.ProviderDescription() var res0Obj env.Object @@ -136694,45 +136232,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CloudProvider(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProvider)//provider-icon: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.CloudProvider)//provider-icon: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CloudProvider) - if !ok { + if vc, ok := v.Value.(fyne.CloudProvider); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProvider)//provider-icon: arg 1: expected native of type fyne.CloudProvider") + return env.NewError("Go(fyne.CloudProvider)//provider-icon: arg 1: " + "expected native of type fyne.CloudProvider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProvider)//provider-icon: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.CloudProvider)//provider-icon: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProvider)//provider-icon: arg 1: expected native") + return env.NewError("Go(fyne.CloudProvider)//provider-icon: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.ProviderIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -136747,24 +136268,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CloudProvider(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProvider)//provider-name: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.CloudProvider)//provider-name: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CloudProvider) - if !ok { + if vc, ok := v.Value.(fyne.CloudProvider); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProvider)//provider-name: arg 1: expected native of type fyne.CloudProvider") + return env.NewError("Go(fyne.CloudProvider)//provider-name: arg 1: " + "expected native of type fyne.CloudProvider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProvider)//provider-name: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.CloudProvider)//provider-name: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProvider)//provider-name: arg 1: expected native") + return env.NewError("Go(fyne.CloudProvider)//provider-name: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.ProviderName() var res0Obj env.Object @@ -136783,24 +136304,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CloudProvider(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProvider)//setup: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.CloudProvider)//setup: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CloudProvider) - if !ok { + if vc, ok := v.Value.(fyne.CloudProvider); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProvider)//setup: arg 1: expected native of type fyne.CloudProvider") + return env.NewError("Go(fyne.CloudProvider)//setup: arg 1: " + "expected native of type fyne.CloudProvider, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProvider)//setup: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.CloudProvider)//setup: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProvider)//setup: arg 1: expected native") + return env.NewError("Go(fyne.CloudProvider)//setup: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.App switch v := arg1.(type) { @@ -136809,24 +136330,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_App(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProvider)//setup: arg 2: " + err.Error() + "") + return env.NewError("Go(fyne.CloudProvider)//setup: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.App) - if !ok { + if vc, ok := v.Value.(fyne.App); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProvider)//setup: arg 2: expected native of type fyne.App") + return env.NewError("Go(fyne.CloudProvider)//setup: arg 2: " + "expected native of type fyne.App, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProvider)//setup: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.CloudProvider)//setup: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProvider)//setup: arg 2: expected native") + return env.NewError("Go(fyne.CloudProvider)//setup: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Setup(arg1Val) var resErrObj env.Object @@ -136851,24 +136372,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CloudProviderPreferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProviderPreferences)//cloud-preferences: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.CloudProviderPreferences)//cloud-preferences: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CloudProviderPreferences) - if !ok { + if vc, ok := v.Value.(fyne.CloudProviderPreferences); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProviderPreferences)//cloud-preferences: arg 1: expected native of type fyne.CloudProviderPreferences") + return env.NewError("Go(fyne.CloudProviderPreferences)//cloud-preferences: arg 1: " + "expected native of type fyne.CloudProviderPreferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProviderPreferences)//cloud-preferences: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.CloudProviderPreferences)//cloud-preferences: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProviderPreferences)//cloud-preferences: arg 1: expected native") + return env.NewError("Go(fyne.CloudProviderPreferences)//cloud-preferences: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.App switch v := arg1.(type) { @@ -136877,45 +136398,28 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_App(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProviderPreferences)//cloud-preferences: arg 2: " + err.Error() + "") + return env.NewError("Go(fyne.CloudProviderPreferences)//cloud-preferences: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.App) - if !ok { + if vc, ok := v.Value.(fyne.App); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProviderPreferences)//cloud-preferences: arg 2: expected native of type fyne.App") + return env.NewError("Go(fyne.CloudProviderPreferences)//cloud-preferences: arg 2: " + "expected native of type fyne.App, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProviderPreferences)//cloud-preferences: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.CloudProviderPreferences)//cloud-preferences: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProviderPreferences)//cloud-preferences: arg 2: expected native") + return env.NewError("Go(fyne.CloudProviderPreferences)//cloud-preferences: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CloudPreferences(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Preferences)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Preferences)") return res0Obj }, }, @@ -136930,24 +136434,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CloudProviderStorage(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProviderStorage)//cloud-storage: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.CloudProviderStorage)//cloud-storage: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CloudProviderStorage) - if !ok { + if vc, ok := v.Value.(fyne.CloudProviderStorage); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProviderStorage)//cloud-storage: arg 1: expected native of type fyne.CloudProviderStorage") + return env.NewError("Go(fyne.CloudProviderStorage)//cloud-storage: arg 1: " + "expected native of type fyne.CloudProviderStorage, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProviderStorage)//cloud-storage: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.CloudProviderStorage)//cloud-storage: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProviderStorage)//cloud-storage: arg 1: expected native") + return env.NewError("Go(fyne.CloudProviderStorage)//cloud-storage: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.App switch v := arg1.(type) { @@ -136956,108 +136460,28 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_App(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProviderStorage)//cloud-storage: arg 2: " + err.Error() + "") + return env.NewError("Go(fyne.CloudProviderStorage)//cloud-storage: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.App) - if !ok { + if vc, ok := v.Value.(fyne.App); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProviderStorage)//cloud-storage: arg 2: expected native of type fyne.App") + return env.NewError("Go(fyne.CloudProviderStorage)//cloud-storage: arg 2: " + "expected native of type fyne.App, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProviderStorage)//cloud-storage: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.CloudProviderStorage)//cloud-storage: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.CloudProviderStorage)//cloud-storage: arg 2: expected native") + return env.NewError("Go(fyne.CloudProviderStorage)//cloud-storage: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CloudStorage(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Storage)") - } - } - return res0Obj - }, - }, - "Go(fyne.Delta)//components": { - Doc: "fyne.Delta.Components", - Argsn: 1, - Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var arg0Val *fyne.Delta - switch v := arg0.(type) { - case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Delta) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Delta)//components: arg 1: expected native of type *fyne.Delta") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(fyne.Delta)//components: arg 1: expected integer to be 0 or nil") - } - arg0Val = nil - default: - ps.FailureFlag = true - return env.NewError("Go(fyne.Delta)//components: arg 1: expected native") - } - res0, res1 := (*arg0Val).Components() - var res0Obj env.Object - res0Obj = *env.NewDecimal(float64(res0)) - var res1Obj env.Object - res1Obj = *env.NewDecimal(float64(res1)) - return *env.NewBlock(*env.NewTSeries([]env.Object{ - res0Obj, - res1Obj, - })) - }, - }, - "Go(fyne.Delta)//is-zero": { - Doc: "fyne.Delta.IsZero", - Argsn: 1, - Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var arg0Val *fyne.Delta - switch v := arg0.(type) { - case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Delta) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Delta)//is-zero: arg 1: expected native of type *fyne.Delta") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(fyne.Delta)//is-zero: arg 1: expected integer to be 0 or nil") - } - arg0Val = nil - default: - ps.FailureFlag = true - return env.NewError("Go(fyne.Delta)//is-zero: arg 1: expected native") - } - res0 := (*arg0Val).IsZero() - var res0Obj env.Object - res0Obj = *env.NewInteger(boolToInt64(res0)) + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Storage)") return res0Obj }, }, @@ -137072,24 +136496,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Device(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Device)//has-keyboard: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Device)//has-keyboard: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Device) - if !ok { + if vc, ok := v.Value.(fyne.Device); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Device)//has-keyboard: arg 1: expected native of type fyne.Device") + return env.NewError("Go(fyne.Device)//has-keyboard: arg 1: " + "expected native of type fyne.Device, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Device)//has-keyboard: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Device)//has-keyboard: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Device)//has-keyboard: arg 1: expected native") + return env.NewError("Go(fyne.Device)//has-keyboard: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.HasKeyboard() var res0Obj env.Object @@ -137108,24 +136532,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Device(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Device)//is-browser: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Device)//is-browser: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Device) - if !ok { + if vc, ok := v.Value.(fyne.Device); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Device)//is-browser: arg 1: expected native of type fyne.Device") + return env.NewError("Go(fyne.Device)//is-browser: arg 1: " + "expected native of type fyne.Device, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Device)//is-browser: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Device)//is-browser: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Device)//is-browser: arg 1: expected native") + return env.NewError("Go(fyne.Device)//is-browser: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.IsBrowser() var res0Obj env.Object @@ -137144,24 +136568,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Device(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Device)//is-mobile: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Device)//is-mobile: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Device) - if !ok { + if vc, ok := v.Value.(fyne.Device); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Device)//is-mobile: arg 1: expected native of type fyne.Device") + return env.NewError("Go(fyne.Device)//is-mobile: arg 1: " + "expected native of type fyne.Device, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Device)//is-mobile: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Device)//is-mobile: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Device)//is-mobile: arg 1: expected native") + return env.NewError("Go(fyne.Device)//is-mobile: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.IsMobile() var res0Obj env.Object @@ -137180,24 +136604,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Device(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Device)//orientation: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Device)//orientation: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Device) - if !ok { + if vc, ok := v.Value.(fyne.Device); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Device)//orientation: arg 1: expected native of type fyne.Device") + return env.NewError("Go(fyne.Device)//orientation: arg 1: " + "expected native of type fyne.Device, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Device)//orientation: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Device)//orientation: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Device)//orientation: arg 1: expected native") + return env.NewError("Go(fyne.Device)//orientation: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Orientation() var res0Obj env.Object @@ -137216,24 +136640,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Device(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Device)//system-scale-for-window: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Device)//system-scale-for-window: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Device) - if !ok { + if vc, ok := v.Value.(fyne.Device); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Device)//system-scale-for-window: arg 1: expected native of type fyne.Device") + return env.NewError("Go(fyne.Device)//system-scale-for-window: arg 1: " + "expected native of type fyne.Device, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Device)//system-scale-for-window: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Device)//system-scale-for-window: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Device)//system-scale-for-window: arg 1: expected native") + return env.NewError("Go(fyne.Device)//system-scale-for-window: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Window switch v := arg1.(type) { @@ -137242,24 +136666,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Device)//system-scale-for-window: arg 2: " + err.Error() + "") + return env.NewError("Go(fyne.Device)//system-scale-for-window: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Device)//system-scale-for-window: arg 2: expected native of type fyne.Window") + return env.NewError("Go(fyne.Device)//system-scale-for-window: arg 2: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Device)//system-scale-for-window: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Device)//system-scale-for-window: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Device)//system-scale-for-window: arg 2: expected native") + return env.NewError("Go(fyne.Device)//system-scale-for-window: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.SystemScaleForWindow(arg1Val) var res0Obj env.Object @@ -137278,24 +136702,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Disableable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Disableable)//disable: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Disableable)//disable: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Disableable) - if !ok { + if vc, ok := v.Value.(fyne.Disableable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Disableable)//disable: arg 1: expected native of type fyne.Disableable") + return env.NewError("Go(fyne.Disableable)//disable: arg 1: " + "expected native of type fyne.Disableable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Disableable)//disable: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Disableable)//disable: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Disableable)//disable: arg 1: expected native") + return env.NewError("Go(fyne.Disableable)//disable: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Disable() return arg0 @@ -137312,24 +136736,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Disableable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Disableable)//disabled: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Disableable)//disabled: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Disableable) - if !ok { + if vc, ok := v.Value.(fyne.Disableable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Disableable)//disabled: arg 1: expected native of type fyne.Disableable") + return env.NewError("Go(fyne.Disableable)//disabled: arg 1: " + "expected native of type fyne.Disableable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Disableable)//disabled: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Disableable)//disabled: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Disableable)//disabled: arg 1: expected native") + return env.NewError("Go(fyne.Disableable)//disabled: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Disabled() var res0Obj env.Object @@ -137348,24 +136772,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Disableable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Disableable)//enable: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Disableable)//enable: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Disableable) - if !ok { + if vc, ok := v.Value.(fyne.Disableable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Disableable)//enable: arg 1: expected native of type fyne.Disableable") + return env.NewError("Go(fyne.Disableable)//enable: arg 1: " + "expected native of type fyne.Disableable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Disableable)//enable: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Disableable)//enable: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Disableable)//enable: arg 1: expected native") + return env.NewError("Go(fyne.Disableable)//enable: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Enable() return arg0 @@ -137382,43 +136806,43 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_DoubleTappable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.DoubleTappable)//double-tapped: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.DoubleTappable)//double-tapped: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.DoubleTappable) - if !ok { + if vc, ok := v.Value.(fyne.DoubleTappable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.DoubleTappable)//double-tapped: arg 1: expected native of type fyne.DoubleTappable") + return env.NewError("Go(fyne.DoubleTappable)//double-tapped: arg 1: " + "expected native of type fyne.DoubleTappable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.DoubleTappable)//double-tapped: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.DoubleTappable)//double-tapped: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.DoubleTappable)//double-tapped: arg 1: expected native") + return env.NewError("Go(fyne.DoubleTappable)//double-tapped: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.PointEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.PointEvent) - if !ok { + if vc, ok := v.Value.(*fyne.PointEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.DoubleTappable)//double-tapped: arg 2: expected native of type *fyne.PointEvent") + return env.NewError("Go(fyne.DoubleTappable)//double-tapped: arg 2: " + "expected native of type *fyne.PointEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.DoubleTappable)//double-tapped: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.DoubleTappable)//double-tapped: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.DoubleTappable)//double-tapped: arg 2: expected native") + return env.NewError("Go(fyne.DoubleTappable)//double-tapped: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.DoubleTapped(arg1Val) return arg0 @@ -137435,24 +136859,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Draggable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Draggable)//drag-end: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Draggable)//drag-end: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Draggable) - if !ok { + if vc, ok := v.Value.(fyne.Draggable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Draggable)//drag-end: arg 1: expected native of type fyne.Draggable") + return env.NewError("Go(fyne.Draggable)//drag-end: arg 1: " + "expected native of type fyne.Draggable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Draggable)//drag-end: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Draggable)//drag-end: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Draggable)//drag-end: arg 1: expected native") + return env.NewError("Go(fyne.Draggable)//drag-end: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.DragEnd() return arg0 @@ -137469,43 +136893,43 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Draggable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Draggable)//dragged: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Draggable)//dragged: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Draggable) - if !ok { + if vc, ok := v.Value.(fyne.Draggable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Draggable)//dragged: arg 1: expected native of type fyne.Draggable") + return env.NewError("Go(fyne.Draggable)//dragged: arg 1: " + "expected native of type fyne.Draggable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Draggable)//dragged: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Draggable)//dragged: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Draggable)//dragged: arg 1: expected native") + return env.NewError("Go(fyne.Draggable)//dragged: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.DragEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.DragEvent) - if !ok { + if vc, ok := v.Value.(*fyne.DragEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Draggable)//dragged: arg 2: expected native of type *fyne.DragEvent") + return env.NewError("Go(fyne.Draggable)//dragged: arg 2: " + "expected native of type *fyne.DragEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Draggable)//dragged: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Draggable)//dragged: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Draggable)//dragged: arg 2: expected native") + return env.NewError("Go(fyne.Draggable)//dragged: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Dragged(arg1Val) return arg0 @@ -137522,24 +136946,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Driver(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//absolute-position-for-object: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Driver)//absolute-position-for-object: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Driver) - if !ok { + if vc, ok := v.Value.(fyne.Driver); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//absolute-position-for-object: arg 1: expected native of type fyne.Driver") + return env.NewError("Go(fyne.Driver)//absolute-position-for-object: arg 1: " + "expected native of type fyne.Driver, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//absolute-position-for-object: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Driver)//absolute-position-for-object: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//absolute-position-for-object: arg 1: expected native") + return env.NewError("Go(fyne.Driver)//absolute-position-for-object: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.CanvasObject switch v := arg1.(type) { @@ -137548,24 +136972,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//absolute-position-for-object: arg 2: " + err.Error() + "") + return env.NewError("Go(fyne.Driver)//absolute-position-for-object: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//absolute-position-for-object: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("Go(fyne.Driver)//absolute-position-for-object: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//absolute-position-for-object: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Driver)//absolute-position-for-object: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//absolute-position-for-object: arg 2: expected native") + return env.NewError("Go(fyne.Driver)//absolute-position-for-object: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.AbsolutePositionForObject(arg1Val) var res0Obj env.Object @@ -137584,48 +137008,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Driver(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//all-windows: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Driver)//all-windows: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Driver) - if !ok { + if vc, ok := v.Value.(fyne.Driver); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//all-windows: arg 1: expected native of type fyne.Driver") + return env.NewError("Go(fyne.Driver)//all-windows: arg 1: " + "expected native of type fyne.Driver, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//all-windows: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Driver)//all-windows: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//all-windows: arg 1: expected native") + return env.NewError("Go(fyne.Driver)//all-windows: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.AllWindows() var res0Obj env.Object { items := make([]env.Object, len(res0)) for i, it := range res0 { - { - typ := reflect.TypeOf(it) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - items[i] = *env.NewNative(ps.Idx, it, typRyeName) - } else { - items[i] = *env.NewNative(ps.Idx, it, "Go(fyne.Window)") - } - } + items[i] = ifaceToNative(ps.Idx, it, "Go(fyne.Window)") } res0Obj = *env.NewBlock(*env.NewTSeries(items)) } @@ -137643,24 +137050,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Driver(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//canvas-for-object: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Driver)//canvas-for-object: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Driver) - if !ok { + if vc, ok := v.Value.(fyne.Driver); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//canvas-for-object: arg 1: expected native of type fyne.Driver") + return env.NewError("Go(fyne.Driver)//canvas-for-object: arg 1: " + "expected native of type fyne.Driver, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//canvas-for-object: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Driver)//canvas-for-object: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//canvas-for-object: arg 1: expected native") + return env.NewError("Go(fyne.Driver)//canvas-for-object: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.CanvasObject switch v := arg1.(type) { @@ -137669,45 +137076,28 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//canvas-for-object: arg 2: " + err.Error() + "") + return env.NewError("Go(fyne.Driver)//canvas-for-object: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//canvas-for-object: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("Go(fyne.Driver)//canvas-for-object: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//canvas-for-object: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Driver)//canvas-for-object: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//canvas-for-object: arg 2: expected native") + return env.NewError("Go(fyne.Driver)//canvas-for-object: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CanvasForObject(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Canvas)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Canvas)") return res0Obj }, }, @@ -137722,52 +137112,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Driver(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//create-window: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Driver)//create-window: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Driver) - if !ok { + if vc, ok := v.Value.(fyne.Driver); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//create-window: arg 1: expected native of type fyne.Driver") + return env.NewError("Go(fyne.Driver)//create-window: arg 1: " + "expected native of type fyne.Driver, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//create-window: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Driver)//create-window: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//create-window: arg 1: expected native") + return env.NewError("Go(fyne.Driver)//create-window: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//create-window: arg 2: expected string") + return env.NewError("Go(fyne.Driver)//create-window: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := arg0Val.CreateWindow(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Window)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Window)") return res0Obj }, }, @@ -137782,45 +137155,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Driver(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//device: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Driver)//device: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Driver) - if !ok { + if vc, ok := v.Value.(fyne.Driver); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//device: arg 1: expected native of type fyne.Driver") + return env.NewError("Go(fyne.Driver)//device: arg 1: " + "expected native of type fyne.Driver, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//device: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Driver)//device: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//device: arg 1: expected native") + return env.NewError("Go(fyne.Driver)//device: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Device() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Device)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Device)") return res0Obj }, }, @@ -137835,24 +137191,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Driver(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//quit: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Driver)//quit: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Driver) - if !ok { + if vc, ok := v.Value.(fyne.Driver); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//quit: arg 1: expected native of type fyne.Driver") + return env.NewError("Go(fyne.Driver)//quit: arg 1: " + "expected native of type fyne.Driver, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//quit: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Driver)//quit: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//quit: arg 1: expected native") + return env.NewError("Go(fyne.Driver)//quit: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Quit() return arg0 @@ -137869,59 +137225,53 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Driver(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//rendered-text-size: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Driver)//rendered-text-size: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Driver) - if !ok { + if vc, ok := v.Value.(fyne.Driver); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//rendered-text-size: arg 1: expected native of type fyne.Driver") + return env.NewError("Go(fyne.Driver)//rendered-text-size: arg 1: " + "expected native of type fyne.Driver, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//rendered-text-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Driver)//rendered-text-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//rendered-text-size: arg 1: expected native") + return env.NewError("Go(fyne.Driver)//rendered-text-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//rendered-text-size: arg 2: expected string") + return env.NewError("Go(fyne.Driver)//rendered-text-size: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val float32 - if v, ok := arg2.(env.Decimal); ok { - arg2Val = float32(v.Value) + if vc, ok := arg2.(env.Decimal); ok { + arg2Val = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//rendered-text-size: arg 3: expected decimal") + return env.NewError("Go(fyne.Driver)//rendered-text-size: arg 3: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg2)) } - var arg3Val *fyne.TextStyle + var arg3Val fyne.TextStyle switch v := arg3.(type) { case env.Native: - var ok bool - arg3Val, ok = v.Value.(*fyne.TextStyle) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//rendered-text-size: arg 4: expected native of type *fyne.TextStyle") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.TextStyle); ok { + arg3Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//rendered-text-size: arg 4: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Driver)//rendered-text-size: arg 4: " + "expected native of type *fyne.TextStyle, but got " + objectDebugString(ps.Idx, v)) } - arg3Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//rendered-text-size: arg 4: expected native") + return env.NewError("Go(fyne.Driver)//rendered-text-size: arg 4: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - res0, res1 := arg0Val.RenderedTextSize(arg1Val, arg2Val, *arg3Val) + res0, res1 := arg0Val.RenderedTextSize(arg1Val, arg2Val, arg3Val) var res0Obj env.Object res0Obj = *env.NewNative(ps.Idx, &res0, "Go(*fyne.Size)") var res1Obj env.Object @@ -137943,24 +137293,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Driver(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//run: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Driver)//run: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Driver) - if !ok { + if vc, ok := v.Value.(fyne.Driver); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//run: arg 1: expected native of type fyne.Driver") + return env.NewError("Go(fyne.Driver)//run: arg 1: " + "expected native of type fyne.Driver, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//run: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Driver)//run: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//run: arg 1: expected native") + return env.NewError("Go(fyne.Driver)//run: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Run() return arg0 @@ -137977,43 +137327,43 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Driver(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//start-animation: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Driver)//start-animation: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Driver) - if !ok { + if vc, ok := v.Value.(fyne.Driver); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//start-animation: arg 1: expected native of type fyne.Driver") + return env.NewError("Go(fyne.Driver)//start-animation: arg 1: " + "expected native of type fyne.Driver, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//start-animation: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Driver)//start-animation: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//start-animation: arg 1: expected native") + return env.NewError("Go(fyne.Driver)//start-animation: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.Animation switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Animation) - if !ok { + if vc, ok := v.Value.(*fyne.Animation); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//start-animation: arg 2: expected native of type *fyne.Animation") + return env.NewError("Go(fyne.Driver)//start-animation: arg 2: " + "expected native of type *fyne.Animation, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//start-animation: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Driver)//start-animation: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//start-animation: arg 2: expected native") + return env.NewError("Go(fyne.Driver)//start-animation: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.StartAnimation(arg1Val) return arg0 @@ -138030,43 +137380,43 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Driver(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//stop-animation: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Driver)//stop-animation: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Driver) - if !ok { + if vc, ok := v.Value.(fyne.Driver); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//stop-animation: arg 1: expected native of type fyne.Driver") + return env.NewError("Go(fyne.Driver)//stop-animation: arg 1: " + "expected native of type fyne.Driver, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//stop-animation: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Driver)//stop-animation: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//stop-animation: arg 1: expected native") + return env.NewError("Go(fyne.Driver)//stop-animation: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.Animation switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Animation) - if !ok { + if vc, ok := v.Value.(*fyne.Animation); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//stop-animation: arg 2: expected native of type *fyne.Animation") + return env.NewError("Go(fyne.Driver)//stop-animation: arg 2: " + "expected native of type *fyne.Animation, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//stop-animation: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Driver)//stop-animation: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Driver)//stop-animation: arg 2: expected native") + return env.NewError("Go(fyne.Driver)//stop-animation: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.StopAnimation(arg1Val) return arg0 @@ -138083,24 +137433,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Focusable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Focusable)//focus-gained: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Focusable)//focus-gained: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Focusable) - if !ok { + if vc, ok := v.Value.(fyne.Focusable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Focusable)//focus-gained: arg 1: expected native of type fyne.Focusable") + return env.NewError("Go(fyne.Focusable)//focus-gained: arg 1: " + "expected native of type fyne.Focusable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Focusable)//focus-gained: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Focusable)//focus-gained: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Focusable)//focus-gained: arg 1: expected native") + return env.NewError("Go(fyne.Focusable)//focus-gained: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusGained() return arg0 @@ -138117,24 +137467,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Focusable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Focusable)//focus-lost: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Focusable)//focus-lost: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Focusable) - if !ok { + if vc, ok := v.Value.(fyne.Focusable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Focusable)//focus-lost: arg 1: expected native of type fyne.Focusable") + return env.NewError("Go(fyne.Focusable)//focus-lost: arg 1: " + "expected native of type fyne.Focusable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Focusable)//focus-lost: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Focusable)//focus-lost: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Focusable)//focus-lost: arg 1: expected native") + return env.NewError("Go(fyne.Focusable)//focus-lost: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusLost() return arg0 @@ -138151,43 +137501,43 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Focusable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Focusable)//typed-key: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Focusable)//typed-key: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Focusable) - if !ok { + if vc, ok := v.Value.(fyne.Focusable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Focusable)//typed-key: arg 1: expected native of type fyne.Focusable") + return env.NewError("Go(fyne.Focusable)//typed-key: arg 1: " + "expected native of type fyne.Focusable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Focusable)//typed-key: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Focusable)//typed-key: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Focusable)//typed-key: arg 1: expected native") + return env.NewError("Go(fyne.Focusable)//typed-key: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.KeyEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.KeyEvent) - if !ok { + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Focusable)//typed-key: arg 2: expected native of type *fyne.KeyEvent") + return env.NewError("Go(fyne.Focusable)//typed-key: arg 2: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Focusable)//typed-key: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Focusable)//typed-key: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Focusable)//typed-key: arg 2: expected native") + return env.NewError("Go(fyne.Focusable)//typed-key: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedKey(arg1Val) return arg0 @@ -138204,37 +137554,37 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Focusable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Focusable)//typed-rune: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Focusable)//typed-rune: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Focusable) - if !ok { + if vc, ok := v.Value.(fyne.Focusable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Focusable)//typed-rune: arg 1: expected native of type fyne.Focusable") + return env.NewError("Go(fyne.Focusable)//typed-rune: arg 1: " + "expected native of type fyne.Focusable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Focusable)//typed-rune: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Focusable)//typed-rune: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Focusable)//typed-rune: arg 1: expected native") + return env.NewError("Go(fyne.Focusable)//typed-rune: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val rune switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Focusable)//typed-rune: arg 2: expected native of type rune") + return env.NewError("Go(fyne.Focusable)//typed-rune: arg 2: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(fyne.Focusable)//typed-rune: arg 2: expected native") + return env.NewError("Go(fyne.Focusable)//typed-rune: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedRune(arg1Val) return arg0 @@ -138251,24 +137601,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_KeyboardShortcut(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.KeyboardShortcut)//key: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.KeyboardShortcut)//key: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.KeyboardShortcut) - if !ok { + if vc, ok := v.Value.(fyne.KeyboardShortcut); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.KeyboardShortcut)//key: arg 1: expected native of type fyne.KeyboardShortcut") + return env.NewError("Go(fyne.KeyboardShortcut)//key: arg 1: " + "expected native of type fyne.KeyboardShortcut, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.KeyboardShortcut)//key: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.KeyboardShortcut)//key: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.KeyboardShortcut)//key: arg 1: expected native") + return env.NewError("Go(fyne.KeyboardShortcut)//key: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Key() var res0Obj env.Object @@ -138287,24 +137637,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_KeyboardShortcut(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.KeyboardShortcut)//mod: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.KeyboardShortcut)//mod: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.KeyboardShortcut) - if !ok { + if vc, ok := v.Value.(fyne.KeyboardShortcut); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.KeyboardShortcut)//mod: arg 1: expected native of type fyne.KeyboardShortcut") + return env.NewError("Go(fyne.KeyboardShortcut)//mod: arg 1: " + "expected native of type fyne.KeyboardShortcut, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.KeyboardShortcut)//mod: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.KeyboardShortcut)//mod: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.KeyboardShortcut)//mod: arg 1: expected native") + return env.NewError("Go(fyne.KeyboardShortcut)//mod: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Mod() var res0Obj env.Object @@ -138323,24 +137673,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_KeyboardShortcut(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.KeyboardShortcut)//shortcut-name: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.KeyboardShortcut)//shortcut-name: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.KeyboardShortcut) - if !ok { + if vc, ok := v.Value.(fyne.KeyboardShortcut); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.KeyboardShortcut)//shortcut-name: arg 1: expected native of type fyne.KeyboardShortcut") + return env.NewError("Go(fyne.KeyboardShortcut)//shortcut-name: arg 1: " + "expected native of type fyne.KeyboardShortcut, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.KeyboardShortcut)//shortcut-name: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.KeyboardShortcut)//shortcut-name: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.KeyboardShortcut)//shortcut-name: arg 1: expected native") + return env.NewError("Go(fyne.KeyboardShortcut)//shortcut-name: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.ShortcutName() var res0Obj env.Object @@ -138359,24 +137709,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Layout(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Layout)//layout: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Layout)//layout: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Layout) - if !ok { + if vc, ok := v.Value.(fyne.Layout); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Layout)//layout: arg 1: expected native of type fyne.Layout") + return env.NewError("Go(fyne.Layout)//layout: arg 1: " + "expected native of type fyne.Layout, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Layout)//layout: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Layout)//layout: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Layout)//layout: arg 1: expected native") + return env.NewError("Go(fyne.Layout)//layout: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []fyne.CanvasObject switch v := arg1.(type) { @@ -138389,63 +137739,50 @@ var Builtins = map[string]*env.Builtin{ arg1Val[i], err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Layout)//layout: arg 2: block item: " + err.Error() + "") + return env.NewError("Go(fyne.Layout)//layout: arg 2: " + "block item: " + err.Error()) } case env.Native: - var ok bool - arg1Val[i], ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Layout)//layout: arg 2: block item: expected native of type fyne.CanvasObject") + return env.NewError("Go(fyne.Layout)//layout: arg 2: " + "block item: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Layout)//layout: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Layout)//layout: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val[i] = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Layout)//layout: arg 2: block item: expected native") + return env.NewError("Go(fyne.Layout)//layout: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]fyne.CanvasObject) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Layout)//layout: arg 2: expected native of type []fyne.CanvasObject") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Layout)//layout: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Layout)//layout: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Layout)//layout: arg 2: expected block, native or nil") + return env.NewError("Go(fyne.Layout)//layout: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } - var arg2Val *fyne.Size + var arg2Val fyne.Size switch v := arg2.(type) { case env.Native: - var ok bool - arg2Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Layout)//layout: arg 3: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg2Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Layout)//layout: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Layout)//layout: arg 3: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Layout)//layout: arg 3: expected native") + return env.NewError("Go(fyne.Layout)//layout: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Layout(arg1Val, *arg2Val) + arg0Val.Layout(arg1Val, arg2Val) return arg0 }, }, @@ -138460,24 +137797,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Layout(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Layout)//min-size: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Layout)//min-size: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Layout) - if !ok { + if vc, ok := v.Value.(fyne.Layout); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Layout)//min-size: arg 1: expected native of type fyne.Layout") + return env.NewError("Go(fyne.Layout)//min-size: arg 1: " + "expected native of type fyne.Layout, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Layout)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Layout)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Layout)//min-size: arg 1: expected native") + return env.NewError("Go(fyne.Layout)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []fyne.CanvasObject switch v := arg1.(type) { @@ -138490,42 +137827,35 @@ var Builtins = map[string]*env.Builtin{ arg1Val[i], err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Layout)//min-size: arg 2: block item: " + err.Error() + "") + return env.NewError("Go(fyne.Layout)//min-size: arg 2: " + "block item: " + err.Error()) } case env.Native: - var ok bool - arg1Val[i], ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Layout)//min-size: arg 2: block item: expected native of type fyne.CanvasObject") + return env.NewError("Go(fyne.Layout)//min-size: arg 2: " + "block item: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Layout)//min-size: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Layout)//min-size: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val[i] = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Layout)//min-size: arg 2: block item: expected native") + return env.NewError("Go(fyne.Layout)//min-size: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]fyne.CanvasObject) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Layout)//min-size: arg 2: expected native of type []fyne.CanvasObject") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Layout)//min-size: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Layout)//min-size: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Layout)//min-size: arg 2: expected block, native or nil") + return env.NewError("Go(fyne.Layout)//min-size: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize(arg1Val) var res0Obj env.Object @@ -138544,24 +137874,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_LegacyTheme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//background-color: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.LegacyTheme)//background-color: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.LegacyTheme) - if !ok { + if vc, ok := v.Value.(fyne.LegacyTheme); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//background-color: arg 1: expected native of type fyne.LegacyTheme") + return env.NewError("Go(fyne.LegacyTheme)//background-color: arg 1: " + "expected native of type fyne.LegacyTheme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//background-color: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.LegacyTheme)//background-color: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//background-color: arg 1: expected native") + return env.NewError("Go(fyne.LegacyTheme)//background-color: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.BackgroundColor() var res0Obj env.Object @@ -138580,24 +137910,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_LegacyTheme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//button-color: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.LegacyTheme)//button-color: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.LegacyTheme) - if !ok { + if vc, ok := v.Value.(fyne.LegacyTheme); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//button-color: arg 1: expected native of type fyne.LegacyTheme") + return env.NewError("Go(fyne.LegacyTheme)//button-color: arg 1: " + "expected native of type fyne.LegacyTheme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//button-color: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.LegacyTheme)//button-color: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//button-color: arg 1: expected native") + return env.NewError("Go(fyne.LegacyTheme)//button-color: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.ButtonColor() var res0Obj env.Object @@ -138616,24 +137946,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_LegacyTheme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//disabled-button-color: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.LegacyTheme)//disabled-button-color: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.LegacyTheme) - if !ok { + if vc, ok := v.Value.(fyne.LegacyTheme); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//disabled-button-color: arg 1: expected native of type fyne.LegacyTheme") + return env.NewError("Go(fyne.LegacyTheme)//disabled-button-color: arg 1: " + "expected native of type fyne.LegacyTheme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//disabled-button-color: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.LegacyTheme)//disabled-button-color: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//disabled-button-color: arg 1: expected native") + return env.NewError("Go(fyne.LegacyTheme)//disabled-button-color: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.DisabledButtonColor() var res0Obj env.Object @@ -138652,24 +137982,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_LegacyTheme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//disabled-text-color: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.LegacyTheme)//disabled-text-color: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.LegacyTheme) - if !ok { + if vc, ok := v.Value.(fyne.LegacyTheme); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//disabled-text-color: arg 1: expected native of type fyne.LegacyTheme") + return env.NewError("Go(fyne.LegacyTheme)//disabled-text-color: arg 1: " + "expected native of type fyne.LegacyTheme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//disabled-text-color: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.LegacyTheme)//disabled-text-color: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//disabled-text-color: arg 1: expected native") + return env.NewError("Go(fyne.LegacyTheme)//disabled-text-color: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.DisabledTextColor() var res0Obj env.Object @@ -138688,24 +138018,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_LegacyTheme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//focus-color: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.LegacyTheme)//focus-color: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.LegacyTheme) - if !ok { + if vc, ok := v.Value.(fyne.LegacyTheme); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//focus-color: arg 1: expected native of type fyne.LegacyTheme") + return env.NewError("Go(fyne.LegacyTheme)//focus-color: arg 1: " + "expected native of type fyne.LegacyTheme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//focus-color: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.LegacyTheme)//focus-color: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//focus-color: arg 1: expected native") + return env.NewError("Go(fyne.LegacyTheme)//focus-color: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.FocusColor() var res0Obj env.Object @@ -138724,24 +138054,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_LegacyTheme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//hover-color: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.LegacyTheme)//hover-color: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.LegacyTheme) - if !ok { + if vc, ok := v.Value.(fyne.LegacyTheme); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//hover-color: arg 1: expected native of type fyne.LegacyTheme") + return env.NewError("Go(fyne.LegacyTheme)//hover-color: arg 1: " + "expected native of type fyne.LegacyTheme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//hover-color: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.LegacyTheme)//hover-color: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//hover-color: arg 1: expected native") + return env.NewError("Go(fyne.LegacyTheme)//hover-color: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.HoverColor() var res0Obj env.Object @@ -138760,24 +138090,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_LegacyTheme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//icon-inline-size: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.LegacyTheme)//icon-inline-size: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.LegacyTheme) - if !ok { + if vc, ok := v.Value.(fyne.LegacyTheme); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//icon-inline-size: arg 1: expected native of type fyne.LegacyTheme") + return env.NewError("Go(fyne.LegacyTheme)//icon-inline-size: arg 1: " + "expected native of type fyne.LegacyTheme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//icon-inline-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.LegacyTheme)//icon-inline-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//icon-inline-size: arg 1: expected native") + return env.NewError("Go(fyne.LegacyTheme)//icon-inline-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.IconInlineSize() var res0Obj env.Object @@ -138796,24 +138126,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_LegacyTheme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//padding: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.LegacyTheme)//padding: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.LegacyTheme) - if !ok { + if vc, ok := v.Value.(fyne.LegacyTheme); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//padding: arg 1: expected native of type fyne.LegacyTheme") + return env.NewError("Go(fyne.LegacyTheme)//padding: arg 1: " + "expected native of type fyne.LegacyTheme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//padding: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.LegacyTheme)//padding: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//padding: arg 1: expected native") + return env.NewError("Go(fyne.LegacyTheme)//padding: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Padding() var res0Obj env.Object @@ -138832,24 +138162,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_LegacyTheme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//place-holder-color: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.LegacyTheme)//place-holder-color: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.LegacyTheme) - if !ok { + if vc, ok := v.Value.(fyne.LegacyTheme); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//place-holder-color: arg 1: expected native of type fyne.LegacyTheme") + return env.NewError("Go(fyne.LegacyTheme)//place-holder-color: arg 1: " + "expected native of type fyne.LegacyTheme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//place-holder-color: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.LegacyTheme)//place-holder-color: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//place-holder-color: arg 1: expected native") + return env.NewError("Go(fyne.LegacyTheme)//place-holder-color: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.PlaceHolderColor() var res0Obj env.Object @@ -138868,24 +138198,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_LegacyTheme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//primary-color: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.LegacyTheme)//primary-color: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.LegacyTheme) - if !ok { + if vc, ok := v.Value.(fyne.LegacyTheme); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//primary-color: arg 1: expected native of type fyne.LegacyTheme") + return env.NewError("Go(fyne.LegacyTheme)//primary-color: arg 1: " + "expected native of type fyne.LegacyTheme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//primary-color: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.LegacyTheme)//primary-color: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//primary-color: arg 1: expected native") + return env.NewError("Go(fyne.LegacyTheme)//primary-color: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.PrimaryColor() var res0Obj env.Object @@ -138904,24 +138234,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_LegacyTheme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//scroll-bar-color: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.LegacyTheme)//scroll-bar-color: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.LegacyTheme) - if !ok { + if vc, ok := v.Value.(fyne.LegacyTheme); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//scroll-bar-color: arg 1: expected native of type fyne.LegacyTheme") + return env.NewError("Go(fyne.LegacyTheme)//scroll-bar-color: arg 1: " + "expected native of type fyne.LegacyTheme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//scroll-bar-color: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.LegacyTheme)//scroll-bar-color: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//scroll-bar-color: arg 1: expected native") + return env.NewError("Go(fyne.LegacyTheme)//scroll-bar-color: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.ScrollBarColor() var res0Obj env.Object @@ -138940,24 +138270,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_LegacyTheme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//scroll-bar-size: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.LegacyTheme)//scroll-bar-size: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.LegacyTheme) - if !ok { + if vc, ok := v.Value.(fyne.LegacyTheme); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//scroll-bar-size: arg 1: expected native of type fyne.LegacyTheme") + return env.NewError("Go(fyne.LegacyTheme)//scroll-bar-size: arg 1: " + "expected native of type fyne.LegacyTheme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//scroll-bar-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.LegacyTheme)//scroll-bar-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//scroll-bar-size: arg 1: expected native") + return env.NewError("Go(fyne.LegacyTheme)//scroll-bar-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.ScrollBarSize() var res0Obj env.Object @@ -138976,24 +138306,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_LegacyTheme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//scroll-bar-small-size: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.LegacyTheme)//scroll-bar-small-size: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.LegacyTheme) - if !ok { + if vc, ok := v.Value.(fyne.LegacyTheme); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//scroll-bar-small-size: arg 1: expected native of type fyne.LegacyTheme") + return env.NewError("Go(fyne.LegacyTheme)//scroll-bar-small-size: arg 1: " + "expected native of type fyne.LegacyTheme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//scroll-bar-small-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.LegacyTheme)//scroll-bar-small-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//scroll-bar-small-size: arg 1: expected native") + return env.NewError("Go(fyne.LegacyTheme)//scroll-bar-small-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.ScrollBarSmallSize() var res0Obj env.Object @@ -139012,24 +138342,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_LegacyTheme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//shadow-color: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.LegacyTheme)//shadow-color: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.LegacyTheme) - if !ok { + if vc, ok := v.Value.(fyne.LegacyTheme); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//shadow-color: arg 1: expected native of type fyne.LegacyTheme") + return env.NewError("Go(fyne.LegacyTheme)//shadow-color: arg 1: " + "expected native of type fyne.LegacyTheme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//shadow-color: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.LegacyTheme)//shadow-color: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//shadow-color: arg 1: expected native") + return env.NewError("Go(fyne.LegacyTheme)//shadow-color: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.ShadowColor() var res0Obj env.Object @@ -139048,45 +138378,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_LegacyTheme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//text-bold-font: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.LegacyTheme)//text-bold-font: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.LegacyTheme) - if !ok { + if vc, ok := v.Value.(fyne.LegacyTheme); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//text-bold-font: arg 1: expected native of type fyne.LegacyTheme") + return env.NewError("Go(fyne.LegacyTheme)//text-bold-font: arg 1: " + "expected native of type fyne.LegacyTheme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//text-bold-font: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.LegacyTheme)//text-bold-font: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//text-bold-font: arg 1: expected native") + return env.NewError("Go(fyne.LegacyTheme)//text-bold-font: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.TextBoldFont() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -139101,45 +138414,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_LegacyTheme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//text-bold-italic-font: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.LegacyTheme)//text-bold-italic-font: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.LegacyTheme) - if !ok { + if vc, ok := v.Value.(fyne.LegacyTheme); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//text-bold-italic-font: arg 1: expected native of type fyne.LegacyTheme") + return env.NewError("Go(fyne.LegacyTheme)//text-bold-italic-font: arg 1: " + "expected native of type fyne.LegacyTheme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//text-bold-italic-font: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.LegacyTheme)//text-bold-italic-font: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//text-bold-italic-font: arg 1: expected native") + return env.NewError("Go(fyne.LegacyTheme)//text-bold-italic-font: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.TextBoldItalicFont() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -139154,24 +138450,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_LegacyTheme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//text-color: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.LegacyTheme)//text-color: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.LegacyTheme) - if !ok { + if vc, ok := v.Value.(fyne.LegacyTheme); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//text-color: arg 1: expected native of type fyne.LegacyTheme") + return env.NewError("Go(fyne.LegacyTheme)//text-color: arg 1: " + "expected native of type fyne.LegacyTheme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//text-color: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.LegacyTheme)//text-color: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//text-color: arg 1: expected native") + return env.NewError("Go(fyne.LegacyTheme)//text-color: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.TextColor() var res0Obj env.Object @@ -139190,45 +138486,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_LegacyTheme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//text-font: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.LegacyTheme)//text-font: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.LegacyTheme) - if !ok { + if vc, ok := v.Value.(fyne.LegacyTheme); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//text-font: arg 1: expected native of type fyne.LegacyTheme") + return env.NewError("Go(fyne.LegacyTheme)//text-font: arg 1: " + "expected native of type fyne.LegacyTheme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//text-font: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.LegacyTheme)//text-font: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//text-font: arg 1: expected native") + return env.NewError("Go(fyne.LegacyTheme)//text-font: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.TextFont() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -139243,45 +138522,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_LegacyTheme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//text-italic-font: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.LegacyTheme)//text-italic-font: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.LegacyTheme) - if !ok { + if vc, ok := v.Value.(fyne.LegacyTheme); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//text-italic-font: arg 1: expected native of type fyne.LegacyTheme") + return env.NewError("Go(fyne.LegacyTheme)//text-italic-font: arg 1: " + "expected native of type fyne.LegacyTheme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//text-italic-font: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.LegacyTheme)//text-italic-font: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//text-italic-font: arg 1: expected native") + return env.NewError("Go(fyne.LegacyTheme)//text-italic-font: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.TextItalicFont() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -139296,45 +138558,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_LegacyTheme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//text-monospace-font: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.LegacyTheme)//text-monospace-font: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.LegacyTheme) - if !ok { + if vc, ok := v.Value.(fyne.LegacyTheme); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//text-monospace-font: arg 1: expected native of type fyne.LegacyTheme") + return env.NewError("Go(fyne.LegacyTheme)//text-monospace-font: arg 1: " + "expected native of type fyne.LegacyTheme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//text-monospace-font: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.LegacyTheme)//text-monospace-font: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//text-monospace-font: arg 1: expected native") + return env.NewError("Go(fyne.LegacyTheme)//text-monospace-font: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.TextMonospaceFont() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -139349,24 +138594,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_LegacyTheme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//text-size: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.LegacyTheme)//text-size: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.LegacyTheme) - if !ok { + if vc, ok := v.Value.(fyne.LegacyTheme); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//text-size: arg 1: expected native of type fyne.LegacyTheme") + return env.NewError("Go(fyne.LegacyTheme)//text-size: arg 1: " + "expected native of type fyne.LegacyTheme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//text-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.LegacyTheme)//text-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.LegacyTheme)//text-size: arg 1: expected native") + return env.NewError("Go(fyne.LegacyTheme)//text-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.TextSize() var res0Obj env.Object @@ -139385,31 +138630,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Lifecycle(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Lifecycle)//set-on-entered-foreground: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Lifecycle)//set-on-entered-foreground: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Lifecycle) - if !ok { + if vc, ok := v.Value.(fyne.Lifecycle); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Lifecycle)//set-on-entered-foreground: arg 1: expected native of type fyne.Lifecycle") + return env.NewError("Go(fyne.Lifecycle)//set-on-entered-foreground: arg 1: " + "expected native of type fyne.Lifecycle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Lifecycle)//set-on-entered-foreground: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Lifecycle)//set-on-entered-foreground: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Lifecycle)//set-on-entered-foreground: arg 1: expected native") + return env.NewError("Go(fyne.Lifecycle)//set-on-entered-foreground: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func() switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Lifecycle)//set-on-entered-foreground: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(fyne.Lifecycle)//set-on-entered-foreground: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } arg1Val = func() { actualFn := fn @@ -139419,12 +138664,12 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Lifecycle)//set-on-entered-foreground: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Lifecycle)//set-on-entered-foreground: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Lifecycle)//set-on-entered-foreground: arg 2: expected function or nil") + return env.NewError("Go(fyne.Lifecycle)//set-on-entered-foreground: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } arg0Val.SetOnEnteredForeground(arg1Val) return arg0 @@ -139441,31 +138686,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Lifecycle(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Lifecycle)//set-on-exited-foreground: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Lifecycle)//set-on-exited-foreground: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Lifecycle) - if !ok { + if vc, ok := v.Value.(fyne.Lifecycle); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Lifecycle)//set-on-exited-foreground: arg 1: expected native of type fyne.Lifecycle") + return env.NewError("Go(fyne.Lifecycle)//set-on-exited-foreground: arg 1: " + "expected native of type fyne.Lifecycle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Lifecycle)//set-on-exited-foreground: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Lifecycle)//set-on-exited-foreground: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Lifecycle)//set-on-exited-foreground: arg 1: expected native") + return env.NewError("Go(fyne.Lifecycle)//set-on-exited-foreground: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func() switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Lifecycle)//set-on-exited-foreground: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(fyne.Lifecycle)//set-on-exited-foreground: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } arg1Val = func() { actualFn := fn @@ -139475,12 +138720,12 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Lifecycle)//set-on-exited-foreground: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Lifecycle)//set-on-exited-foreground: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Lifecycle)//set-on-exited-foreground: arg 2: expected function or nil") + return env.NewError("Go(fyne.Lifecycle)//set-on-exited-foreground: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } arg0Val.SetOnExitedForeground(arg1Val) return arg0 @@ -139497,31 +138742,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Lifecycle(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Lifecycle)//set-on-started: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Lifecycle)//set-on-started: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Lifecycle) - if !ok { + if vc, ok := v.Value.(fyne.Lifecycle); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Lifecycle)//set-on-started: arg 1: expected native of type fyne.Lifecycle") + return env.NewError("Go(fyne.Lifecycle)//set-on-started: arg 1: " + "expected native of type fyne.Lifecycle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Lifecycle)//set-on-started: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Lifecycle)//set-on-started: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Lifecycle)//set-on-started: arg 1: expected native") + return env.NewError("Go(fyne.Lifecycle)//set-on-started: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func() switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Lifecycle)//set-on-started: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(fyne.Lifecycle)//set-on-started: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } arg1Val = func() { actualFn := fn @@ -139531,12 +138776,12 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Lifecycle)//set-on-started: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Lifecycle)//set-on-started: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Lifecycle)//set-on-started: arg 2: expected function or nil") + return env.NewError("Go(fyne.Lifecycle)//set-on-started: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } arg0Val.SetOnStarted(arg1Val) return arg0 @@ -139553,31 +138798,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Lifecycle(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Lifecycle)//set-on-stopped: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Lifecycle)//set-on-stopped: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Lifecycle) - if !ok { + if vc, ok := v.Value.(fyne.Lifecycle); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Lifecycle)//set-on-stopped: arg 1: expected native of type fyne.Lifecycle") + return env.NewError("Go(fyne.Lifecycle)//set-on-stopped: arg 1: " + "expected native of type fyne.Lifecycle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Lifecycle)//set-on-stopped: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Lifecycle)//set-on-stopped: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Lifecycle)//set-on-stopped: arg 1: expected native") + return env.NewError("Go(fyne.Lifecycle)//set-on-stopped: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func() switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Lifecycle)//set-on-stopped: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(fyne.Lifecycle)//set-on-stopped: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } arg1Val = func() { actualFn := fn @@ -139587,12 +138832,12 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Lifecycle)//set-on-stopped: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Lifecycle)//set-on-stopped: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Lifecycle)//set-on-stopped: arg 2: expected function or nil") + return env.NewError("Go(fyne.Lifecycle)//set-on-stopped: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } arg0Val.SetOnStopped(arg1Val) return arg0 @@ -139609,24 +138854,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_ListableURI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//authority: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.ListableURI)//authority: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.ListableURI) - if !ok { + if vc, ok := v.Value.(fyne.ListableURI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//authority: arg 1: expected native of type fyne.ListableURI") + return env.NewError("Go(fyne.ListableURI)//authority: arg 1: " + "expected native of type fyne.ListableURI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//authority: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.ListableURI)//authority: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//authority: arg 1: expected native") + return env.NewError("Go(fyne.ListableURI)//authority: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Authority() var res0Obj env.Object @@ -139645,24 +138890,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_ListableURI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//extension: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.ListableURI)//extension: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.ListableURI) - if !ok { + if vc, ok := v.Value.(fyne.ListableURI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//extension: arg 1: expected native of type fyne.ListableURI") + return env.NewError("Go(fyne.ListableURI)//extension: arg 1: " + "expected native of type fyne.ListableURI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//extension: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.ListableURI)//extension: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//extension: arg 1: expected native") + return env.NewError("Go(fyne.ListableURI)//extension: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Extension() var res0Obj env.Object @@ -139681,24 +138926,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_ListableURI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//fragment: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.ListableURI)//fragment: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.ListableURI) - if !ok { + if vc, ok := v.Value.(fyne.ListableURI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//fragment: arg 1: expected native of type fyne.ListableURI") + return env.NewError("Go(fyne.ListableURI)//fragment: arg 1: " + "expected native of type fyne.ListableURI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//fragment: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.ListableURI)//fragment: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//fragment: arg 1: expected native") + return env.NewError("Go(fyne.ListableURI)//fragment: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Fragment() var res0Obj env.Object @@ -139717,48 +138962,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_ListableURI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//list: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.ListableURI)//list: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.ListableURI) - if !ok { + if vc, ok := v.Value.(fyne.ListableURI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//list: arg 1: expected native of type fyne.ListableURI") + return env.NewError("Go(fyne.ListableURI)//list: arg 1: " + "expected native of type fyne.ListableURI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//list: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.ListableURI)//list: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//list: arg 1: expected native") + return env.NewError("Go(fyne.ListableURI)//list: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.List() var res0Obj env.Object { items := make([]env.Object, len(res0)) for i, it := range res0 { - { - typ := reflect.TypeOf(it) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - items[i] = *env.NewNative(ps.Idx, it, typRyeName) - } else { - items[i] = *env.NewNative(ps.Idx, it, "Go(fyne.URI)") - } - } + items[i] = ifaceToNative(ps.Idx, it, "Go(fyne.URI)") } res0Obj = *env.NewBlock(*env.NewTSeries(items)) } @@ -139784,24 +139012,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_ListableURI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//mime-type: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.ListableURI)//mime-type: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.ListableURI) - if !ok { + if vc, ok := v.Value.(fyne.ListableURI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//mime-type: arg 1: expected native of type fyne.ListableURI") + return env.NewError("Go(fyne.ListableURI)//mime-type: arg 1: " + "expected native of type fyne.ListableURI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//mime-type: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.ListableURI)//mime-type: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//mime-type: arg 1: expected native") + return env.NewError("Go(fyne.ListableURI)//mime-type: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MimeType() var res0Obj env.Object @@ -139820,24 +139048,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_ListableURI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//name: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.ListableURI)//name: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.ListableURI) - if !ok { + if vc, ok := v.Value.(fyne.ListableURI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//name: arg 1: expected native of type fyne.ListableURI") + return env.NewError("Go(fyne.ListableURI)//name: arg 1: " + "expected native of type fyne.ListableURI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//name: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.ListableURI)//name: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//name: arg 1: expected native") + return env.NewError("Go(fyne.ListableURI)//name: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Name() var res0Obj env.Object @@ -139856,24 +139084,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_ListableURI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//path: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.ListableURI)//path: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.ListableURI) - if !ok { + if vc, ok := v.Value.(fyne.ListableURI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//path: arg 1: expected native of type fyne.ListableURI") + return env.NewError("Go(fyne.ListableURI)//path: arg 1: " + "expected native of type fyne.ListableURI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//path: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.ListableURI)//path: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//path: arg 1: expected native") + return env.NewError("Go(fyne.ListableURI)//path: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Path() var res0Obj env.Object @@ -139892,24 +139120,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_ListableURI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//query: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.ListableURI)//query: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.ListableURI) - if !ok { + if vc, ok := v.Value.(fyne.ListableURI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//query: arg 1: expected native of type fyne.ListableURI") + return env.NewError("Go(fyne.ListableURI)//query: arg 1: " + "expected native of type fyne.ListableURI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//query: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.ListableURI)//query: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//query: arg 1: expected native") + return env.NewError("Go(fyne.ListableURI)//query: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Query() var res0Obj env.Object @@ -139928,24 +139156,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_ListableURI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//scheme: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.ListableURI)//scheme: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.ListableURI) - if !ok { + if vc, ok := v.Value.(fyne.ListableURI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//scheme: arg 1: expected native of type fyne.ListableURI") + return env.NewError("Go(fyne.ListableURI)//scheme: arg 1: " + "expected native of type fyne.ListableURI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//scheme: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.ListableURI)//scheme: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//scheme: arg 1: expected native") + return env.NewError("Go(fyne.ListableURI)//scheme: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Scheme() var res0Obj env.Object @@ -139964,24 +139192,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_ListableURI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//string: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.ListableURI)//string: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.ListableURI) - if !ok { + if vc, ok := v.Value.(fyne.ListableURI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//string: arg 1: expected native of type fyne.ListableURI") + return env.NewError("Go(fyne.ListableURI)//string: arg 1: " + "expected native of type fyne.ListableURI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//string: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.ListableURI)//string: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.ListableURI)//string: arg 1: expected native") + return env.NewError("Go(fyne.ListableURI)//string: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.String() var res0Obj env.Object @@ -140000,24 +139228,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_OverlayStack(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.OverlayStack)//add: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.OverlayStack)//add: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.OverlayStack) - if !ok { + if vc, ok := v.Value.(fyne.OverlayStack); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.OverlayStack)//add: arg 1: expected native of type fyne.OverlayStack") + return env.NewError("Go(fyne.OverlayStack)//add: arg 1: " + "expected native of type fyne.OverlayStack, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.OverlayStack)//add: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.OverlayStack)//add: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.OverlayStack)//add: arg 1: expected native") + return env.NewError("Go(fyne.OverlayStack)//add: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.CanvasObject switch v := arg1.(type) { @@ -140026,24 +139254,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.OverlayStack)//add: arg 2: " + err.Error() + "") + return env.NewError("Go(fyne.OverlayStack)//add: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.OverlayStack)//add: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("Go(fyne.OverlayStack)//add: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.OverlayStack)//add: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.OverlayStack)//add: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.OverlayStack)//add: arg 2: expected native") + return env.NewError("Go(fyne.OverlayStack)//add: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Add(arg1Val) return arg0 @@ -140060,48 +139288,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_OverlayStack(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.OverlayStack)//list: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.OverlayStack)//list: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.OverlayStack) - if !ok { + if vc, ok := v.Value.(fyne.OverlayStack); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.OverlayStack)//list: arg 1: expected native of type fyne.OverlayStack") + return env.NewError("Go(fyne.OverlayStack)//list: arg 1: " + "expected native of type fyne.OverlayStack, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.OverlayStack)//list: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.OverlayStack)//list: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.OverlayStack)//list: arg 1: expected native") + return env.NewError("Go(fyne.OverlayStack)//list: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.List() var res0Obj env.Object { items := make([]env.Object, len(res0)) for i, it := range res0 { - { - typ := reflect.TypeOf(it) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - items[i] = *env.NewNative(ps.Idx, it, typRyeName) - } else { - items[i] = *env.NewNative(ps.Idx, it, "Go(fyne.CanvasObject)") - } - } + items[i] = ifaceToNative(ps.Idx, it, "Go(fyne.CanvasObject)") } res0Obj = *env.NewBlock(*env.NewTSeries(items)) } @@ -140119,24 +139330,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_OverlayStack(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.OverlayStack)//remove: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.OverlayStack)//remove: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.OverlayStack) - if !ok { + if vc, ok := v.Value.(fyne.OverlayStack); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.OverlayStack)//remove: arg 1: expected native of type fyne.OverlayStack") + return env.NewError("Go(fyne.OverlayStack)//remove: arg 1: " + "expected native of type fyne.OverlayStack, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.OverlayStack)//remove: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.OverlayStack)//remove: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.OverlayStack)//remove: arg 1: expected native") + return env.NewError("Go(fyne.OverlayStack)//remove: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.CanvasObject switch v := arg1.(type) { @@ -140145,24 +139356,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.OverlayStack)//remove: arg 2: " + err.Error() + "") + return env.NewError("Go(fyne.OverlayStack)//remove: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.OverlayStack)//remove: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("Go(fyne.OverlayStack)//remove: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.OverlayStack)//remove: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.OverlayStack)//remove: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.OverlayStack)//remove: arg 2: expected native") + return env.NewError("Go(fyne.OverlayStack)//remove: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Remove(arg1Val) return arg0 @@ -140179,304 +139390,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_OverlayStack(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.OverlayStack)//top: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.OverlayStack)//top: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.OverlayStack) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.OverlayStack)//top: arg 1: expected native of type fyne.OverlayStack") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(fyne.OverlayStack)//top: arg 1: expected integer to be 0 or nil") - } - arg0Val = nil - default: - ps.FailureFlag = true - return env.NewError("Go(fyne.OverlayStack)//top: arg 1: expected native") - } - res0 := arg0Val.Top() - var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) + if vc, ok := v.Value.(fyne.OverlayStack); ok { + arg0Val = vc } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.CanvasObject)") - } - } - return res0Obj - }, - }, - "Go(fyne.Position)//add": { - Doc: "fyne.Position.Add", - Argsn: 2, - Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var arg0Val *fyne.Position - switch v := arg0.(type) { - case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Position) - if !ok { ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//add: arg 1: expected native of type *fyne.Position") + return env.NewError("Go(fyne.OverlayStack)//top: arg 1: " + "expected native of type fyne.OverlayStack, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//add: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.OverlayStack)//top: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//add: arg 1: expected native") - } - var arg1Val fyne.Vector2 - switch v := arg1.(type) { - case env.RyeCtx: - var err error - arg1Val, err = ctxTo_fyne_Vector2(ps, v) - if err != nil { - ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//add: arg 2: " + err.Error() + "") - } - case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Vector2) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//add: arg 2: expected native of type fyne.Vector2") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//add: arg 2: expected integer to be 0 or nil") - } - arg1Val = nil - default: - ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//add: arg 2: expected native") + return env.NewError("Go(fyne.OverlayStack)//top: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - res0 := (*arg0Val).Add(arg1Val) - var res0Obj env.Object - res0Obj = *env.NewNative(ps.Idx, &res0, "Go(*fyne.Position)") - return res0Obj - }, - }, - "Go(fyne.Position)//add-xy": { - Doc: "fyne.Position.AddXY", - Argsn: 3, - Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var arg0Val *fyne.Position - switch v := arg0.(type) { - case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//add-xy: arg 1: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//add-xy: arg 1: expected integer to be 0 or nil") - } - arg0Val = nil - default: - ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//add-xy: arg 1: expected native") - } - var arg1Val float32 - if v, ok := arg1.(env.Decimal); ok { - arg1Val = float32(v.Value) - } else { - ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//add-xy: arg 2: expected decimal") - } - var arg2Val float32 - if v, ok := arg2.(env.Decimal); ok { - arg2Val = float32(v.Value) - } else { - ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//add-xy: arg 3: expected decimal") - } - res0 := (*arg0Val).AddXY(arg1Val, arg2Val) - var res0Obj env.Object - res0Obj = *env.NewNative(ps.Idx, &res0, "Go(*fyne.Position)") - return res0Obj - }, - }, - "Go(fyne.Position)//components": { - Doc: "fyne.Position.Components", - Argsn: 1, - Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var arg0Val *fyne.Position - switch v := arg0.(type) { - case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//components: arg 1: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//components: arg 1: expected integer to be 0 or nil") - } - arg0Val = nil - default: - ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//components: arg 1: expected native") - } - res0, res1 := (*arg0Val).Components() - var res0Obj env.Object - res0Obj = *env.NewDecimal(float64(res0)) - var res1Obj env.Object - res1Obj = *env.NewDecimal(float64(res1)) - return *env.NewBlock(*env.NewTSeries([]env.Object{ - res0Obj, - res1Obj, - })) - }, - }, - "Go(fyne.Position)//is-zero": { - Doc: "fyne.Position.IsZero", - Argsn: 1, - Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var arg0Val *fyne.Position - switch v := arg0.(type) { - case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//is-zero: arg 1: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//is-zero: arg 1: expected integer to be 0 or nil") - } - arg0Val = nil - default: - ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//is-zero: arg 1: expected native") - } - res0 := (*arg0Val).IsZero() - var res0Obj env.Object - res0Obj = *env.NewInteger(boolToInt64(res0)) - return res0Obj - }, - }, - "Go(fyne.Position)//subtract": { - Doc: "fyne.Position.Subtract", - Argsn: 2, - Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var arg0Val *fyne.Position - switch v := arg0.(type) { - case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//subtract: arg 1: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//subtract: arg 1: expected integer to be 0 or nil") - } - arg0Val = nil - default: - ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//subtract: arg 1: expected native") - } - var arg1Val fyne.Vector2 - switch v := arg1.(type) { - case env.RyeCtx: - var err error - arg1Val, err = ctxTo_fyne_Vector2(ps, v) - if err != nil { - ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//subtract: arg 2: " + err.Error() + "") - } - case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Vector2) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//subtract: arg 2: expected native of type fyne.Vector2") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//subtract: arg 2: expected integer to be 0 or nil") - } - arg1Val = nil - default: - ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//subtract: arg 2: expected native") - } - res0 := (*arg0Val).Subtract(arg1Val) - var res0Obj env.Object - res0Obj = *env.NewNative(ps.Idx, &res0, "Go(*fyne.Position)") - return res0Obj - }, - }, - "Go(fyne.Position)//subtract-xy": { - Doc: "fyne.Position.SubtractXY", - Argsn: 3, - Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var arg0Val *fyne.Position - switch v := arg0.(type) { - case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//subtract-xy: arg 1: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//subtract-xy: arg 1: expected integer to be 0 or nil") - } - arg0Val = nil - default: - ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//subtract-xy: arg 1: expected native") - } - var arg1Val float32 - if v, ok := arg1.(env.Decimal); ok { - arg1Val = float32(v.Value) - } else { - ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//subtract-xy: arg 2: expected decimal") - } - var arg2Val float32 - if v, ok := arg2.(env.Decimal); ok { - arg2Val = float32(v.Value) - } else { - ps.FailureFlag = true - return env.NewError("Go(fyne.Position)//subtract-xy: arg 3: expected decimal") - } - res0 := (*arg0Val).SubtractXY(arg1Val, arg2Val) + res0 := arg0Val.Top() var res0Obj env.Object - res0Obj = *env.NewNative(ps.Idx, &res0, "Go(*fyne.Position)") + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.CanvasObject)") return res0Obj }, }, @@ -140491,31 +139426,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//add-change-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Preferences)//add-change-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//add-change-listener: arg 1: expected native of type fyne.Preferences") + return env.NewError("Go(fyne.Preferences)//add-change-listener: arg 1: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//add-change-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//add-change-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//add-change-listener: arg 1: expected native") + return env.NewError("Go(fyne.Preferences)//add-change-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func() switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//add-change-listener: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(fyne.Preferences)//add-change-listener: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } arg1Val = func() { actualFn := fn @@ -140525,12 +139460,12 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//add-change-listener: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//add-change-listener: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//add-change-listener: arg 2: expected function or nil") + return env.NewError("Go(fyne.Preferences)//add-change-listener: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } arg0Val.AddChangeListener(arg1Val) return arg0 @@ -140547,31 +139482,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//bool: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Preferences)//bool: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//bool: arg 1: expected native of type fyne.Preferences") + return env.NewError("Go(fyne.Preferences)//bool: arg 1: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//bool: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//bool: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//bool: arg 1: expected native") + return env.NewError("Go(fyne.Preferences)//bool: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//bool: arg 2: expected string") + return env.NewError("Go(fyne.Preferences)//bool: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := arg0Val.Bool(arg1Val) var res0Obj env.Object @@ -140590,31 +139525,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//bool-list: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Preferences)//bool-list: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//bool-list: arg 1: expected native of type fyne.Preferences") + return env.NewError("Go(fyne.Preferences)//bool-list: arg 1: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//bool-list: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//bool-list: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//bool-list: arg 1: expected native") + return env.NewError("Go(fyne.Preferences)//bool-list: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//bool-list: arg 2: expected string") + return env.NewError("Go(fyne.Preferences)//bool-list: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := arg0Val.BoolList(arg1Val) var res0Obj env.Object @@ -140639,60 +139574,53 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//bool-list-with-fallback: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Preferences)//bool-list-with-fallback: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//bool-list-with-fallback: arg 1: expected native of type fyne.Preferences") + return env.NewError("Go(fyne.Preferences)//bool-list-with-fallback: arg 1: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//bool-list-with-fallback: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//bool-list-with-fallback: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//bool-list-with-fallback: arg 1: expected native") + return env.NewError("Go(fyne.Preferences)//bool-list-with-fallback: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//bool-list-with-fallback: arg 2: expected string") + return env.NewError("Go(fyne.Preferences)//bool-list-with-fallback: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val []bool switch v := arg2.(type) { case env.Block: arg2Val = make([]bool, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.Integer); ok { - arg2Val[i] = v.Value != 0 + if vc, ok := it.(env.Integer); ok { + arg2Val[i] = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//bool-list-with-fallback: arg 3: block item: expected integer") + return env.NewError("Go(fyne.Preferences)//bool-list-with-fallback: arg 3: " + "block item: " + "expected integer, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - arg2Val, ok = v.Value.([]bool) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//bool-list-with-fallback: arg 3: expected native of type []bool") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//bool-list-with-fallback: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//bool-list-with-fallback: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//bool-list-with-fallback: arg 3: expected block, native or nil") + return env.NewError("Go(fyne.Preferences)//bool-list-with-fallback: arg 3: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.BoolListWithFallback(arg1Val, arg2Val) var res0Obj env.Object @@ -140717,38 +139645,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//bool-with-fallback: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Preferences)//bool-with-fallback: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//bool-with-fallback: arg 1: expected native of type fyne.Preferences") + return env.NewError("Go(fyne.Preferences)//bool-with-fallback: arg 1: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//bool-with-fallback: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//bool-with-fallback: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//bool-with-fallback: arg 1: expected native") + return env.NewError("Go(fyne.Preferences)//bool-with-fallback: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//bool-with-fallback: arg 2: expected string") + return env.NewError("Go(fyne.Preferences)//bool-with-fallback: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val bool - if v, ok := arg2.(env.Integer); ok { - arg2Val = v.Value != 0 + if vc, ok := arg2.(env.Integer); ok { + arg2Val = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//bool-with-fallback: arg 3: expected integer") + return env.NewError("Go(fyne.Preferences)//bool-with-fallback: arg 3: " + "expected integer, but got " + objectDebugString(ps.Idx, arg2)) } res0 := arg0Val.BoolWithFallback(arg1Val, arg2Val) var res0Obj env.Object @@ -140767,31 +139695,34 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//change-listeners: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Preferences)//change-listeners: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//change-listeners: arg 1: expected native of type fyne.Preferences") + return env.NewError("Go(fyne.Preferences)//change-listeners: arg 1: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//change-listeners: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//change-listeners: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//change-listeners: arg 1: expected native") + return env.NewError("Go(fyne.Preferences)//change-listeners: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.ChangeListeners() var res0Obj env.Object { items := make([]env.Object, len(res0)) for i, it := range res0 { - items[i] = *env.NewNative(ps.Idx, it, "Go(func())") + items[i] = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + it() + return nil + }, 0, false, false, "Returned func") } res0Obj = *env.NewBlock(*env.NewTSeries(items)) } @@ -140809,31 +139740,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//float: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Preferences)//float: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//float: arg 1: expected native of type fyne.Preferences") + return env.NewError("Go(fyne.Preferences)//float: arg 1: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//float: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//float: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//float: arg 1: expected native") + return env.NewError("Go(fyne.Preferences)//float: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//float: arg 2: expected string") + return env.NewError("Go(fyne.Preferences)//float: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := arg0Val.Float(arg1Val) var res0Obj env.Object @@ -140852,31 +139783,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//float-list: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Preferences)//float-list: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//float-list: arg 1: expected native of type fyne.Preferences") + return env.NewError("Go(fyne.Preferences)//float-list: arg 1: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//float-list: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//float-list: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//float-list: arg 1: expected native") + return env.NewError("Go(fyne.Preferences)//float-list: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//float-list: arg 2: expected string") + return env.NewError("Go(fyne.Preferences)//float-list: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := arg0Val.FloatList(arg1Val) var res0Obj env.Object @@ -140901,60 +139832,53 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//float-list-with-fallback: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Preferences)//float-list-with-fallback: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//float-list-with-fallback: arg 1: expected native of type fyne.Preferences") + return env.NewError("Go(fyne.Preferences)//float-list-with-fallback: arg 1: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//float-list-with-fallback: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//float-list-with-fallback: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//float-list-with-fallback: arg 1: expected native") + return env.NewError("Go(fyne.Preferences)//float-list-with-fallback: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//float-list-with-fallback: arg 2: expected string") + return env.NewError("Go(fyne.Preferences)//float-list-with-fallback: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val []float64 switch v := arg2.(type) { case env.Block: arg2Val = make([]float64, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.Decimal); ok { - arg2Val[i] = float64(v.Value) + if vc, ok := it.(env.Decimal); ok { + arg2Val[i] = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//float-list-with-fallback: arg 3: block item: expected decimal") + return env.NewError("Go(fyne.Preferences)//float-list-with-fallback: arg 3: " + "block item: " + "expected decimal, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - arg2Val, ok = v.Value.([]float64) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//float-list-with-fallback: arg 3: expected native of type []float64") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//float-list-with-fallback: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//float-list-with-fallback: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//float-list-with-fallback: arg 3: expected block, native or nil") + return env.NewError("Go(fyne.Preferences)//float-list-with-fallback: arg 3: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.FloatListWithFallback(arg1Val, arg2Val) var res0Obj env.Object @@ -140979,38 +139903,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//float-with-fallback: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Preferences)//float-with-fallback: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//float-with-fallback: arg 1: expected native of type fyne.Preferences") + return env.NewError("Go(fyne.Preferences)//float-with-fallback: arg 1: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//float-with-fallback: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//float-with-fallback: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//float-with-fallback: arg 1: expected native") + return env.NewError("Go(fyne.Preferences)//float-with-fallback: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//float-with-fallback: arg 2: expected string") + return env.NewError("Go(fyne.Preferences)//float-with-fallback: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val float64 - if v, ok := arg2.(env.Decimal); ok { - arg2Val = float64(v.Value) + if vc, ok := arg2.(env.Decimal); ok { + arg2Val = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//float-with-fallback: arg 3: expected decimal") + return env.NewError("Go(fyne.Preferences)//float-with-fallback: arg 3: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg2)) } res0 := arg0Val.FloatWithFallback(arg1Val, arg2Val) var res0Obj env.Object @@ -141029,31 +139953,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//int: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Preferences)//int: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//int: arg 1: expected native of type fyne.Preferences") + return env.NewError("Go(fyne.Preferences)//int: arg 1: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//int: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//int: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//int: arg 1: expected native") + return env.NewError("Go(fyne.Preferences)//int: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//int: arg 2: expected string") + return env.NewError("Go(fyne.Preferences)//int: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := arg0Val.Int(arg1Val) var res0Obj env.Object @@ -141072,31 +139996,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//int-list: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Preferences)//int-list: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//int-list: arg 1: expected native of type fyne.Preferences") + return env.NewError("Go(fyne.Preferences)//int-list: arg 1: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//int-list: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//int-list: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//int-list: arg 1: expected native") + return env.NewError("Go(fyne.Preferences)//int-list: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//int-list: arg 2: expected string") + return env.NewError("Go(fyne.Preferences)//int-list: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := arg0Val.IntList(arg1Val) var res0Obj env.Object @@ -141121,60 +140045,53 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//int-list-with-fallback: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Preferences)//int-list-with-fallback: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//int-list-with-fallback: arg 1: expected native of type fyne.Preferences") + return env.NewError("Go(fyne.Preferences)//int-list-with-fallback: arg 1: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//int-list-with-fallback: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//int-list-with-fallback: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//int-list-with-fallback: arg 1: expected native") + return env.NewError("Go(fyne.Preferences)//int-list-with-fallback: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//int-list-with-fallback: arg 2: expected string") + return env.NewError("Go(fyne.Preferences)//int-list-with-fallback: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val []int switch v := arg2.(type) { case env.Block: arg2Val = make([]int, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.Integer); ok { - arg2Val[i] = int(v.Value) + if vc, ok := it.(env.Integer); ok { + arg2Val[i] = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//int-list-with-fallback: arg 3: block item: expected integer") + return env.NewError("Go(fyne.Preferences)//int-list-with-fallback: arg 3: " + "block item: " + "expected integer, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - arg2Val, ok = v.Value.([]int) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//int-list-with-fallback: arg 3: expected native of type []int") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//int-list-with-fallback: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//int-list-with-fallback: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//int-list-with-fallback: arg 3: expected block, native or nil") + return env.NewError("Go(fyne.Preferences)//int-list-with-fallback: arg 3: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.IntListWithFallback(arg1Val, arg2Val) var res0Obj env.Object @@ -141199,38 +140116,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//int-with-fallback: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Preferences)//int-with-fallback: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//int-with-fallback: arg 1: expected native of type fyne.Preferences") + return env.NewError("Go(fyne.Preferences)//int-with-fallback: arg 1: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//int-with-fallback: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//int-with-fallback: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//int-with-fallback: arg 1: expected native") + return env.NewError("Go(fyne.Preferences)//int-with-fallback: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//int-with-fallback: arg 2: expected string") + return env.NewError("Go(fyne.Preferences)//int-with-fallback: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val int - if v, ok := arg2.(env.Integer); ok { - arg2Val = int(v.Value) + if vc, ok := arg2.(env.Integer); ok { + arg2Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//int-with-fallback: arg 3: expected integer") + return env.NewError("Go(fyne.Preferences)//int-with-fallback: arg 3: " + "expected integer, but got " + objectDebugString(ps.Idx, arg2)) } res0 := arg0Val.IntWithFallback(arg1Val, arg2Val) var res0Obj env.Object @@ -141249,31 +140166,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//remove-value: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Preferences)//remove-value: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//remove-value: arg 1: expected native of type fyne.Preferences") + return env.NewError("Go(fyne.Preferences)//remove-value: arg 1: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//remove-value: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//remove-value: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//remove-value: arg 1: expected native") + return env.NewError("Go(fyne.Preferences)//remove-value: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//remove-value: arg 2: expected string") + return env.NewError("Go(fyne.Preferences)//remove-value: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.RemoveValue(arg1Val) return arg0 @@ -141290,38 +140207,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-bool: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Preferences)//set-bool: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-bool: arg 1: expected native of type fyne.Preferences") + return env.NewError("Go(fyne.Preferences)//set-bool: arg 1: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-bool: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//set-bool: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-bool: arg 1: expected native") + return env.NewError("Go(fyne.Preferences)//set-bool: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-bool: arg 2: expected string") + return env.NewError("Go(fyne.Preferences)//set-bool: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val bool - if v, ok := arg2.(env.Integer); ok { - arg2Val = v.Value != 0 + if vc, ok := arg2.(env.Integer); ok { + arg2Val = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-bool: arg 3: expected integer") + return env.NewError("Go(fyne.Preferences)//set-bool: arg 3: " + "expected integer, but got " + objectDebugString(ps.Idx, arg2)) } arg0Val.SetBool(arg1Val, arg2Val) return arg0 @@ -141338,60 +140255,53 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-bool-list: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Preferences)//set-bool-list: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-bool-list: arg 1: expected native of type fyne.Preferences") + return env.NewError("Go(fyne.Preferences)//set-bool-list: arg 1: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-bool-list: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//set-bool-list: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-bool-list: arg 1: expected native") + return env.NewError("Go(fyne.Preferences)//set-bool-list: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-bool-list: arg 2: expected string") + return env.NewError("Go(fyne.Preferences)//set-bool-list: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val []bool switch v := arg2.(type) { case env.Block: arg2Val = make([]bool, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.Integer); ok { - arg2Val[i] = v.Value != 0 + if vc, ok := it.(env.Integer); ok { + arg2Val[i] = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-bool-list: arg 3: block item: expected integer") + return env.NewError("Go(fyne.Preferences)//set-bool-list: arg 3: " + "block item: " + "expected integer, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - arg2Val, ok = v.Value.([]bool) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-bool-list: arg 3: expected native of type []bool") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-bool-list: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//set-bool-list: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-bool-list: arg 3: expected block, native or nil") + return env.NewError("Go(fyne.Preferences)//set-bool-list: arg 3: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetBoolList(arg1Val, arg2Val) return arg0 @@ -141408,38 +140318,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-float: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Preferences)//set-float: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-float: arg 1: expected native of type fyne.Preferences") + return env.NewError("Go(fyne.Preferences)//set-float: arg 1: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-float: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//set-float: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-float: arg 1: expected native") + return env.NewError("Go(fyne.Preferences)//set-float: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-float: arg 2: expected string") + return env.NewError("Go(fyne.Preferences)//set-float: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val float64 - if v, ok := arg2.(env.Decimal); ok { - arg2Val = float64(v.Value) + if vc, ok := arg2.(env.Decimal); ok { + arg2Val = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-float: arg 3: expected decimal") + return env.NewError("Go(fyne.Preferences)//set-float: arg 3: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg2)) } arg0Val.SetFloat(arg1Val, arg2Val) return arg0 @@ -141456,60 +140366,53 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-float-list: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Preferences)//set-float-list: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-float-list: arg 1: expected native of type fyne.Preferences") + return env.NewError("Go(fyne.Preferences)//set-float-list: arg 1: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-float-list: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//set-float-list: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-float-list: arg 1: expected native") + return env.NewError("Go(fyne.Preferences)//set-float-list: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-float-list: arg 2: expected string") + return env.NewError("Go(fyne.Preferences)//set-float-list: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val []float64 switch v := arg2.(type) { case env.Block: arg2Val = make([]float64, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.Decimal); ok { - arg2Val[i] = float64(v.Value) + if vc, ok := it.(env.Decimal); ok { + arg2Val[i] = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-float-list: arg 3: block item: expected decimal") + return env.NewError("Go(fyne.Preferences)//set-float-list: arg 3: " + "block item: " + "expected decimal, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - arg2Val, ok = v.Value.([]float64) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-float-list: arg 3: expected native of type []float64") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-float-list: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//set-float-list: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-float-list: arg 3: expected block, native or nil") + return env.NewError("Go(fyne.Preferences)//set-float-list: arg 3: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetFloatList(arg1Val, arg2Val) return arg0 @@ -141526,38 +140429,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-int: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Preferences)//set-int: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-int: arg 1: expected native of type fyne.Preferences") + return env.NewError("Go(fyne.Preferences)//set-int: arg 1: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-int: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//set-int: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-int: arg 1: expected native") + return env.NewError("Go(fyne.Preferences)//set-int: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-int: arg 2: expected string") + return env.NewError("Go(fyne.Preferences)//set-int: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val int - if v, ok := arg2.(env.Integer); ok { - arg2Val = int(v.Value) + if vc, ok := arg2.(env.Integer); ok { + arg2Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-int: arg 3: expected integer") + return env.NewError("Go(fyne.Preferences)//set-int: arg 3: " + "expected integer, but got " + objectDebugString(ps.Idx, arg2)) } arg0Val.SetInt(arg1Val, arg2Val) return arg0 @@ -141574,60 +140477,53 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-int-list: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Preferences)//set-int-list: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-int-list: arg 1: expected native of type fyne.Preferences") + return env.NewError("Go(fyne.Preferences)//set-int-list: arg 1: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-int-list: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//set-int-list: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-int-list: arg 1: expected native") + return env.NewError("Go(fyne.Preferences)//set-int-list: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-int-list: arg 2: expected string") + return env.NewError("Go(fyne.Preferences)//set-int-list: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val []int switch v := arg2.(type) { case env.Block: arg2Val = make([]int, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.Integer); ok { - arg2Val[i] = int(v.Value) + if vc, ok := it.(env.Integer); ok { + arg2Val[i] = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-int-list: arg 3: block item: expected integer") + return env.NewError("Go(fyne.Preferences)//set-int-list: arg 3: " + "block item: " + "expected integer, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - arg2Val, ok = v.Value.([]int) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-int-list: arg 3: expected native of type []int") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-int-list: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//set-int-list: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-int-list: arg 3: expected block, native or nil") + return env.NewError("Go(fyne.Preferences)//set-int-list: arg 3: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetIntList(arg1Val, arg2Val) return arg0 @@ -141644,38 +140540,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-string: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Preferences)//set-string: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-string: arg 1: expected native of type fyne.Preferences") + return env.NewError("Go(fyne.Preferences)//set-string: arg 1: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-string: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//set-string: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-string: arg 1: expected native") + return env.NewError("Go(fyne.Preferences)//set-string: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-string: arg 2: expected string") + return env.NewError("Go(fyne.Preferences)//set-string: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-string: arg 3: expected string") + return env.NewError("Go(fyne.Preferences)//set-string: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } arg0Val.SetString(arg1Val, arg2Val) return arg0 @@ -141692,60 +140588,53 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-string-list: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Preferences)//set-string-list: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-string-list: arg 1: expected native of type fyne.Preferences") + return env.NewError("Go(fyne.Preferences)//set-string-list: arg 1: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-string-list: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//set-string-list: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-string-list: arg 1: expected native") + return env.NewError("Go(fyne.Preferences)//set-string-list: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-string-list: arg 2: expected string") + return env.NewError("Go(fyne.Preferences)//set-string-list: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val []string switch v := arg2.(type) { case env.Block: arg2Val = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - arg2Val[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + arg2Val[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-string-list: arg 3: block item: expected string") + return env.NewError("Go(fyne.Preferences)//set-string-list: arg 3: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - arg2Val, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-string-list: arg 3: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-string-list: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//set-string-list: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//set-string-list: arg 3: expected block, native or nil") + return env.NewError("Go(fyne.Preferences)//set-string-list: arg 3: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetStringList(arg1Val, arg2Val) return arg0 @@ -141762,31 +140651,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//string: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Preferences)//string: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//string: arg 1: expected native of type fyne.Preferences") + return env.NewError("Go(fyne.Preferences)//string: arg 1: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//string: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//string: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//string: arg 1: expected native") + return env.NewError("Go(fyne.Preferences)//string: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//string: arg 2: expected string") + return env.NewError("Go(fyne.Preferences)//string: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := arg0Val.String(arg1Val) var res0Obj env.Object @@ -141805,31 +140694,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//string-list: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Preferences)//string-list: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//string-list: arg 1: expected native of type fyne.Preferences") + return env.NewError("Go(fyne.Preferences)//string-list: arg 1: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//string-list: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//string-list: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//string-list: arg 1: expected native") + return env.NewError("Go(fyne.Preferences)//string-list: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//string-list: arg 2: expected string") + return env.NewError("Go(fyne.Preferences)//string-list: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := arg0Val.StringList(arg1Val) var res0Obj env.Object @@ -141854,60 +140743,53 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//string-list-with-fallback: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Preferences)//string-list-with-fallback: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//string-list-with-fallback: arg 1: expected native of type fyne.Preferences") + return env.NewError("Go(fyne.Preferences)//string-list-with-fallback: arg 1: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//string-list-with-fallback: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//string-list-with-fallback: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//string-list-with-fallback: arg 1: expected native") + return env.NewError("Go(fyne.Preferences)//string-list-with-fallback: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//string-list-with-fallback: arg 2: expected string") + return env.NewError("Go(fyne.Preferences)//string-list-with-fallback: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val []string switch v := arg2.(type) { case env.Block: arg2Val = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - arg2Val[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + arg2Val[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//string-list-with-fallback: arg 3: block item: expected string") + return env.NewError("Go(fyne.Preferences)//string-list-with-fallback: arg 3: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - arg2Val, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//string-list-with-fallback: arg 3: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//string-list-with-fallback: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//string-list-with-fallback: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//string-list-with-fallback: arg 3: expected block, native or nil") + return env.NewError("Go(fyne.Preferences)//string-list-with-fallback: arg 3: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.StringListWithFallback(arg1Val, arg2Val) var res0Obj env.Object @@ -141932,38 +140814,38 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//string-with-fallback: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Preferences)//string-with-fallback: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//string-with-fallback: arg 1: expected native of type fyne.Preferences") + return env.NewError("Go(fyne.Preferences)//string-with-fallback: arg 1: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//string-with-fallback: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Preferences)//string-with-fallback: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//string-with-fallback: arg 1: expected native") + return env.NewError("Go(fyne.Preferences)//string-with-fallback: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//string-with-fallback: arg 2: expected string") + return env.NewError("Go(fyne.Preferences)//string-with-fallback: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Preferences)//string-with-fallback: arg 3: expected string") + return env.NewError("Go(fyne.Preferences)//string-with-fallback: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } res0 := arg0Val.StringWithFallback(arg1Val, arg2Val) var res0Obj env.Object @@ -141982,24 +140864,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Resource(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Resource)//content: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Resource)//content: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Resource)//content: arg 1: expected native of type fyne.Resource") + return env.NewError("Go(fyne.Resource)//content: arg 1: " + "expected native of type fyne.Resource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Resource)//content: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Resource)//content: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Resource)//content: arg 1: expected native") + return env.NewError("Go(fyne.Resource)//content: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Content() var res0Obj env.Object @@ -142024,24 +140906,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Resource(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Resource)//name: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Resource)//name: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Resource)//name: arg 1: expected native of type fyne.Resource") + return env.NewError("Go(fyne.Resource)//name: arg 1: " + "expected native of type fyne.Resource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Resource)//name: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Resource)//name: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Resource)//name: arg 1: expected native") + return env.NewError("Go(fyne.Resource)//name: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Name() var res0Obj env.Object @@ -142060,43 +140942,43 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Scrollable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Scrollable)//scrolled: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Scrollable)//scrolled: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Scrollable) - if !ok { + if vc, ok := v.Value.(fyne.Scrollable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Scrollable)//scrolled: arg 1: expected native of type fyne.Scrollable") + return env.NewError("Go(fyne.Scrollable)//scrolled: arg 1: " + "expected native of type fyne.Scrollable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Scrollable)//scrolled: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Scrollable)//scrolled: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Scrollable)//scrolled: arg 1: expected native") + return env.NewError("Go(fyne.Scrollable)//scrolled: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.ScrollEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.ScrollEvent) - if !ok { + if vc, ok := v.Value.(*fyne.ScrollEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Scrollable)//scrolled: arg 2: expected native of type *fyne.ScrollEvent") + return env.NewError("Go(fyne.Scrollable)//scrolled: arg 2: " + "expected native of type *fyne.ScrollEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Scrollable)//scrolled: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Scrollable)//scrolled: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Scrollable)//scrolled: arg 2: expected native") + return env.NewError("Go(fyne.Scrollable)//scrolled: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Scrolled(arg1Val) return arg0 @@ -142113,43 +140995,43 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_SecondaryTappable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.SecondaryTappable)//tapped-secondary: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.SecondaryTappable)//tapped-secondary: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.SecondaryTappable) - if !ok { + if vc, ok := v.Value.(fyne.SecondaryTappable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.SecondaryTappable)//tapped-secondary: arg 1: expected native of type fyne.SecondaryTappable") + return env.NewError("Go(fyne.SecondaryTappable)//tapped-secondary: arg 1: " + "expected native of type fyne.SecondaryTappable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.SecondaryTappable)//tapped-secondary: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.SecondaryTappable)//tapped-secondary: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.SecondaryTappable)//tapped-secondary: arg 1: expected native") + return env.NewError("Go(fyne.SecondaryTappable)//tapped-secondary: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.PointEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.PointEvent) - if !ok { + if vc, ok := v.Value.(*fyne.PointEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.SecondaryTappable)//tapped-secondary: arg 2: expected native of type *fyne.PointEvent") + return env.NewError("Go(fyne.SecondaryTappable)//tapped-secondary: arg 2: " + "expected native of type *fyne.PointEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.SecondaryTappable)//tapped-secondary: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.SecondaryTappable)//tapped-secondary: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.SecondaryTappable)//tapped-secondary: arg 2: expected native") + return env.NewError("Go(fyne.SecondaryTappable)//tapped-secondary: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TappedSecondary(arg1Val) return arg0 @@ -142166,37 +141048,37 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Settings(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//add-change-listener: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Settings)//add-change-listener: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Settings) - if !ok { + if vc, ok := v.Value.(fyne.Settings); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//add-change-listener: arg 1: expected native of type fyne.Settings") + return env.NewError("Go(fyne.Settings)//add-change-listener: arg 1: " + "expected native of type fyne.Settings, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//add-change-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Settings)//add-change-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//add-change-listener: arg 1: expected native") + return env.NewError("Go(fyne.Settings)//add-change-listener: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val chan fyne.Settings switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(chan fyne.Settings) - if !ok { + if vc, ok := v.Value.(chan fyne.Settings); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//add-change-listener: arg 2: expected native of type chan fyne.Settings") + return env.NewError("Go(fyne.Settings)//add-change-listener: arg 2: " + "expected native of type chan fyne.Settings, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//add-change-listener: arg 2: expected native") + return env.NewError("Go(fyne.Settings)//add-change-listener: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.AddChangeListener(arg1Val) return arg0 @@ -142213,24 +141095,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Settings(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//build-type: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Settings)//build-type: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Settings) - if !ok { + if vc, ok := v.Value.(fyne.Settings); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//build-type: arg 1: expected native of type fyne.Settings") + return env.NewError("Go(fyne.Settings)//build-type: arg 1: " + "expected native of type fyne.Settings, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//build-type: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Settings)//build-type: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//build-type: arg 1: expected native") + return env.NewError("Go(fyne.Settings)//build-type: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.BuildType() var res0Obj env.Object @@ -142249,24 +141131,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Settings(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//primary-color: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Settings)//primary-color: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Settings) - if !ok { + if vc, ok := v.Value.(fyne.Settings); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//primary-color: arg 1: expected native of type fyne.Settings") + return env.NewError("Go(fyne.Settings)//primary-color: arg 1: " + "expected native of type fyne.Settings, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//primary-color: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Settings)//primary-color: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//primary-color: arg 1: expected native") + return env.NewError("Go(fyne.Settings)//primary-color: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.PrimaryColor() var res0Obj env.Object @@ -142285,24 +141167,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Settings(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//scale: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Settings)//scale: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Settings) - if !ok { + if vc, ok := v.Value.(fyne.Settings); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//scale: arg 1: expected native of type fyne.Settings") + return env.NewError("Go(fyne.Settings)//scale: arg 1: " + "expected native of type fyne.Settings, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//scale: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Settings)//scale: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//scale: arg 1: expected native") + return env.NewError("Go(fyne.Settings)//scale: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Scale() var res0Obj env.Object @@ -142321,24 +141203,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Settings(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//set-theme: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Settings)//set-theme: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Settings) - if !ok { + if vc, ok := v.Value.(fyne.Settings); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//set-theme: arg 1: expected native of type fyne.Settings") + return env.NewError("Go(fyne.Settings)//set-theme: arg 1: " + "expected native of type fyne.Settings, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//set-theme: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Settings)//set-theme: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//set-theme: arg 1: expected native") + return env.NewError("Go(fyne.Settings)//set-theme: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Theme switch v := arg1.(type) { @@ -142347,24 +141229,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Theme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//set-theme: arg 2: " + err.Error() + "") + return env.NewError("Go(fyne.Settings)//set-theme: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Theme) - if !ok { + if vc, ok := v.Value.(fyne.Theme); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//set-theme: arg 2: expected native of type fyne.Theme") + return env.NewError("Go(fyne.Settings)//set-theme: arg 2: " + "expected native of type fyne.Theme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//set-theme: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Settings)//set-theme: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//set-theme: arg 2: expected native") + return env.NewError("Go(fyne.Settings)//set-theme: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetTheme(arg1Val) return arg0 @@ -142381,24 +141263,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Settings(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//show-animations: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Settings)//show-animations: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Settings) - if !ok { + if vc, ok := v.Value.(fyne.Settings); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//show-animations: arg 1: expected native of type fyne.Settings") + return env.NewError("Go(fyne.Settings)//show-animations: arg 1: " + "expected native of type fyne.Settings, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//show-animations: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Settings)//show-animations: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//show-animations: arg 1: expected native") + return env.NewError("Go(fyne.Settings)//show-animations: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.ShowAnimations() var res0Obj env.Object @@ -142417,45 +141299,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Settings(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//theme: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Settings)//theme: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Settings) - if !ok { + if vc, ok := v.Value.(fyne.Settings); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//theme: arg 1: expected native of type fyne.Settings") + return env.NewError("Go(fyne.Settings)//theme: arg 1: " + "expected native of type fyne.Settings, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//theme: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Settings)//theme: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//theme: arg 1: expected native") + return env.NewError("Go(fyne.Settings)//theme: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Theme() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Theme)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Theme)") return res0Obj }, }, @@ -142470,24 +141335,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Settings(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//theme-variant: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Settings)//theme-variant: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Settings) - if !ok { + if vc, ok := v.Value.(fyne.Settings); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//theme-variant: arg 1: expected native of type fyne.Settings") + return env.NewError("Go(fyne.Settings)//theme-variant: arg 1: " + "expected native of type fyne.Settings, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//theme-variant: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Settings)//theme-variant: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Settings)//theme-variant: arg 1: expected native") + return env.NewError("Go(fyne.Settings)//theme-variant: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.ThemeVariant() var res0Obj env.Object @@ -142506,24 +141371,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Shortcut(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Shortcut)//shortcut-name: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Shortcut)//shortcut-name: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Shortcut) - if !ok { + if vc, ok := v.Value.(fyne.Shortcut); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Shortcut)//shortcut-name: arg 1: expected native of type fyne.Shortcut") + return env.NewError("Go(fyne.Shortcut)//shortcut-name: arg 1: " + "expected native of type fyne.Shortcut, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Shortcut)//shortcut-name: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Shortcut)//shortcut-name: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Shortcut)//shortcut-name: arg 1: expected native") + return env.NewError("Go(fyne.Shortcut)//shortcut-name: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.ShortcutName() var res0Obj env.Object @@ -142542,24 +141407,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Shortcutable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Shortcutable)//typed-shortcut: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Shortcutable)//typed-shortcut: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Shortcutable) - if !ok { + if vc, ok := v.Value.(fyne.Shortcutable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Shortcutable)//typed-shortcut: arg 1: expected native of type fyne.Shortcutable") + return env.NewError("Go(fyne.Shortcutable)//typed-shortcut: arg 1: " + "expected native of type fyne.Shortcutable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Shortcutable)//typed-shortcut: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Shortcutable)//typed-shortcut: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Shortcutable)//typed-shortcut: arg 1: expected native") + return env.NewError("Go(fyne.Shortcutable)//typed-shortcut: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Shortcut switch v := arg1.(type) { @@ -142568,398 +141433,29 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Shortcut(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Shortcutable)//typed-shortcut: arg 2: " + err.Error() + "") + return env.NewError("Go(fyne.Shortcutable)//typed-shortcut: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Shortcut) - if !ok { + if vc, ok := v.Value.(fyne.Shortcut); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Shortcutable)//typed-shortcut: arg 2: expected native of type fyne.Shortcut") + return env.NewError("Go(fyne.Shortcutable)//typed-shortcut: arg 2: " + "expected native of type fyne.Shortcut, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Shortcutable)//typed-shortcut: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Shortcutable)//typed-shortcut: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Shortcutable)//typed-shortcut: arg 2: expected native") + return env.NewError("Go(fyne.Shortcutable)//typed-shortcut: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedShortcut(arg1Val) return arg0 }, }, - "Go(fyne.Size)//add": { - Doc: "fyne.Size.Add", - Argsn: 2, - Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var arg0Val *fyne.Size - switch v := arg0.(type) { - case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//add: arg 1: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//add: arg 1: expected integer to be 0 or nil") - } - arg0Val = nil - default: - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//add: arg 1: expected native") - } - var arg1Val fyne.Vector2 - switch v := arg1.(type) { - case env.RyeCtx: - var err error - arg1Val, err = ctxTo_fyne_Vector2(ps, v) - if err != nil { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//add: arg 2: " + err.Error() + "") - } - case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Vector2) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//add: arg 2: expected native of type fyne.Vector2") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//add: arg 2: expected integer to be 0 or nil") - } - arg1Val = nil - default: - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//add: arg 2: expected native") - } - res0 := (*arg0Val).Add(arg1Val) - var res0Obj env.Object - res0Obj = *env.NewNative(ps.Idx, &res0, "Go(*fyne.Size)") - return res0Obj - }, - }, - "Go(fyne.Size)//add-width-height": { - Doc: "fyne.Size.AddWidthHeight", - Argsn: 3, - Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var arg0Val *fyne.Size - switch v := arg0.(type) { - case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//add-width-height: arg 1: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//add-width-height: arg 1: expected integer to be 0 or nil") - } - arg0Val = nil - default: - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//add-width-height: arg 1: expected native") - } - var arg1Val float32 - if v, ok := arg1.(env.Decimal); ok { - arg1Val = float32(v.Value) - } else { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//add-width-height: arg 2: expected decimal") - } - var arg2Val float32 - if v, ok := arg2.(env.Decimal); ok { - arg2Val = float32(v.Value) - } else { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//add-width-height: arg 3: expected decimal") - } - res0 := (*arg0Val).AddWidthHeight(arg1Val, arg2Val) - var res0Obj env.Object - res0Obj = *env.NewNative(ps.Idx, &res0, "Go(*fyne.Size)") - return res0Obj - }, - }, - "Go(fyne.Size)//components": { - Doc: "fyne.Size.Components", - Argsn: 1, - Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var arg0Val *fyne.Size - switch v := arg0.(type) { - case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//components: arg 1: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//components: arg 1: expected integer to be 0 or nil") - } - arg0Val = nil - default: - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//components: arg 1: expected native") - } - res0, res1 := (*arg0Val).Components() - var res0Obj env.Object - res0Obj = *env.NewDecimal(float64(res0)) - var res1Obj env.Object - res1Obj = *env.NewDecimal(float64(res1)) - return *env.NewBlock(*env.NewTSeries([]env.Object{ - res0Obj, - res1Obj, - })) - }, - }, - "Go(fyne.Size)//is-zero": { - Doc: "fyne.Size.IsZero", - Argsn: 1, - Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var arg0Val *fyne.Size - switch v := arg0.(type) { - case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//is-zero: arg 1: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//is-zero: arg 1: expected integer to be 0 or nil") - } - arg0Val = nil - default: - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//is-zero: arg 1: expected native") - } - res0 := (*arg0Val).IsZero() - var res0Obj env.Object - res0Obj = *env.NewInteger(boolToInt64(res0)) - return res0Obj - }, - }, - "Go(fyne.Size)//max": { - Doc: "fyne.Size.Max", - Argsn: 2, - Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var arg0Val *fyne.Size - switch v := arg0.(type) { - case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//max: arg 1: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//max: arg 1: expected integer to be 0 or nil") - } - arg0Val = nil - default: - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//max: arg 1: expected native") - } - var arg1Val fyne.Vector2 - switch v := arg1.(type) { - case env.RyeCtx: - var err error - arg1Val, err = ctxTo_fyne_Vector2(ps, v) - if err != nil { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//max: arg 2: " + err.Error() + "") - } - case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Vector2) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//max: arg 2: expected native of type fyne.Vector2") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//max: arg 2: expected integer to be 0 or nil") - } - arg1Val = nil - default: - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//max: arg 2: expected native") - } - res0 := (*arg0Val).Max(arg1Val) - var res0Obj env.Object - res0Obj = *env.NewNative(ps.Idx, &res0, "Go(*fyne.Size)") - return res0Obj - }, - }, - "Go(fyne.Size)//min": { - Doc: "fyne.Size.Min", - Argsn: 2, - Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var arg0Val *fyne.Size - switch v := arg0.(type) { - case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//min: arg 1: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//min: arg 1: expected integer to be 0 or nil") - } - arg0Val = nil - default: - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//min: arg 1: expected native") - } - var arg1Val fyne.Vector2 - switch v := arg1.(type) { - case env.RyeCtx: - var err error - arg1Val, err = ctxTo_fyne_Vector2(ps, v) - if err != nil { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//min: arg 2: " + err.Error() + "") - } - case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Vector2) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//min: arg 2: expected native of type fyne.Vector2") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//min: arg 2: expected integer to be 0 or nil") - } - arg1Val = nil - default: - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//min: arg 2: expected native") - } - res0 := (*arg0Val).Min(arg1Val) - var res0Obj env.Object - res0Obj = *env.NewNative(ps.Idx, &res0, "Go(*fyne.Size)") - return res0Obj - }, - }, - "Go(fyne.Size)//subtract": { - Doc: "fyne.Size.Subtract", - Argsn: 2, - Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var arg0Val *fyne.Size - switch v := arg0.(type) { - case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//subtract: arg 1: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//subtract: arg 1: expected integer to be 0 or nil") - } - arg0Val = nil - default: - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//subtract: arg 1: expected native") - } - var arg1Val fyne.Vector2 - switch v := arg1.(type) { - case env.RyeCtx: - var err error - arg1Val, err = ctxTo_fyne_Vector2(ps, v) - if err != nil { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//subtract: arg 2: " + err.Error() + "") - } - case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Vector2) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//subtract: arg 2: expected native of type fyne.Vector2") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//subtract: arg 2: expected integer to be 0 or nil") - } - arg1Val = nil - default: - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//subtract: arg 2: expected native") - } - res0 := (*arg0Val).Subtract(arg1Val) - var res0Obj env.Object - res0Obj = *env.NewNative(ps.Idx, &res0, "Go(*fyne.Size)") - return res0Obj - }, - }, - "Go(fyne.Size)//subtract-width-height": { - Doc: "fyne.Size.SubtractWidthHeight", - Argsn: 3, - Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var arg0Val *fyne.Size - switch v := arg0.(type) { - case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//subtract-width-height: arg 1: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//subtract-width-height: arg 1: expected integer to be 0 or nil") - } - arg0Val = nil - default: - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//subtract-width-height: arg 1: expected native") - } - var arg1Val float32 - if v, ok := arg1.(env.Decimal); ok { - arg1Val = float32(v.Value) - } else { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//subtract-width-height: arg 2: expected decimal") - } - var arg2Val float32 - if v, ok := arg2.(env.Decimal); ok { - arg2Val = float32(v.Value) - } else { - ps.FailureFlag = true - return env.NewError("Go(fyne.Size)//subtract-width-height: arg 3: expected decimal") - } - res0 := (*arg0Val).SubtractWidthHeight(arg1Val, arg2Val) - var res0Obj env.Object - res0Obj = *env.NewNative(ps.Idx, &res0, "Go(*fyne.Size)") - return res0Obj - }, - }, "Go(fyne.Storage)//create": { Doc: "fyne.Storage.Create", Argsn: 2, @@ -142971,52 +141467,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Storage(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Storage)//create: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Storage)//create: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Storage) - if !ok { + if vc, ok := v.Value.(fyne.Storage); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Storage)//create: arg 1: expected native of type fyne.Storage") + return env.NewError("Go(fyne.Storage)//create: arg 1: " + "expected native of type fyne.Storage, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Storage)//create: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Storage)//create: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Storage)//create: arg 1: expected native") + return env.NewError("Go(fyne.Storage)//create: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Storage)//create: arg 2: expected string") + return env.NewError("Go(fyne.Storage)//create: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.Create(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URIWriteCloser)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URIWriteCloser)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -143039,24 +141518,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Storage(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Storage)//list: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Storage)//list: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Storage) - if !ok { + if vc, ok := v.Value.(fyne.Storage); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Storage)//list: arg 1: expected native of type fyne.Storage") + return env.NewError("Go(fyne.Storage)//list: arg 1: " + "expected native of type fyne.Storage, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Storage)//list: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Storage)//list: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Storage)//list: arg 1: expected native") + return env.NewError("Go(fyne.Storage)//list: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.List() var res0Obj env.Object @@ -143081,52 +141560,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Storage(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Storage)//open: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Storage)//open: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Storage) - if !ok { + if vc, ok := v.Value.(fyne.Storage); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Storage)//open: arg 1: expected native of type fyne.Storage") + return env.NewError("Go(fyne.Storage)//open: arg 1: " + "expected native of type fyne.Storage, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Storage)//open: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Storage)//open: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Storage)//open: arg 1: expected native") + return env.NewError("Go(fyne.Storage)//open: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Storage)//open: arg 2: expected string") + return env.NewError("Go(fyne.Storage)//open: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.Open(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URIReadCloser)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URIReadCloser)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -143149,31 +141611,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Storage(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Storage)//remove: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Storage)//remove: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Storage) - if !ok { + if vc, ok := v.Value.(fyne.Storage); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Storage)//remove: arg 1: expected native of type fyne.Storage") + return env.NewError("Go(fyne.Storage)//remove: arg 1: " + "expected native of type fyne.Storage, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Storage)//remove: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Storage)//remove: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Storage)//remove: arg 1: expected native") + return env.NewError("Go(fyne.Storage)//remove: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Storage)//remove: arg 2: expected string") + return env.NewError("Go(fyne.Storage)//remove: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } resErr := arg0Val.Remove(arg1Val) var resErrObj env.Object @@ -143198,45 +141660,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Storage(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Storage)//root-uri: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Storage)//root-uri: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Storage) - if !ok { + if vc, ok := v.Value.(fyne.Storage); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Storage)//root-uri: arg 1: expected native of type fyne.Storage") + return env.NewError("Go(fyne.Storage)//root-uri: arg 1: " + "expected native of type fyne.Storage, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Storage)//root-uri: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Storage)//root-uri: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Storage)//root-uri: arg 1: expected native") + return env.NewError("Go(fyne.Storage)//root-uri: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.RootURI() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URI)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URI)") return res0Obj }, }, @@ -143251,52 +141696,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Storage(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Storage)//save: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Storage)//save: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Storage) - if !ok { + if vc, ok := v.Value.(fyne.Storage); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Storage)//save: arg 1: expected native of type fyne.Storage") + return env.NewError("Go(fyne.Storage)//save: arg 1: " + "expected native of type fyne.Storage, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Storage)//save: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Storage)//save: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Storage)//save: arg 1: expected native") + return env.NewError("Go(fyne.Storage)//save: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Storage)//save: arg 2: expected string") + return env.NewError("Go(fyne.Storage)//save: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.Save(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URIWriteCloser)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URIWriteCloser)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -143319,24 +141747,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Tabbable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Tabbable)//accepts-tab: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Tabbable)//accepts-tab: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Tabbable) - if !ok { + if vc, ok := v.Value.(fyne.Tabbable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Tabbable)//accepts-tab: arg 1: expected native of type fyne.Tabbable") + return env.NewError("Go(fyne.Tabbable)//accepts-tab: arg 1: " + "expected native of type fyne.Tabbable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Tabbable)//accepts-tab: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Tabbable)//accepts-tab: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Tabbable)//accepts-tab: arg 1: expected native") + return env.NewError("Go(fyne.Tabbable)//accepts-tab: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.AcceptsTab() var res0Obj env.Object @@ -143355,43 +141783,43 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Tappable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Tappable)//tapped: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Tappable)//tapped: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Tappable) - if !ok { + if vc, ok := v.Value.(fyne.Tappable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Tappable)//tapped: arg 1: expected native of type fyne.Tappable") + return env.NewError("Go(fyne.Tappable)//tapped: arg 1: " + "expected native of type fyne.Tappable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Tappable)//tapped: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Tappable)//tapped: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Tappable)//tapped: arg 1: expected native") + return env.NewError("Go(fyne.Tappable)//tapped: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.PointEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.PointEvent) - if !ok { + if vc, ok := v.Value.(*fyne.PointEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Tappable)//tapped: arg 2: expected native of type *fyne.PointEvent") + return env.NewError("Go(fyne.Tappable)//tapped: arg 2: " + "expected native of type *fyne.PointEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Tappable)//tapped: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Tappable)//tapped: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Tappable)//tapped: arg 2: expected native") + return env.NewError("Go(fyne.Tappable)//tapped: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Tapped(arg1Val) return arg0 @@ -143408,24 +141836,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Theme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Theme)//color: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Theme)//color: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Theme) - if !ok { + if vc, ok := v.Value.(fyne.Theme); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Theme)//color: arg 1: expected native of type fyne.Theme") + return env.NewError("Go(fyne.Theme)//color: arg 1: " + "expected native of type fyne.Theme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Theme)//color: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Theme)//color: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Theme)//color: arg 1: expected native") + return env.NewError("Go(fyne.Theme)//color: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.ThemeColorName { @@ -143439,11 +141867,11 @@ var Builtins = map[string]*env.Builtin{ arg1Val = natVal } else { var u string - if v, ok := arg1.(env.String); ok { - u = string(v.Value) + if vc, ok := arg1.(env.String); ok { + u = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Theme)//color: arg 2: expected string") + return env.NewError("Go(fyne.Theme)//color: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg1Val = fyne.ThemeColorName(u) } @@ -143460,11 +141888,11 @@ var Builtins = map[string]*env.Builtin{ arg2Val = natVal } else { var u uint - if v, ok := arg2.(env.Integer); ok { - u = uint(v.Value) + if vc, ok := arg2.(env.Integer); ok { + u = uint(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Theme)//color: arg 3: expected integer") + return env.NewError("Go(fyne.Theme)//color: arg 3: " + "expected integer, but got " + objectDebugString(ps.Idx, arg2)) } arg2Val = fyne.ThemeVariant(u) } @@ -143486,64 +141914,41 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Theme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Theme)//font: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Theme)//font: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Theme) - if !ok { + if vc, ok := v.Value.(fyne.Theme); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Theme)//font: arg 1: expected native of type fyne.Theme") + return env.NewError("Go(fyne.Theme)//font: arg 1: " + "expected native of type fyne.Theme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Theme)//font: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Theme)//font: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Theme)//font: arg 1: expected native") + return env.NewError("Go(fyne.Theme)//font: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.TextStyle + var arg1Val fyne.TextStyle switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.TextStyle) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Theme)//font: arg 2: expected native of type *fyne.TextStyle") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.TextStyle); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Theme)//font: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Theme)//font: arg 2: " + "expected native of type *fyne.TextStyle, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Theme)//font: arg 2: expected native") + return env.NewError("Go(fyne.Theme)//font: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - res0 := arg0Val.Font(*arg1Val) + res0 := arg0Val.Font(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -143558,24 +141963,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Theme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Theme)//icon: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Theme)//icon: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Theme) - if !ok { + if vc, ok := v.Value.(fyne.Theme); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Theme)//icon: arg 1: expected native of type fyne.Theme") + return env.NewError("Go(fyne.Theme)//icon: arg 1: " + "expected native of type fyne.Theme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Theme)//icon: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Theme)//icon: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Theme)//icon: arg 1: expected native") + return env.NewError("Go(fyne.Theme)//icon: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.ThemeIconName { @@ -143589,35 +141994,18 @@ var Builtins = map[string]*env.Builtin{ arg1Val = natVal } else { var u string - if v, ok := arg1.(env.String); ok { - u = string(v.Value) + if vc, ok := arg1.(env.String); ok { + u = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Theme)//icon: arg 2: expected string") + return env.NewError("Go(fyne.Theme)//icon: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg1Val = fyne.ThemeIconName(u) } } res0 := arg0Val.Icon(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -143632,24 +142020,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Theme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Theme)//size: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Theme)//size: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Theme) - if !ok { + if vc, ok := v.Value.(fyne.Theme); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Theme)//size: arg 1: expected native of type fyne.Theme") + return env.NewError("Go(fyne.Theme)//size: arg 1: " + "expected native of type fyne.Theme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Theme)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Theme)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Theme)//size: arg 1: expected native") + return env.NewError("Go(fyne.Theme)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.ThemeSizeName { @@ -143663,11 +142051,11 @@ var Builtins = map[string]*env.Builtin{ arg1Val = natVal } else { var u string - if v, ok := arg1.(env.String); ok { - u = string(v.Value) + if vc, ok := arg1.(env.String); ok { + u = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Theme)//size: arg 2: expected string") + return env.NewError("Go(fyne.Theme)//size: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg1Val = fyne.ThemeSizeName(u) } @@ -143689,24 +142077,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//authority: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.URI)//authority: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//authority: arg 1: expected native of type fyne.URI") + return env.NewError("Go(fyne.URI)//authority: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//authority: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.URI)//authority: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//authority: arg 1: expected native") + return env.NewError("Go(fyne.URI)//authority: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Authority() var res0Obj env.Object @@ -143725,24 +142113,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//extension: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.URI)//extension: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//extension: arg 1: expected native of type fyne.URI") + return env.NewError("Go(fyne.URI)//extension: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//extension: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.URI)//extension: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//extension: arg 1: expected native") + return env.NewError("Go(fyne.URI)//extension: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Extension() var res0Obj env.Object @@ -143761,24 +142149,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//fragment: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.URI)//fragment: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//fragment: arg 1: expected native of type fyne.URI") + return env.NewError("Go(fyne.URI)//fragment: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//fragment: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.URI)//fragment: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//fragment: arg 1: expected native") + return env.NewError("Go(fyne.URI)//fragment: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Fragment() var res0Obj env.Object @@ -143797,24 +142185,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//mime-type: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.URI)//mime-type: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//mime-type: arg 1: expected native of type fyne.URI") + return env.NewError("Go(fyne.URI)//mime-type: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//mime-type: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.URI)//mime-type: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//mime-type: arg 1: expected native") + return env.NewError("Go(fyne.URI)//mime-type: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MimeType() var res0Obj env.Object @@ -143833,24 +142221,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//name: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.URI)//name: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//name: arg 1: expected native of type fyne.URI") + return env.NewError("Go(fyne.URI)//name: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//name: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.URI)//name: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//name: arg 1: expected native") + return env.NewError("Go(fyne.URI)//name: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Name() var res0Obj env.Object @@ -143869,24 +142257,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//path: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.URI)//path: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//path: arg 1: expected native of type fyne.URI") + return env.NewError("Go(fyne.URI)//path: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//path: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.URI)//path: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//path: arg 1: expected native") + return env.NewError("Go(fyne.URI)//path: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Path() var res0Obj env.Object @@ -143905,24 +142293,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//query: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.URI)//query: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//query: arg 1: expected native of type fyne.URI") + return env.NewError("Go(fyne.URI)//query: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//query: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.URI)//query: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//query: arg 1: expected native") + return env.NewError("Go(fyne.URI)//query: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Query() var res0Obj env.Object @@ -143941,24 +142329,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//scheme: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.URI)//scheme: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//scheme: arg 1: expected native of type fyne.URI") + return env.NewError("Go(fyne.URI)//scheme: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//scheme: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.URI)//scheme: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//scheme: arg 1: expected native") + return env.NewError("Go(fyne.URI)//scheme: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Scheme() var res0Obj env.Object @@ -143977,24 +142365,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//string: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.URI)//string: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//string: arg 1: expected native of type fyne.URI") + return env.NewError("Go(fyne.URI)//string: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//string: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.URI)//string: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.URI)//string: arg 1: expected native") + return env.NewError("Go(fyne.URI)//string: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.String() var res0Obj env.Object @@ -144013,24 +142401,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URIReadCloser(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.URIReadCloser)//close: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.URIReadCloser)//close: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URIReadCloser) - if !ok { + if vc, ok := v.Value.(fyne.URIReadCloser); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.URIReadCloser)//close: arg 1: expected native of type fyne.URIReadCloser") + return env.NewError("Go(fyne.URIReadCloser)//close: arg 1: " + "expected native of type fyne.URIReadCloser, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.URIReadCloser)//close: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.URIReadCloser)//close: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.URIReadCloser)//close: arg 1: expected native") + return env.NewError("Go(fyne.URIReadCloser)//close: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Close() var resErrObj env.Object @@ -144055,24 +142443,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URIReadCloser(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.URIReadCloser)//read: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.URIReadCloser)//read: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URIReadCloser) - if !ok { + if vc, ok := v.Value.(fyne.URIReadCloser); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.URIReadCloser)//read: arg 1: expected native of type fyne.URIReadCloser") + return env.NewError("Go(fyne.URIReadCloser)//read: arg 1: " + "expected native of type fyne.URIReadCloser, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.URIReadCloser)//read: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.URIReadCloser)//read: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.URIReadCloser)//read: arg 1: expected native") + return env.NewError("Go(fyne.URIReadCloser)//read: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []byte switch v := arg1.(type) { @@ -144081,33 +142469,26 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg1Val[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + arg1Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.URIReadCloser)//read: arg 2: block item: expected native of type byte") + return env.NewError("Go(fyne.URIReadCloser)//read: arg 2: " + "block item: " + "expected native of type byte, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(fyne.URIReadCloser)//read: arg 2: block item: expected native") + return env.NewError("Go(fyne.URIReadCloser)//read: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]byte) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.URIReadCloser)//read: arg 2: expected native of type []byte") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.URIReadCloser)//read: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.URIReadCloser)//read: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.URIReadCloser)//read: arg 2: expected block, native or nil") + return env.NewError("Go(fyne.URIReadCloser)//read: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Read(arg1Val) var res0Obj env.Object @@ -144134,45 +142515,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URIReadCloser(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.URIReadCloser)//uri: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.URIReadCloser)//uri: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URIReadCloser) - if !ok { + if vc, ok := v.Value.(fyne.URIReadCloser); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.URIReadCloser)//uri: arg 1: expected native of type fyne.URIReadCloser") + return env.NewError("Go(fyne.URIReadCloser)//uri: arg 1: " + "expected native of type fyne.URIReadCloser, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.URIReadCloser)//uri: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.URIReadCloser)//uri: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.URIReadCloser)//uri: arg 1: expected native") + return env.NewError("Go(fyne.URIReadCloser)//uri: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.URI() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URI)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URI)") return res0Obj }, }, @@ -144187,24 +142551,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URIWriteCloser(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.URIWriteCloser)//close: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.URIWriteCloser)//close: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URIWriteCloser) - if !ok { + if vc, ok := v.Value.(fyne.URIWriteCloser); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.URIWriteCloser)//close: arg 1: expected native of type fyne.URIWriteCloser") + return env.NewError("Go(fyne.URIWriteCloser)//close: arg 1: " + "expected native of type fyne.URIWriteCloser, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.URIWriteCloser)//close: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.URIWriteCloser)//close: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.URIWriteCloser)//close: arg 1: expected native") + return env.NewError("Go(fyne.URIWriteCloser)//close: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Close() var resErrObj env.Object @@ -144229,45 +142593,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URIWriteCloser(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.URIWriteCloser)//uri: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.URIWriteCloser)//uri: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URIWriteCloser) - if !ok { + if vc, ok := v.Value.(fyne.URIWriteCloser); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.URIWriteCloser)//uri: arg 1: expected native of type fyne.URIWriteCloser") + return env.NewError("Go(fyne.URIWriteCloser)//uri: arg 1: " + "expected native of type fyne.URIWriteCloser, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.URIWriteCloser)//uri: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.URIWriteCloser)//uri: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.URIWriteCloser)//uri: arg 1: expected native") + return env.NewError("Go(fyne.URIWriteCloser)//uri: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.URI() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URI)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URI)") return res0Obj }, }, @@ -144282,24 +142629,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URIWriteCloser(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.URIWriteCloser)//write: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.URIWriteCloser)//write: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URIWriteCloser) - if !ok { + if vc, ok := v.Value.(fyne.URIWriteCloser); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.URIWriteCloser)//write: arg 1: expected native of type fyne.URIWriteCloser") + return env.NewError("Go(fyne.URIWriteCloser)//write: arg 1: " + "expected native of type fyne.URIWriteCloser, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.URIWriteCloser)//write: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.URIWriteCloser)//write: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.URIWriteCloser)//write: arg 1: expected native") + return env.NewError("Go(fyne.URIWriteCloser)//write: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []byte switch v := arg1.(type) { @@ -144308,33 +142655,26 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg1Val[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + arg1Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.URIWriteCloser)//write: arg 2: block item: expected native of type byte") + return env.NewError("Go(fyne.URIWriteCloser)//write: arg 2: " + "block item: " + "expected native of type byte, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(fyne.URIWriteCloser)//write: arg 2: block item: expected native") + return env.NewError("Go(fyne.URIWriteCloser)//write: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]byte) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.URIWriteCloser)//write: arg 2: expected native of type []byte") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.URIWriteCloser)//write: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.URIWriteCloser)//write: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.URIWriteCloser)//write: arg 2: expected block, native or nil") + return env.NewError("Go(fyne.URIWriteCloser)//write: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Write(arg1Val) var res0Obj env.Object @@ -144361,50 +142701,50 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Validatable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Validatable)//set-on-validation-changed: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Validatable)//set-on-validation-changed: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Validatable) - if !ok { + if vc, ok := v.Value.(fyne.Validatable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Validatable)//set-on-validation-changed: arg 1: expected native of type fyne.Validatable") + return env.NewError("Go(fyne.Validatable)//set-on-validation-changed: arg 1: " + "expected native of type fyne.Validatable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Validatable)//set-on-validation-changed: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Validatable)//set-on-validation-changed: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Validatable)//set-on-validation-changed: arg 1: expected native") + return env.NewError("Go(fyne.Validatable)//set-on-validation-changed: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func(error) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(fyne.Validatable)//set-on-validation-changed: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(fyne.Validatable)//set-on-validation-changed: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg1Val = func(arg0 error) { - var arg0Val env.Object - if arg0 != nil { - arg0Val = env.NewError(arg0.Error()) + arg1Val = func(farg0 error) { + var farg0Val env.Object + if farg0 != nil { + farg0Val = env.NewError(farg0.Error()) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Validatable)//set-on-validation-changed: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Validatable)//set-on-validation-changed: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Validatable)//set-on-validation-changed: arg 2: expected function or nil") + return env.NewError("Go(fyne.Validatable)//set-on-validation-changed: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } arg0Val.SetOnValidationChanged(arg1Val) return arg0 @@ -144421,24 +142761,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Validatable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Validatable)//validate: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Validatable)//validate: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Validatable) - if !ok { + if vc, ok := v.Value.(fyne.Validatable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Validatable)//validate: arg 1: expected native of type fyne.Validatable") + return env.NewError("Go(fyne.Validatable)//validate: arg 1: " + "expected native of type fyne.Validatable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Validatable)//validate: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Validatable)//validate: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Validatable)//validate: arg 1: expected native") + return env.NewError("Go(fyne.Validatable)//validate: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Validate() var resErrObj env.Object @@ -144463,24 +142803,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Vector2(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Vector2)//components: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Vector2)//components: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Vector2) - if !ok { + if vc, ok := v.Value.(fyne.Vector2); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Vector2)//components: arg 1: expected native of type fyne.Vector2") + return env.NewError("Go(fyne.Vector2)//components: arg 1: " + "expected native of type fyne.Vector2, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Vector2)//components: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Vector2)//components: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Vector2)//components: arg 1: expected native") + return env.NewError("Go(fyne.Vector2)//components: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, res1 := arg0Val.Components() var res0Obj env.Object @@ -144504,24 +142844,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Vector2(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Vector2)//is-zero: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Vector2)//is-zero: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Vector2) - if !ok { + if vc, ok := v.Value.(fyne.Vector2); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Vector2)//is-zero: arg 1: expected native of type fyne.Vector2") + return env.NewError("Go(fyne.Vector2)//is-zero: arg 1: " + "expected native of type fyne.Vector2, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Vector2)//is-zero: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Vector2)//is-zero: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Vector2)//is-zero: arg 1: expected native") + return env.NewError("Go(fyne.Vector2)//is-zero: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.IsZero() var res0Obj env.Object @@ -144540,45 +142880,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//create-renderer: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Widget)//create-renderer: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//create-renderer: arg 1: expected native of type fyne.Widget") + return env.NewError("Go(fyne.Widget)//create-renderer: arg 1: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//create-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Widget)//create-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//create-renderer: arg 1: expected native") + return env.NewError("Go(fyne.Widget)//create-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.CreateRenderer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -144593,24 +142916,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//hide: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Widget)//hide: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//hide: arg 1: expected native of type fyne.Widget") + return env.NewError("Go(fyne.Widget)//hide: arg 1: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Widget)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//hide: arg 1: expected native") + return env.NewError("Go(fyne.Widget)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -144627,24 +142950,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//min-size: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Widget)//min-size: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//min-size: arg 1: expected native of type fyne.Widget") + return env.NewError("Go(fyne.Widget)//min-size: arg 1: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Widget)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//min-size: arg 1: expected native") + return env.NewError("Go(fyne.Widget)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -144663,45 +142986,39 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//move: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Widget)//move: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//move: arg 1: expected native of type fyne.Widget") + return env.NewError("Go(fyne.Widget)//move: arg 1: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Widget)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//move: arg 1: expected native") + return env.NewError("Go(fyne.Widget)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//move: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Widget)//move: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//move: arg 2: expected native") + return env.NewError("Go(fyne.Widget)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Move(*arg1Val) + arg0Val.Move(arg1Val) return arg0 }, }, @@ -144716,24 +143033,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//position: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Widget)//position: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//position: arg 1: expected native of type fyne.Widget") + return env.NewError("Go(fyne.Widget)//position: arg 1: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Widget)//position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//position: arg 1: expected native") + return env.NewError("Go(fyne.Widget)//position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Position() var res0Obj env.Object @@ -144752,24 +143069,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//refresh: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Widget)//refresh: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//refresh: arg 1: expected native of type fyne.Widget") + return env.NewError("Go(fyne.Widget)//refresh: arg 1: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Widget)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//refresh: arg 1: expected native") + return env.NewError("Go(fyne.Widget)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -144786,45 +143103,39 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//resize: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Widget)//resize: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//resize: arg 1: expected native of type fyne.Widget") + return env.NewError("Go(fyne.Widget)//resize: arg 1: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Widget)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//resize: arg 1: expected native") + return env.NewError("Go(fyne.Widget)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Widget)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//resize: arg 2: expected native") + return env.NewError("Go(fyne.Widget)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -144839,24 +143150,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//show: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Widget)//show: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//show: arg 1: expected native of type fyne.Widget") + return env.NewError("Go(fyne.Widget)//show: arg 1: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Widget)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//show: arg 1: expected native") + return env.NewError("Go(fyne.Widget)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -144873,24 +143184,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//size: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Widget)//size: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//size: arg 1: expected native of type fyne.Widget") + return env.NewError("Go(fyne.Widget)//size: arg 1: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Widget)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//size: arg 1: expected native") + return env.NewError("Go(fyne.Widget)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -144909,24 +143220,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//visible: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Widget)//visible: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//visible: arg 1: expected native of type fyne.Widget") + return env.NewError("Go(fyne.Widget)//visible: arg 1: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//visible: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Widget)//visible: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Widget)//visible: arg 1: expected native") + return env.NewError("Go(fyne.Widget)//visible: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visible() var res0Obj env.Object @@ -144945,24 +143256,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_WidgetRenderer(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.WidgetRenderer)//destroy: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.WidgetRenderer)//destroy: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.WidgetRenderer) - if !ok { + if vc, ok := v.Value.(fyne.WidgetRenderer); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.WidgetRenderer)//destroy: arg 1: expected native of type fyne.WidgetRenderer") + return env.NewError("Go(fyne.WidgetRenderer)//destroy: arg 1: " + "expected native of type fyne.WidgetRenderer, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.WidgetRenderer)//destroy: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.WidgetRenderer)//destroy: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.WidgetRenderer)//destroy: arg 1: expected native") + return env.NewError("Go(fyne.WidgetRenderer)//destroy: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Destroy() return arg0 @@ -144979,45 +143290,39 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_WidgetRenderer(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.WidgetRenderer)//layout: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.WidgetRenderer)//layout: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.WidgetRenderer) - if !ok { + if vc, ok := v.Value.(fyne.WidgetRenderer); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.WidgetRenderer)//layout: arg 1: expected native of type fyne.WidgetRenderer") + return env.NewError("Go(fyne.WidgetRenderer)//layout: arg 1: " + "expected native of type fyne.WidgetRenderer, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.WidgetRenderer)//layout: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.WidgetRenderer)//layout: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.WidgetRenderer)//layout: arg 1: expected native") + return env.NewError("Go(fyne.WidgetRenderer)//layout: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.WidgetRenderer)//layout: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.WidgetRenderer)//layout: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.WidgetRenderer)//layout: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.WidgetRenderer)//layout: arg 2: expected native") + return env.NewError("Go(fyne.WidgetRenderer)//layout: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Layout(*arg1Val) + arg0Val.Layout(arg1Val) return arg0 }, }, @@ -145032,24 +143337,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_WidgetRenderer(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.WidgetRenderer)//min-size: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.WidgetRenderer)//min-size: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.WidgetRenderer) - if !ok { + if vc, ok := v.Value.(fyne.WidgetRenderer); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.WidgetRenderer)//min-size: arg 1: expected native of type fyne.WidgetRenderer") + return env.NewError("Go(fyne.WidgetRenderer)//min-size: arg 1: " + "expected native of type fyne.WidgetRenderer, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.WidgetRenderer)//min-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.WidgetRenderer)//min-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.WidgetRenderer)//min-size: arg 1: expected native") + return env.NewError("Go(fyne.WidgetRenderer)//min-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MinSize() var res0Obj env.Object @@ -145068,48 +143373,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_WidgetRenderer(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.WidgetRenderer)//objects: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.WidgetRenderer)//objects: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.WidgetRenderer) - if !ok { + if vc, ok := v.Value.(fyne.WidgetRenderer); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.WidgetRenderer)//objects: arg 1: expected native of type fyne.WidgetRenderer") + return env.NewError("Go(fyne.WidgetRenderer)//objects: arg 1: " + "expected native of type fyne.WidgetRenderer, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.WidgetRenderer)//objects: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.WidgetRenderer)//objects: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.WidgetRenderer)//objects: arg 1: expected native") + return env.NewError("Go(fyne.WidgetRenderer)//objects: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Objects() var res0Obj env.Object { items := make([]env.Object, len(res0)) for i, it := range res0 { - { - typ := reflect.TypeOf(it) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - items[i] = *env.NewNative(ps.Idx, it, typRyeName) - } else { - items[i] = *env.NewNative(ps.Idx, it, "Go(fyne.CanvasObject)") - } - } + items[i] = ifaceToNative(ps.Idx, it, "Go(fyne.CanvasObject)") } res0Obj = *env.NewBlock(*env.NewTSeries(items)) } @@ -145127,24 +143415,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_WidgetRenderer(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.WidgetRenderer)//refresh: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.WidgetRenderer)//refresh: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.WidgetRenderer) - if !ok { + if vc, ok := v.Value.(fyne.WidgetRenderer); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.WidgetRenderer)//refresh: arg 1: expected native of type fyne.WidgetRenderer") + return env.NewError("Go(fyne.WidgetRenderer)//refresh: arg 1: " + "expected native of type fyne.WidgetRenderer, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.WidgetRenderer)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.WidgetRenderer)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.WidgetRenderer)//refresh: arg 1: expected native") + return env.NewError("Go(fyne.WidgetRenderer)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh() return arg0 @@ -145161,45 +143449,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//canvas: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Window)//canvas: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//canvas: arg 1: expected native of type fyne.Window") + return env.NewError("Go(fyne.Window)//canvas: arg 1: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//canvas: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//canvas: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//canvas: arg 1: expected native") + return env.NewError("Go(fyne.Window)//canvas: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Canvas() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Canvas)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Canvas)") return res0Obj }, }, @@ -145214,24 +143485,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//center-on-screen: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Window)//center-on-screen: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//center-on-screen: arg 1: expected native of type fyne.Window") + return env.NewError("Go(fyne.Window)//center-on-screen: arg 1: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//center-on-screen: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//center-on-screen: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//center-on-screen: arg 1: expected native") + return env.NewError("Go(fyne.Window)//center-on-screen: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.CenterOnScreen() return arg0 @@ -145248,45 +143519,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//clipboard: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Window)//clipboard: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//clipboard: arg 1: expected native of type fyne.Window") + return env.NewError("Go(fyne.Window)//clipboard: arg 1: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//clipboard: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//clipboard: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//clipboard: arg 1: expected native") + return env.NewError("Go(fyne.Window)//clipboard: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Clipboard() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Clipboard)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Clipboard)") return res0Obj }, }, @@ -145301,24 +143555,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//close: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Window)//close: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//close: arg 1: expected native of type fyne.Window") + return env.NewError("Go(fyne.Window)//close: arg 1: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//close: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//close: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//close: arg 1: expected native") + return env.NewError("Go(fyne.Window)//close: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Close() return arg0 @@ -145335,45 +143589,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//content: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Window)//content: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//content: arg 1: expected native of type fyne.Window") + return env.NewError("Go(fyne.Window)//content: arg 1: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//content: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//content: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//content: arg 1: expected native") + return env.NewError("Go(fyne.Window)//content: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Content() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.CanvasObject)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.CanvasObject)") return res0Obj }, }, @@ -145388,24 +143625,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//fixed-size: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Window)//fixed-size: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//fixed-size: arg 1: expected native of type fyne.Window") + return env.NewError("Go(fyne.Window)//fixed-size: arg 1: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//fixed-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//fixed-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//fixed-size: arg 1: expected native") + return env.NewError("Go(fyne.Window)//fixed-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.FixedSize() var res0Obj env.Object @@ -145424,24 +143661,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//full-screen: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Window)//full-screen: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//full-screen: arg 1: expected native of type fyne.Window") + return env.NewError("Go(fyne.Window)//full-screen: arg 1: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//full-screen: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//full-screen: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//full-screen: arg 1: expected native") + return env.NewError("Go(fyne.Window)//full-screen: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.FullScreen() var res0Obj env.Object @@ -145460,24 +143697,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//hide: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Window)//hide: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//hide: arg 1: expected native of type fyne.Window") + return env.NewError("Go(fyne.Window)//hide: arg 1: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//hide: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//hide: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//hide: arg 1: expected native") + return env.NewError("Go(fyne.Window)//hide: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Hide() return arg0 @@ -145494,45 +143731,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//icon: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Window)//icon: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//icon: arg 1: expected native of type fyne.Window") + return env.NewError("Go(fyne.Window)//icon: arg 1: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//icon: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//icon: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//icon: arg 1: expected native") + return env.NewError("Go(fyne.Window)//icon: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Icon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -145547,24 +143767,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//main-menu: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Window)//main-menu: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//main-menu: arg 1: expected native of type fyne.Window") + return env.NewError("Go(fyne.Window)//main-menu: arg 1: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//main-menu: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//main-menu: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//main-menu: arg 1: expected native") + return env.NewError("Go(fyne.Window)//main-menu: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.MainMenu() var res0Obj env.Object @@ -145583,24 +143803,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//padded: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Window)//padded: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//padded: arg 1: expected native of type fyne.Window") + return env.NewError("Go(fyne.Window)//padded: arg 1: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//padded: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//padded: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//padded: arg 1: expected native") + return env.NewError("Go(fyne.Window)//padded: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Padded() var res0Obj env.Object @@ -145619,24 +143839,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//request-focus: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Window)//request-focus: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//request-focus: arg 1: expected native of type fyne.Window") + return env.NewError("Go(fyne.Window)//request-focus: arg 1: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//request-focus: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//request-focus: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//request-focus: arg 1: expected native") + return env.NewError("Go(fyne.Window)//request-focus: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RequestFocus() return arg0 @@ -145653,45 +143873,39 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//resize: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Window)//resize: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//resize: arg 1: expected native of type fyne.Window") + return env.NewError("Go(fyne.Window)//resize: arg 1: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//resize: arg 1: expected native") + return env.NewError("Go(fyne.Window)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//resize: arg 2: expected native") + return env.NewError("Go(fyne.Window)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -145706,31 +143920,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-close-intercept: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Window)//set-close-intercept: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-close-intercept: arg 1: expected native of type fyne.Window") + return env.NewError("Go(fyne.Window)//set-close-intercept: arg 1: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-close-intercept: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//set-close-intercept: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-close-intercept: arg 1: expected native") + return env.NewError("Go(fyne.Window)//set-close-intercept: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func() switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-close-intercept: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(fyne.Window)//set-close-intercept: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } arg1Val = func() { actualFn := fn @@ -145740,12 +143954,12 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-close-intercept: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//set-close-intercept: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-close-intercept: arg 2: expected function or nil") + return env.NewError("Go(fyne.Window)//set-close-intercept: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } arg0Val.SetCloseIntercept(arg1Val) return arg0 @@ -145762,24 +143976,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-content: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Window)//set-content: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-content: arg 1: expected native of type fyne.Window") + return env.NewError("Go(fyne.Window)//set-content: arg 1: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-content: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//set-content: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-content: arg 1: expected native") + return env.NewError("Go(fyne.Window)//set-content: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.CanvasObject switch v := arg1.(type) { @@ -145788,24 +144002,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-content: arg 2: " + err.Error() + "") + return env.NewError("Go(fyne.Window)//set-content: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-content: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("Go(fyne.Window)//set-content: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-content: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//set-content: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-content: arg 2: expected native") + return env.NewError("Go(fyne.Window)//set-content: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetContent(arg1Val) return arg0 @@ -145822,31 +144036,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-fixed-size: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Window)//set-fixed-size: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-fixed-size: arg 1: expected native of type fyne.Window") + return env.NewError("Go(fyne.Window)//set-fixed-size: arg 1: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-fixed-size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//set-fixed-size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-fixed-size: arg 1: expected native") + return env.NewError("Go(fyne.Window)//set-fixed-size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val bool - if v, ok := arg1.(env.Integer); ok { - arg1Val = v.Value != 0 + if vc, ok := arg1.(env.Integer); ok { + arg1Val = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-fixed-size: arg 2: expected integer") + return env.NewError("Go(fyne.Window)//set-fixed-size: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetFixedSize(arg1Val) return arg0 @@ -145863,31 +144077,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-full-screen: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Window)//set-full-screen: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-full-screen: arg 1: expected native of type fyne.Window") + return env.NewError("Go(fyne.Window)//set-full-screen: arg 1: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-full-screen: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//set-full-screen: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-full-screen: arg 1: expected native") + return env.NewError("Go(fyne.Window)//set-full-screen: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val bool - if v, ok := arg1.(env.Integer); ok { - arg1Val = v.Value != 0 + if vc, ok := arg1.(env.Integer); ok { + arg1Val = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-full-screen: arg 2: expected integer") + return env.NewError("Go(fyne.Window)//set-full-screen: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetFullScreen(arg1Val) return arg0 @@ -145904,24 +144118,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-icon: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Window)//set-icon: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-icon: arg 1: expected native of type fyne.Window") + return env.NewError("Go(fyne.Window)//set-icon: arg 1: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-icon: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//set-icon: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-icon: arg 1: expected native") + return env.NewError("Go(fyne.Window)//set-icon: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Resource switch v := arg1.(type) { @@ -145930,24 +144144,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Resource(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-icon: arg 2: " + err.Error() + "") + return env.NewError("Go(fyne.Window)//set-icon: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-icon: arg 2: expected native of type fyne.Resource") + return env.NewError("Go(fyne.Window)//set-icon: arg 2: " + "expected native of type fyne.Resource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-icon: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//set-icon: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-icon: arg 2: expected native") + return env.NewError("Go(fyne.Window)//set-icon: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetIcon(arg1Val) return arg0 @@ -145964,43 +144178,43 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-main-menu: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Window)//set-main-menu: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-main-menu: arg 1: expected native of type fyne.Window") + return env.NewError("Go(fyne.Window)//set-main-menu: arg 1: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-main-menu: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//set-main-menu: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-main-menu: arg 1: expected native") + return env.NewError("Go(fyne.Window)//set-main-menu: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.MainMenu switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.MainMenu) - if !ok { + if vc, ok := v.Value.(*fyne.MainMenu); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-main-menu: arg 2: expected native of type *fyne.MainMenu") + return env.NewError("Go(fyne.Window)//set-main-menu: arg 2: " + "expected native of type *fyne.MainMenu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-main-menu: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//set-main-menu: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-main-menu: arg 2: expected native") + return env.NewError("Go(fyne.Window)//set-main-menu: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetMainMenu(arg1Val) return arg0 @@ -146017,24 +144231,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-master: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Window)//set-master: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-master: arg 1: expected native of type fyne.Window") + return env.NewError("Go(fyne.Window)//set-master: arg 1: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-master: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//set-master: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-master: arg 1: expected native") + return env.NewError("Go(fyne.Window)//set-master: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetMaster() return arg0 @@ -146051,31 +144265,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-on-closed: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Window)//set-on-closed: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-on-closed: arg 1: expected native of type fyne.Window") + return env.NewError("Go(fyne.Window)//set-on-closed: arg 1: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-on-closed: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//set-on-closed: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-on-closed: arg 1: expected native") + return env.NewError("Go(fyne.Window)//set-on-closed: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func() switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-on-closed: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("Go(fyne.Window)//set-on-closed: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } arg1Val = func() { actualFn := fn @@ -146085,12 +144299,12 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-on-closed: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//set-on-closed: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-on-closed: arg 2: expected function or nil") + return env.NewError("Go(fyne.Window)//set-on-closed: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } arg0Val.SetOnClosed(arg1Val) return arg0 @@ -146107,72 +144321,55 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-on-dropped: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Window)//set-on-dropped: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-on-dropped: arg 1: expected native of type fyne.Window") + return env.NewError("Go(fyne.Window)//set-on-dropped: arg 1: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-on-dropped: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//set-on-dropped: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-on-dropped: arg 1: expected native") + return env.NewError("Go(fyne.Window)//set-on-dropped: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func(fyne.Position, []fyne.URI) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 2 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-on-dropped: arg 2: function has invalid number of arguments (expected 2)") + return env.NewError("Go(fyne.Window)//set-on-dropped: arg 2: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg1Val = func(arg0 fyne.Position, arg1 []fyne.URI) { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewNative(ps.Idx, &arg0, "Go(*fyne.Position)") + arg1Val = func(farg0 fyne.Position, farg1 []fyne.URI) { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewNative(ps.Idx, &farg0, "Go(*fyne.Position)") { - items := make([]env.Object, len(arg1)) - for i, it := range arg1 { - { - typ := reflect.TypeOf(it) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - items[i] = *env.NewNative(ps.Idx, it, typRyeName) - } else { - items[i] = *env.NewNative(ps.Idx, it, "Go(fyne.URI)") - } - } + items := make([]env.Object, len(farg1)) + for i, it := range farg1 { + items[i] = ifaceToNative(ps.Idx, it, "Go(fyne.URI)") } - arg1Val = *env.NewBlock(*env.NewTSeries(items)) + farg1Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val, farg1Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-on-dropped: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//set-on-dropped: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-on-dropped: arg 2: expected function or nil") + return env.NewError("Go(fyne.Window)//set-on-dropped: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } arg0Val.SetOnDropped(arg1Val) return arg0 @@ -146189,31 +144386,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-padded: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Window)//set-padded: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-padded: arg 1: expected native of type fyne.Window") + return env.NewError("Go(fyne.Window)//set-padded: arg 1: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-padded: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//set-padded: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-padded: arg 1: expected native") + return env.NewError("Go(fyne.Window)//set-padded: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val bool - if v, ok := arg1.(env.Integer); ok { - arg1Val = v.Value != 0 + if vc, ok := arg1.(env.Integer); ok { + arg1Val = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-padded: arg 2: expected integer") + return env.NewError("Go(fyne.Window)//set-padded: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetPadded(arg1Val) return arg0 @@ -146230,31 +144427,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-title: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Window)//set-title: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-title: arg 1: expected native of type fyne.Window") + return env.NewError("Go(fyne.Window)//set-title: arg 1: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-title: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//set-title: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-title: arg 1: expected native") + return env.NewError("Go(fyne.Window)//set-title: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//set-title: arg 2: expected string") + return env.NewError("Go(fyne.Window)//set-title: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetTitle(arg1Val) return arg0 @@ -146271,24 +144468,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//show: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Window)//show: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//show: arg 1: expected native of type fyne.Window") + return env.NewError("Go(fyne.Window)//show: arg 1: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//show: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//show: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//show: arg 1: expected native") + return env.NewError("Go(fyne.Window)//show: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Show() return arg0 @@ -146305,24 +144502,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//show-and-run: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Window)//show-and-run: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//show-and-run: arg 1: expected native of type fyne.Window") + return env.NewError("Go(fyne.Window)//show-and-run: arg 1: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//show-and-run: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//show-and-run: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//show-and-run: arg 1: expected native") + return env.NewError("Go(fyne.Window)//show-and-run: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ShowAndRun() return arg0 @@ -146339,24 +144536,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//title: arg 1: " + err.Error() + "") + return env.NewError("Go(fyne.Window)//title: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//title: arg 1: expected native of type fyne.Window") + return env.NewError("Go(fyne.Window)//title: arg 1: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//title: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(fyne.Window)//title: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(fyne.Window)//title: arg 1: expected native") + return env.NewError("Go(fyne.Window)//title: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Title() var res0Obj env.Object @@ -146375,24 +144572,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_layout_SpacerObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(layout.SpacerObject)//expand-horizontal: arg 1: " + err.Error() + "") + return env.NewError("Go(layout.SpacerObject)//expand-horizontal: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(layout.SpacerObject) - if !ok { + if vc, ok := v.Value.(layout.SpacerObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(layout.SpacerObject)//expand-horizontal: arg 1: expected native of type layout.SpacerObject") + return env.NewError("Go(layout.SpacerObject)//expand-horizontal: arg 1: " + "expected native of type layout.SpacerObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(layout.SpacerObject)//expand-horizontal: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(layout.SpacerObject)//expand-horizontal: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(layout.SpacerObject)//expand-horizontal: arg 1: expected native") + return env.NewError("Go(layout.SpacerObject)//expand-horizontal: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.ExpandHorizontal() var res0Obj env.Object @@ -146411,24 +144608,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_layout_SpacerObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(layout.SpacerObject)//expand-vertical: arg 1: " + err.Error() + "") + return env.NewError("Go(layout.SpacerObject)//expand-vertical: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(layout.SpacerObject) - if !ok { + if vc, ok := v.Value.(layout.SpacerObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(layout.SpacerObject)//expand-vertical: arg 1: expected native of type layout.SpacerObject") + return env.NewError("Go(layout.SpacerObject)//expand-vertical: arg 1: " + "expected native of type layout.SpacerObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(layout.SpacerObject)//expand-vertical: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(layout.SpacerObject)//expand-vertical: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(layout.SpacerObject)//expand-vertical: arg 1: expected native") + return env.NewError("Go(layout.SpacerObject)//expand-vertical: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.ExpandVertical() var res0Obj env.Object @@ -146447,24 +144644,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_mobile_Device(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(mobile.Device)//hide-virtual-keyboard: arg 1: " + err.Error() + "") + return env.NewError("Go(mobile.Device)//hide-virtual-keyboard: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(mobile.Device) - if !ok { + if vc, ok := v.Value.(mobile.Device); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(mobile.Device)//hide-virtual-keyboard: arg 1: expected native of type mobile.Device") + return env.NewError("Go(mobile.Device)//hide-virtual-keyboard: arg 1: " + "expected native of type mobile.Device, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(mobile.Device)//hide-virtual-keyboard: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(mobile.Device)//hide-virtual-keyboard: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(mobile.Device)//hide-virtual-keyboard: arg 1: expected native") + return env.NewError("Go(mobile.Device)//hide-virtual-keyboard: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.HideVirtualKeyboard() return arg0 @@ -146481,24 +144678,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_mobile_Device(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(mobile.Device)//show-virtual-keyboard: arg 1: " + err.Error() + "") + return env.NewError("Go(mobile.Device)//show-virtual-keyboard: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(mobile.Device) - if !ok { + if vc, ok := v.Value.(mobile.Device); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(mobile.Device)//show-virtual-keyboard: arg 1: expected native of type mobile.Device") + return env.NewError("Go(mobile.Device)//show-virtual-keyboard: arg 1: " + "expected native of type mobile.Device, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(mobile.Device)//show-virtual-keyboard: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(mobile.Device)//show-virtual-keyboard: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(mobile.Device)//show-virtual-keyboard: arg 1: expected native") + return env.NewError("Go(mobile.Device)//show-virtual-keyboard: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.ShowVirtualKeyboard() return arg0 @@ -146515,24 +144712,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_mobile_Device(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(mobile.Device)//show-virtual-keyboard-type: arg 1: " + err.Error() + "") + return env.NewError("Go(mobile.Device)//show-virtual-keyboard-type: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(mobile.Device) - if !ok { + if vc, ok := v.Value.(mobile.Device); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(mobile.Device)//show-virtual-keyboard-type: arg 1: expected native of type mobile.Device") + return env.NewError("Go(mobile.Device)//show-virtual-keyboard-type: arg 1: " + "expected native of type mobile.Device, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(mobile.Device)//show-virtual-keyboard-type: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(mobile.Device)//show-virtual-keyboard-type: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(mobile.Device)//show-virtual-keyboard-type: arg 1: expected native") + return env.NewError("Go(mobile.Device)//show-virtual-keyboard-type: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val mobile.KeyboardType { @@ -146546,11 +144743,11 @@ var Builtins = map[string]*env.Builtin{ arg1Val = natVal } else { var u int32 - if v, ok := arg1.(env.Integer); ok { - u = int32(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(mobile.Device)//show-virtual-keyboard-type: arg 2: expected integer") + return env.NewError("Go(mobile.Device)//show-virtual-keyboard-type: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg1Val = mobile.KeyboardType(u) } @@ -146570,24 +144767,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_mobile_Driver(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(mobile.Driver)//go-back: arg 1: " + err.Error() + "") + return env.NewError("Go(mobile.Driver)//go-back: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(mobile.Driver) - if !ok { + if vc, ok := v.Value.(mobile.Driver); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(mobile.Driver)//go-back: arg 1: expected native of type mobile.Driver") + return env.NewError("Go(mobile.Driver)//go-back: arg 1: " + "expected native of type mobile.Driver, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(mobile.Driver)//go-back: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(mobile.Driver)//go-back: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(mobile.Driver)//go-back: arg 1: expected native") + return env.NewError("Go(mobile.Driver)//go-back: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.GoBack() return arg0 @@ -146604,24 +144801,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_mobile_Keyboardable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(mobile.Keyboardable)//focus-gained: arg 1: " + err.Error() + "") + return env.NewError("Go(mobile.Keyboardable)//focus-gained: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(mobile.Keyboardable) - if !ok { + if vc, ok := v.Value.(mobile.Keyboardable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(mobile.Keyboardable)//focus-gained: arg 1: expected native of type mobile.Keyboardable") + return env.NewError("Go(mobile.Keyboardable)//focus-gained: arg 1: " + "expected native of type mobile.Keyboardable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(mobile.Keyboardable)//focus-gained: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(mobile.Keyboardable)//focus-gained: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(mobile.Keyboardable)//focus-gained: arg 1: expected native") + return env.NewError("Go(mobile.Keyboardable)//focus-gained: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusGained() return arg0 @@ -146638,24 +144835,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_mobile_Keyboardable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(mobile.Keyboardable)//focus-lost: arg 1: " + err.Error() + "") + return env.NewError("Go(mobile.Keyboardable)//focus-lost: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(mobile.Keyboardable) - if !ok { + if vc, ok := v.Value.(mobile.Keyboardable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(mobile.Keyboardable)//focus-lost: arg 1: expected native of type mobile.Keyboardable") + return env.NewError("Go(mobile.Keyboardable)//focus-lost: arg 1: " + "expected native of type mobile.Keyboardable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(mobile.Keyboardable)//focus-lost: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(mobile.Keyboardable)//focus-lost: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(mobile.Keyboardable)//focus-lost: arg 1: expected native") + return env.NewError("Go(mobile.Keyboardable)//focus-lost: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusLost() return arg0 @@ -146672,24 +144869,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_mobile_Keyboardable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(mobile.Keyboardable)//keyboard: arg 1: " + err.Error() + "") + return env.NewError("Go(mobile.Keyboardable)//keyboard: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(mobile.Keyboardable) - if !ok { + if vc, ok := v.Value.(mobile.Keyboardable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(mobile.Keyboardable)//keyboard: arg 1: expected native of type mobile.Keyboardable") + return env.NewError("Go(mobile.Keyboardable)//keyboard: arg 1: " + "expected native of type mobile.Keyboardable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(mobile.Keyboardable)//keyboard: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(mobile.Keyboardable)//keyboard: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(mobile.Keyboardable)//keyboard: arg 1: expected native") + return env.NewError("Go(mobile.Keyboardable)//keyboard: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Keyboard() var res0Obj env.Object @@ -146708,43 +144905,43 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_mobile_Keyboardable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(mobile.Keyboardable)//typed-key: arg 1: " + err.Error() + "") + return env.NewError("Go(mobile.Keyboardable)//typed-key: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(mobile.Keyboardable) - if !ok { + if vc, ok := v.Value.(mobile.Keyboardable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(mobile.Keyboardable)//typed-key: arg 1: expected native of type mobile.Keyboardable") + return env.NewError("Go(mobile.Keyboardable)//typed-key: arg 1: " + "expected native of type mobile.Keyboardable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(mobile.Keyboardable)//typed-key: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(mobile.Keyboardable)//typed-key: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(mobile.Keyboardable)//typed-key: arg 1: expected native") + return env.NewError("Go(mobile.Keyboardable)//typed-key: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.KeyEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.KeyEvent) - if !ok { + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(mobile.Keyboardable)//typed-key: arg 2: expected native of type *fyne.KeyEvent") + return env.NewError("Go(mobile.Keyboardable)//typed-key: arg 2: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(mobile.Keyboardable)//typed-key: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(mobile.Keyboardable)//typed-key: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(mobile.Keyboardable)//typed-key: arg 2: expected native") + return env.NewError("Go(mobile.Keyboardable)//typed-key: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedKey(arg1Val) return arg0 @@ -146761,37 +144958,37 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_mobile_Keyboardable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(mobile.Keyboardable)//typed-rune: arg 1: " + err.Error() + "") + return env.NewError("Go(mobile.Keyboardable)//typed-rune: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(mobile.Keyboardable) - if !ok { + if vc, ok := v.Value.(mobile.Keyboardable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(mobile.Keyboardable)//typed-rune: arg 1: expected native of type mobile.Keyboardable") + return env.NewError("Go(mobile.Keyboardable)//typed-rune: arg 1: " + "expected native of type mobile.Keyboardable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(mobile.Keyboardable)//typed-rune: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(mobile.Keyboardable)//typed-rune: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(mobile.Keyboardable)//typed-rune: arg 1: expected native") + return env.NewError("Go(mobile.Keyboardable)//typed-rune: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val rune switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(rune) - if !ok { + if vc, ok := v.Value.(rune); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(mobile.Keyboardable)//typed-rune: arg 2: expected native of type rune") + return env.NewError("Go(mobile.Keyboardable)//typed-rune: arg 2: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("Go(mobile.Keyboardable)//typed-rune: arg 2: expected native") + return env.NewError("Go(mobile.Keyboardable)//typed-rune: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TypedRune(arg1Val) return arg0 @@ -146808,43 +145005,43 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_mobile_Touchable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(mobile.Touchable)//touch-cancel: arg 1: " + err.Error() + "") + return env.NewError("Go(mobile.Touchable)//touch-cancel: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(mobile.Touchable) - if !ok { + if vc, ok := v.Value.(mobile.Touchable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(mobile.Touchable)//touch-cancel: arg 1: expected native of type mobile.Touchable") + return env.NewError("Go(mobile.Touchable)//touch-cancel: arg 1: " + "expected native of type mobile.Touchable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(mobile.Touchable)//touch-cancel: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(mobile.Touchable)//touch-cancel: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(mobile.Touchable)//touch-cancel: arg 1: expected native") + return env.NewError("Go(mobile.Touchable)//touch-cancel: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *mobile.TouchEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*mobile.TouchEvent) - if !ok { + if vc, ok := v.Value.(*mobile.TouchEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(mobile.Touchable)//touch-cancel: arg 2: expected native of type *mobile.TouchEvent") + return env.NewError("Go(mobile.Touchable)//touch-cancel: arg 2: " + "expected native of type *mobile.TouchEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(mobile.Touchable)//touch-cancel: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(mobile.Touchable)//touch-cancel: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(mobile.Touchable)//touch-cancel: arg 2: expected native") + return env.NewError("Go(mobile.Touchable)//touch-cancel: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TouchCancel(arg1Val) return arg0 @@ -146861,43 +145058,43 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_mobile_Touchable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(mobile.Touchable)//touch-down: arg 1: " + err.Error() + "") + return env.NewError("Go(mobile.Touchable)//touch-down: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(mobile.Touchable) - if !ok { + if vc, ok := v.Value.(mobile.Touchable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(mobile.Touchable)//touch-down: arg 1: expected native of type mobile.Touchable") + return env.NewError("Go(mobile.Touchable)//touch-down: arg 1: " + "expected native of type mobile.Touchable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(mobile.Touchable)//touch-down: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(mobile.Touchable)//touch-down: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(mobile.Touchable)//touch-down: arg 1: expected native") + return env.NewError("Go(mobile.Touchable)//touch-down: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *mobile.TouchEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*mobile.TouchEvent) - if !ok { + if vc, ok := v.Value.(*mobile.TouchEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(mobile.Touchable)//touch-down: arg 2: expected native of type *mobile.TouchEvent") + return env.NewError("Go(mobile.Touchable)//touch-down: arg 2: " + "expected native of type *mobile.TouchEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(mobile.Touchable)//touch-down: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(mobile.Touchable)//touch-down: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(mobile.Touchable)//touch-down: arg 2: expected native") + return env.NewError("Go(mobile.Touchable)//touch-down: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TouchDown(arg1Val) return arg0 @@ -146914,43 +145111,43 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_mobile_Touchable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(mobile.Touchable)//touch-up: arg 1: " + err.Error() + "") + return env.NewError("Go(mobile.Touchable)//touch-up: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(mobile.Touchable) - if !ok { + if vc, ok := v.Value.(mobile.Touchable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(mobile.Touchable)//touch-up: arg 1: expected native of type mobile.Touchable") + return env.NewError("Go(mobile.Touchable)//touch-up: arg 1: " + "expected native of type mobile.Touchable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(mobile.Touchable)//touch-up: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(mobile.Touchable)//touch-up: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(mobile.Touchable)//touch-up: arg 1: expected native") + return env.NewError("Go(mobile.Touchable)//touch-up: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *mobile.TouchEvent switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*mobile.TouchEvent) - if !ok { + if vc, ok := v.Value.(*mobile.TouchEvent); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(mobile.Touchable)//touch-up: arg 2: expected native of type *mobile.TouchEvent") + return env.NewError("Go(mobile.Touchable)//touch-up: arg 2: " + "expected native of type *mobile.TouchEvent, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(mobile.Touchable)//touch-up: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(mobile.Touchable)//touch-up: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(mobile.Touchable)//touch-up: arg 2: expected native") + return env.NewError("Go(mobile.Touchable)//touch-up: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.TouchUp(arg1Val) return arg0 @@ -146967,24 +145164,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_CopyableRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//can-read: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.CopyableRepository)//can-read: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.CopyableRepository) - if !ok { + if vc, ok := v.Value.(repository.CopyableRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//can-read: arg 1: expected native of type repository.CopyableRepository") + return env.NewError("Go(repository.CopyableRepository)//can-read: arg 1: " + "expected native of type repository.CopyableRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//can-read: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.CopyableRepository)//can-read: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//can-read: arg 1: expected native") + return env.NewError("Go(repository.CopyableRepository)//can-read: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -146993,24 +145190,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//can-read: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.CopyableRepository)//can-read: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//can-read: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.CopyableRepository)//can-read: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//can-read: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.CopyableRepository)//can-read: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//can-read: arg 2: expected native") + return env.NewError("Go(repository.CopyableRepository)//can-read: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.CanRead(arg1Val) var res0Obj env.Object @@ -147037,24 +145234,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_CopyableRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//copy: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.CopyableRepository)//copy: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.CopyableRepository) - if !ok { + if vc, ok := v.Value.(repository.CopyableRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//copy: arg 1: expected native of type repository.CopyableRepository") + return env.NewError("Go(repository.CopyableRepository)//copy: arg 1: " + "expected native of type repository.CopyableRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//copy: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.CopyableRepository)//copy: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//copy: arg 1: expected native") + return env.NewError("Go(repository.CopyableRepository)//copy: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -147063,24 +145260,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//copy: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.CopyableRepository)//copy: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//copy: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.CopyableRepository)//copy: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//copy: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.CopyableRepository)//copy: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//copy: arg 2: expected native") + return env.NewError("Go(repository.CopyableRepository)//copy: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg2Val fyne.URI switch v := arg2.(type) { @@ -147089,24 +145286,24 @@ var Builtins = map[string]*env.Builtin{ arg2Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//copy: arg 3: " + err.Error() + "") + return env.NewError("Go(repository.CopyableRepository)//copy: arg 3: " + err.Error()) } case env.Native: - var ok bool - arg2Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//copy: arg 3: expected native of type fyne.URI") + return env.NewError("Go(repository.CopyableRepository)//copy: arg 3: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//copy: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(repository.CopyableRepository)//copy: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//copy: arg 3: expected native") + return env.NewError("Go(repository.CopyableRepository)//copy: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Copy(arg1Val, arg2Val) var resErrObj env.Object @@ -147131,31 +145328,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_CopyableRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//destroy: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.CopyableRepository)//destroy: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.CopyableRepository) - if !ok { + if vc, ok := v.Value.(repository.CopyableRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//destroy: arg 1: expected native of type repository.CopyableRepository") + return env.NewError("Go(repository.CopyableRepository)//destroy: arg 1: " + "expected native of type repository.CopyableRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//destroy: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.CopyableRepository)//destroy: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//destroy: arg 1: expected native") + return env.NewError("Go(repository.CopyableRepository)//destroy: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//destroy: arg 2: expected string") + return env.NewError("Go(repository.CopyableRepository)//destroy: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.Destroy(arg1Val) return arg0 @@ -147172,24 +145369,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_CopyableRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//exists: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.CopyableRepository)//exists: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.CopyableRepository) - if !ok { + if vc, ok := v.Value.(repository.CopyableRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//exists: arg 1: expected native of type repository.CopyableRepository") + return env.NewError("Go(repository.CopyableRepository)//exists: arg 1: " + "expected native of type repository.CopyableRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//exists: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.CopyableRepository)//exists: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//exists: arg 1: expected native") + return env.NewError("Go(repository.CopyableRepository)//exists: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -147198,24 +145395,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//exists: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.CopyableRepository)//exists: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//exists: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.CopyableRepository)//exists: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//exists: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.CopyableRepository)//exists: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//exists: arg 2: expected native") + return env.NewError("Go(repository.CopyableRepository)//exists: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Exists(arg1Val) var res0Obj env.Object @@ -147242,24 +145439,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_CopyableRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//reader: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.CopyableRepository)//reader: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.CopyableRepository) - if !ok { + if vc, ok := v.Value.(repository.CopyableRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//reader: arg 1: expected native of type repository.CopyableRepository") + return env.NewError("Go(repository.CopyableRepository)//reader: arg 1: " + "expected native of type repository.CopyableRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//reader: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.CopyableRepository)//reader: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//reader: arg 1: expected native") + return env.NewError("Go(repository.CopyableRepository)//reader: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -147268,45 +145465,28 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//reader: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.CopyableRepository)//reader: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//reader: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.CopyableRepository)//reader: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//reader: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.CopyableRepository)//reader: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.CopyableRepository)//reader: arg 2: expected native") + return env.NewError("Go(repository.CopyableRepository)//reader: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Reader(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URIReadCloser)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URIReadCloser)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -147329,24 +145509,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_CustomURIRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//can-read: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.CustomURIRepository)//can-read: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.CustomURIRepository) - if !ok { + if vc, ok := v.Value.(repository.CustomURIRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//can-read: arg 1: expected native of type repository.CustomURIRepository") + return env.NewError("Go(repository.CustomURIRepository)//can-read: arg 1: " + "expected native of type repository.CustomURIRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//can-read: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.CustomURIRepository)//can-read: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//can-read: arg 1: expected native") + return env.NewError("Go(repository.CustomURIRepository)//can-read: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -147355,24 +145535,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//can-read: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.CustomURIRepository)//can-read: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//can-read: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.CustomURIRepository)//can-read: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//can-read: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.CustomURIRepository)//can-read: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//can-read: arg 2: expected native") + return env.NewError("Go(repository.CustomURIRepository)//can-read: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.CanRead(arg1Val) var res0Obj env.Object @@ -147399,31 +145579,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_CustomURIRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//destroy: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.CustomURIRepository)//destroy: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.CustomURIRepository) - if !ok { + if vc, ok := v.Value.(repository.CustomURIRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//destroy: arg 1: expected native of type repository.CustomURIRepository") + return env.NewError("Go(repository.CustomURIRepository)//destroy: arg 1: " + "expected native of type repository.CustomURIRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//destroy: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.CustomURIRepository)//destroy: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//destroy: arg 1: expected native") + return env.NewError("Go(repository.CustomURIRepository)//destroy: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//destroy: arg 2: expected string") + return env.NewError("Go(repository.CustomURIRepository)//destroy: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.Destroy(arg1Val) return arg0 @@ -147440,24 +145620,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_CustomURIRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//exists: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.CustomURIRepository)//exists: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.CustomURIRepository) - if !ok { + if vc, ok := v.Value.(repository.CustomURIRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//exists: arg 1: expected native of type repository.CustomURIRepository") + return env.NewError("Go(repository.CustomURIRepository)//exists: arg 1: " + "expected native of type repository.CustomURIRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//exists: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.CustomURIRepository)//exists: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//exists: arg 1: expected native") + return env.NewError("Go(repository.CustomURIRepository)//exists: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -147466,24 +145646,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//exists: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.CustomURIRepository)//exists: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//exists: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.CustomURIRepository)//exists: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//exists: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.CustomURIRepository)//exists: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//exists: arg 2: expected native") + return env.NewError("Go(repository.CustomURIRepository)//exists: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Exists(arg1Val) var res0Obj env.Object @@ -147510,52 +145690,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_CustomURIRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//parse-uri: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.CustomURIRepository)//parse-uri: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.CustomURIRepository) - if !ok { + if vc, ok := v.Value.(repository.CustomURIRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//parse-uri: arg 1: expected native of type repository.CustomURIRepository") + return env.NewError("Go(repository.CustomURIRepository)//parse-uri: arg 1: " + "expected native of type repository.CustomURIRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//parse-uri: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.CustomURIRepository)//parse-uri: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//parse-uri: arg 1: expected native") + return env.NewError("Go(repository.CustomURIRepository)//parse-uri: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//parse-uri: arg 2: expected string") + return env.NewError("Go(repository.CustomURIRepository)//parse-uri: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := arg0Val.ParseURI(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URI)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URI)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -147578,24 +145741,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_CustomURIRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//reader: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.CustomURIRepository)//reader: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.CustomURIRepository) - if !ok { + if vc, ok := v.Value.(repository.CustomURIRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//reader: arg 1: expected native of type repository.CustomURIRepository") + return env.NewError("Go(repository.CustomURIRepository)//reader: arg 1: " + "expected native of type repository.CustomURIRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//reader: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.CustomURIRepository)//reader: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//reader: arg 1: expected native") + return env.NewError("Go(repository.CustomURIRepository)//reader: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -147604,45 +145767,28 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//reader: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.CustomURIRepository)//reader: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//reader: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.CustomURIRepository)//reader: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//reader: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.CustomURIRepository)//reader: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.CustomURIRepository)//reader: arg 2: expected native") + return env.NewError("Go(repository.CustomURIRepository)//reader: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Reader(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URIReadCloser)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URIReadCloser)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -147665,24 +145811,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_HierarchicalRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//can-read: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.HierarchicalRepository)//can-read: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.HierarchicalRepository) - if !ok { + if vc, ok := v.Value.(repository.HierarchicalRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//can-read: arg 1: expected native of type repository.HierarchicalRepository") + return env.NewError("Go(repository.HierarchicalRepository)//can-read: arg 1: " + "expected native of type repository.HierarchicalRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//can-read: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.HierarchicalRepository)//can-read: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//can-read: arg 1: expected native") + return env.NewError("Go(repository.HierarchicalRepository)//can-read: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -147691,24 +145837,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//can-read: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.HierarchicalRepository)//can-read: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//can-read: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.HierarchicalRepository)//can-read: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//can-read: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.HierarchicalRepository)//can-read: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//can-read: arg 2: expected native") + return env.NewError("Go(repository.HierarchicalRepository)//can-read: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.CanRead(arg1Val) var res0Obj env.Object @@ -147735,24 +145881,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_HierarchicalRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//child: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.HierarchicalRepository)//child: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.HierarchicalRepository) - if !ok { + if vc, ok := v.Value.(repository.HierarchicalRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//child: arg 1: expected native of type repository.HierarchicalRepository") + return env.NewError("Go(repository.HierarchicalRepository)//child: arg 1: " + "expected native of type repository.HierarchicalRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//child: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.HierarchicalRepository)//child: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//child: arg 1: expected native") + return env.NewError("Go(repository.HierarchicalRepository)//child: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -147761,52 +145907,35 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//child: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.HierarchicalRepository)//child: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//child: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.HierarchicalRepository)//child: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//child: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.HierarchicalRepository)//child: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//child: arg 2: expected native") + return env.NewError("Go(repository.HierarchicalRepository)//child: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg2Val string - if v, ok := arg2.(env.String); ok { - arg2Val = string(v.Value) + if vc, ok := arg2.(env.String); ok { + arg2Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//child: arg 3: expected string") + return env.NewError("Go(repository.HierarchicalRepository)//child: arg 3: " + "expected string, but got " + objectDebugString(ps.Idx, arg2)) } res0, resErr := arg0Val.Child(arg1Val, arg2Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URI)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URI)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -147829,31 +145958,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_HierarchicalRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//destroy: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.HierarchicalRepository)//destroy: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.HierarchicalRepository) - if !ok { + if vc, ok := v.Value.(repository.HierarchicalRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//destroy: arg 1: expected native of type repository.HierarchicalRepository") + return env.NewError("Go(repository.HierarchicalRepository)//destroy: arg 1: " + "expected native of type repository.HierarchicalRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//destroy: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.HierarchicalRepository)//destroy: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//destroy: arg 1: expected native") + return env.NewError("Go(repository.HierarchicalRepository)//destroy: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//destroy: arg 2: expected string") + return env.NewError("Go(repository.HierarchicalRepository)//destroy: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.Destroy(arg1Val) return arg0 @@ -147870,24 +145999,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_HierarchicalRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//exists: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.HierarchicalRepository)//exists: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.HierarchicalRepository) - if !ok { + if vc, ok := v.Value.(repository.HierarchicalRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//exists: arg 1: expected native of type repository.HierarchicalRepository") + return env.NewError("Go(repository.HierarchicalRepository)//exists: arg 1: " + "expected native of type repository.HierarchicalRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//exists: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.HierarchicalRepository)//exists: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//exists: arg 1: expected native") + return env.NewError("Go(repository.HierarchicalRepository)//exists: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -147896,24 +146025,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//exists: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.HierarchicalRepository)//exists: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//exists: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.HierarchicalRepository)//exists: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//exists: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.HierarchicalRepository)//exists: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//exists: arg 2: expected native") + return env.NewError("Go(repository.HierarchicalRepository)//exists: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Exists(arg1Val) var res0Obj env.Object @@ -147940,24 +146069,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_HierarchicalRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//parent: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.HierarchicalRepository)//parent: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.HierarchicalRepository) - if !ok { + if vc, ok := v.Value.(repository.HierarchicalRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//parent: arg 1: expected native of type repository.HierarchicalRepository") + return env.NewError("Go(repository.HierarchicalRepository)//parent: arg 1: " + "expected native of type repository.HierarchicalRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//parent: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.HierarchicalRepository)//parent: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//parent: arg 1: expected native") + return env.NewError("Go(repository.HierarchicalRepository)//parent: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -147966,45 +146095,28 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//parent: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.HierarchicalRepository)//parent: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//parent: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.HierarchicalRepository)//parent: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//parent: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.HierarchicalRepository)//parent: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//parent: arg 2: expected native") + return env.NewError("Go(repository.HierarchicalRepository)//parent: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Parent(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URI)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URI)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -148027,24 +146139,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_HierarchicalRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//reader: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.HierarchicalRepository)//reader: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.HierarchicalRepository) - if !ok { + if vc, ok := v.Value.(repository.HierarchicalRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//reader: arg 1: expected native of type repository.HierarchicalRepository") + return env.NewError("Go(repository.HierarchicalRepository)//reader: arg 1: " + "expected native of type repository.HierarchicalRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//reader: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.HierarchicalRepository)//reader: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//reader: arg 1: expected native") + return env.NewError("Go(repository.HierarchicalRepository)//reader: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -148053,45 +146165,28 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//reader: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.HierarchicalRepository)//reader: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//reader: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.HierarchicalRepository)//reader: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//reader: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.HierarchicalRepository)//reader: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.HierarchicalRepository)//reader: arg 2: expected native") + return env.NewError("Go(repository.HierarchicalRepository)//reader: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Reader(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URIReadCloser)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URIReadCloser)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -148114,24 +146209,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_ListableRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//can-list: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.ListableRepository)//can-list: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.ListableRepository) - if !ok { + if vc, ok := v.Value.(repository.ListableRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//can-list: arg 1: expected native of type repository.ListableRepository") + return env.NewError("Go(repository.ListableRepository)//can-list: arg 1: " + "expected native of type repository.ListableRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//can-list: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.ListableRepository)//can-list: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//can-list: arg 1: expected native") + return env.NewError("Go(repository.ListableRepository)//can-list: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -148140,24 +146235,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//can-list: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.ListableRepository)//can-list: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//can-list: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.ListableRepository)//can-list: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//can-list: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.ListableRepository)//can-list: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//can-list: arg 2: expected native") + return env.NewError("Go(repository.ListableRepository)//can-list: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.CanList(arg1Val) var res0Obj env.Object @@ -148184,24 +146279,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_ListableRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//can-read: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.ListableRepository)//can-read: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.ListableRepository) - if !ok { + if vc, ok := v.Value.(repository.ListableRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//can-read: arg 1: expected native of type repository.ListableRepository") + return env.NewError("Go(repository.ListableRepository)//can-read: arg 1: " + "expected native of type repository.ListableRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//can-read: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.ListableRepository)//can-read: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//can-read: arg 1: expected native") + return env.NewError("Go(repository.ListableRepository)//can-read: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -148210,24 +146305,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//can-read: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.ListableRepository)//can-read: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//can-read: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.ListableRepository)//can-read: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//can-read: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.ListableRepository)//can-read: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//can-read: arg 2: expected native") + return env.NewError("Go(repository.ListableRepository)//can-read: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.CanRead(arg1Val) var res0Obj env.Object @@ -148254,24 +146349,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_ListableRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//create-listable: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.ListableRepository)//create-listable: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.ListableRepository) - if !ok { + if vc, ok := v.Value.(repository.ListableRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//create-listable: arg 1: expected native of type repository.ListableRepository") + return env.NewError("Go(repository.ListableRepository)//create-listable: arg 1: " + "expected native of type repository.ListableRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//create-listable: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.ListableRepository)//create-listable: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//create-listable: arg 1: expected native") + return env.NewError("Go(repository.ListableRepository)//create-listable: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -148280,24 +146375,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//create-listable: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.ListableRepository)//create-listable: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//create-listable: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.ListableRepository)//create-listable: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//create-listable: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.ListableRepository)//create-listable: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//create-listable: arg 2: expected native") + return env.NewError("Go(repository.ListableRepository)//create-listable: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.CreateListable(arg1Val) var resErrObj env.Object @@ -148322,31 +146417,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_ListableRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//destroy: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.ListableRepository)//destroy: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.ListableRepository) - if !ok { + if vc, ok := v.Value.(repository.ListableRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//destroy: arg 1: expected native of type repository.ListableRepository") + return env.NewError("Go(repository.ListableRepository)//destroy: arg 1: " + "expected native of type repository.ListableRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//destroy: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.ListableRepository)//destroy: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//destroy: arg 1: expected native") + return env.NewError("Go(repository.ListableRepository)//destroy: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//destroy: arg 2: expected string") + return env.NewError("Go(repository.ListableRepository)//destroy: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.Destroy(arg1Val) return arg0 @@ -148363,24 +146458,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_ListableRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//exists: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.ListableRepository)//exists: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.ListableRepository) - if !ok { + if vc, ok := v.Value.(repository.ListableRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//exists: arg 1: expected native of type repository.ListableRepository") + return env.NewError("Go(repository.ListableRepository)//exists: arg 1: " + "expected native of type repository.ListableRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//exists: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.ListableRepository)//exists: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//exists: arg 1: expected native") + return env.NewError("Go(repository.ListableRepository)//exists: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -148389,24 +146484,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//exists: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.ListableRepository)//exists: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//exists: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.ListableRepository)//exists: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//exists: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.ListableRepository)//exists: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//exists: arg 2: expected native") + return env.NewError("Go(repository.ListableRepository)//exists: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Exists(arg1Val) var res0Obj env.Object @@ -148433,24 +146528,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_ListableRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//list: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.ListableRepository)//list: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.ListableRepository) - if !ok { + if vc, ok := v.Value.(repository.ListableRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//list: arg 1: expected native of type repository.ListableRepository") + return env.NewError("Go(repository.ListableRepository)//list: arg 1: " + "expected native of type repository.ListableRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//list: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.ListableRepository)//list: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//list: arg 1: expected native") + return env.NewError("Go(repository.ListableRepository)//list: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -148459,48 +146554,31 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//list: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.ListableRepository)//list: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//list: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.ListableRepository)//list: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//list: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.ListableRepository)//list: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//list: arg 2: expected native") + return env.NewError("Go(repository.ListableRepository)//list: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.List(arg1Val) var res0Obj env.Object { items := make([]env.Object, len(res0)) for i, it := range res0 { - { - typ := reflect.TypeOf(it) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - items[i] = *env.NewNative(ps.Idx, it, typRyeName) - } else { - items[i] = *env.NewNative(ps.Idx, it, "Go(fyne.URI)") - } - } + items[i] = ifaceToNative(ps.Idx, it, "Go(fyne.URI)") } res0Obj = *env.NewBlock(*env.NewTSeries(items)) } @@ -148526,24 +146604,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_ListableRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//reader: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.ListableRepository)//reader: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.ListableRepository) - if !ok { + if vc, ok := v.Value.(repository.ListableRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//reader: arg 1: expected native of type repository.ListableRepository") + return env.NewError("Go(repository.ListableRepository)//reader: arg 1: " + "expected native of type repository.ListableRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//reader: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.ListableRepository)//reader: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//reader: arg 1: expected native") + return env.NewError("Go(repository.ListableRepository)//reader: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -148552,45 +146630,28 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//reader: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.ListableRepository)//reader: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//reader: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.ListableRepository)//reader: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//reader: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.ListableRepository)//reader: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.ListableRepository)//reader: arg 2: expected native") + return env.NewError("Go(repository.ListableRepository)//reader: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Reader(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URIReadCloser)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URIReadCloser)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -148613,24 +146674,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_MovableRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//can-read: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.MovableRepository)//can-read: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.MovableRepository) - if !ok { + if vc, ok := v.Value.(repository.MovableRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//can-read: arg 1: expected native of type repository.MovableRepository") + return env.NewError("Go(repository.MovableRepository)//can-read: arg 1: " + "expected native of type repository.MovableRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//can-read: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.MovableRepository)//can-read: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//can-read: arg 1: expected native") + return env.NewError("Go(repository.MovableRepository)//can-read: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -148639,24 +146700,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//can-read: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.MovableRepository)//can-read: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//can-read: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.MovableRepository)//can-read: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//can-read: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.MovableRepository)//can-read: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//can-read: arg 2: expected native") + return env.NewError("Go(repository.MovableRepository)//can-read: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.CanRead(arg1Val) var res0Obj env.Object @@ -148683,31 +146744,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_MovableRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//destroy: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.MovableRepository)//destroy: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.MovableRepository) - if !ok { + if vc, ok := v.Value.(repository.MovableRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//destroy: arg 1: expected native of type repository.MovableRepository") + return env.NewError("Go(repository.MovableRepository)//destroy: arg 1: " + "expected native of type repository.MovableRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//destroy: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.MovableRepository)//destroy: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//destroy: arg 1: expected native") + return env.NewError("Go(repository.MovableRepository)//destroy: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//destroy: arg 2: expected string") + return env.NewError("Go(repository.MovableRepository)//destroy: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.Destroy(arg1Val) return arg0 @@ -148724,24 +146785,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_MovableRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//exists: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.MovableRepository)//exists: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.MovableRepository) - if !ok { + if vc, ok := v.Value.(repository.MovableRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//exists: arg 1: expected native of type repository.MovableRepository") + return env.NewError("Go(repository.MovableRepository)//exists: arg 1: " + "expected native of type repository.MovableRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//exists: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.MovableRepository)//exists: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//exists: arg 1: expected native") + return env.NewError("Go(repository.MovableRepository)//exists: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -148750,24 +146811,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//exists: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.MovableRepository)//exists: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//exists: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.MovableRepository)//exists: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//exists: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.MovableRepository)//exists: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//exists: arg 2: expected native") + return env.NewError("Go(repository.MovableRepository)//exists: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Exists(arg1Val) var res0Obj env.Object @@ -148794,24 +146855,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_MovableRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//move: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.MovableRepository)//move: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.MovableRepository) - if !ok { + if vc, ok := v.Value.(repository.MovableRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//move: arg 1: expected native of type repository.MovableRepository") + return env.NewError("Go(repository.MovableRepository)//move: arg 1: " + "expected native of type repository.MovableRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//move: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.MovableRepository)//move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//move: arg 1: expected native") + return env.NewError("Go(repository.MovableRepository)//move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -148820,24 +146881,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//move: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.MovableRepository)//move: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//move: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.MovableRepository)//move: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//move: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.MovableRepository)//move: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//move: arg 2: expected native") + return env.NewError("Go(repository.MovableRepository)//move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg2Val fyne.URI switch v := arg2.(type) { @@ -148846,24 +146907,24 @@ var Builtins = map[string]*env.Builtin{ arg2Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//move: arg 3: " + err.Error() + "") + return env.NewError("Go(repository.MovableRepository)//move: arg 3: " + err.Error()) } case env.Native: - var ok bool - arg2Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//move: arg 3: expected native of type fyne.URI") + return env.NewError("Go(repository.MovableRepository)//move: arg 3: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//move: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(repository.MovableRepository)//move: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//move: arg 3: expected native") + return env.NewError("Go(repository.MovableRepository)//move: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Move(arg1Val, arg2Val) var resErrObj env.Object @@ -148888,24 +146949,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_MovableRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//reader: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.MovableRepository)//reader: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.MovableRepository) - if !ok { + if vc, ok := v.Value.(repository.MovableRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//reader: arg 1: expected native of type repository.MovableRepository") + return env.NewError("Go(repository.MovableRepository)//reader: arg 1: " + "expected native of type repository.MovableRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//reader: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.MovableRepository)//reader: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//reader: arg 1: expected native") + return env.NewError("Go(repository.MovableRepository)//reader: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -148914,45 +146975,28 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//reader: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.MovableRepository)//reader: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//reader: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.MovableRepository)//reader: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//reader: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.MovableRepository)//reader: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.MovableRepository)//reader: arg 2: expected native") + return env.NewError("Go(repository.MovableRepository)//reader: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Reader(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URIReadCloser)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URIReadCloser)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -148975,24 +147019,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_Repository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.Repository)//can-read: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.Repository)//can-read: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.Repository) - if !ok { + if vc, ok := v.Value.(repository.Repository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.Repository)//can-read: arg 1: expected native of type repository.Repository") + return env.NewError("Go(repository.Repository)//can-read: arg 1: " + "expected native of type repository.Repository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.Repository)//can-read: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.Repository)//can-read: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.Repository)//can-read: arg 1: expected native") + return env.NewError("Go(repository.Repository)//can-read: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -149001,24 +147045,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.Repository)//can-read: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.Repository)//can-read: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.Repository)//can-read: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.Repository)//can-read: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.Repository)//can-read: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.Repository)//can-read: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.Repository)//can-read: arg 2: expected native") + return env.NewError("Go(repository.Repository)//can-read: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.CanRead(arg1Val) var res0Obj env.Object @@ -149045,31 +147089,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_Repository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.Repository)//destroy: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.Repository)//destroy: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.Repository) - if !ok { + if vc, ok := v.Value.(repository.Repository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.Repository)//destroy: arg 1: expected native of type repository.Repository") + return env.NewError("Go(repository.Repository)//destroy: arg 1: " + "expected native of type repository.Repository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.Repository)//destroy: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.Repository)//destroy: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.Repository)//destroy: arg 1: expected native") + return env.NewError("Go(repository.Repository)//destroy: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(repository.Repository)//destroy: arg 2: expected string") + return env.NewError("Go(repository.Repository)//destroy: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.Destroy(arg1Val) return arg0 @@ -149086,24 +147130,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_Repository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.Repository)//exists: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.Repository)//exists: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.Repository) - if !ok { + if vc, ok := v.Value.(repository.Repository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.Repository)//exists: arg 1: expected native of type repository.Repository") + return env.NewError("Go(repository.Repository)//exists: arg 1: " + "expected native of type repository.Repository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.Repository)//exists: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.Repository)//exists: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.Repository)//exists: arg 1: expected native") + return env.NewError("Go(repository.Repository)//exists: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -149112,24 +147156,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.Repository)//exists: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.Repository)//exists: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.Repository)//exists: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.Repository)//exists: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.Repository)//exists: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.Repository)//exists: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.Repository)//exists: arg 2: expected native") + return env.NewError("Go(repository.Repository)//exists: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Exists(arg1Val) var res0Obj env.Object @@ -149156,24 +147200,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_Repository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.Repository)//reader: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.Repository)//reader: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.Repository) - if !ok { + if vc, ok := v.Value.(repository.Repository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.Repository)//reader: arg 1: expected native of type repository.Repository") + return env.NewError("Go(repository.Repository)//reader: arg 1: " + "expected native of type repository.Repository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.Repository)//reader: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.Repository)//reader: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.Repository)//reader: arg 1: expected native") + return env.NewError("Go(repository.Repository)//reader: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -149182,45 +147226,28 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.Repository)//reader: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.Repository)//reader: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.Repository)//reader: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.Repository)//reader: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.Repository)//reader: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.Repository)//reader: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.Repository)//reader: arg 2: expected native") + return env.NewError("Go(repository.Repository)//reader: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Reader(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URIReadCloser)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URIReadCloser)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -149243,24 +147270,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_WritableRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//can-read: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.WritableRepository)//can-read: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.WritableRepository) - if !ok { + if vc, ok := v.Value.(repository.WritableRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//can-read: arg 1: expected native of type repository.WritableRepository") + return env.NewError("Go(repository.WritableRepository)//can-read: arg 1: " + "expected native of type repository.WritableRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//can-read: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.WritableRepository)//can-read: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//can-read: arg 1: expected native") + return env.NewError("Go(repository.WritableRepository)//can-read: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -149269,24 +147296,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//can-read: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.WritableRepository)//can-read: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//can-read: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.WritableRepository)//can-read: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//can-read: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.WritableRepository)//can-read: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//can-read: arg 2: expected native") + return env.NewError("Go(repository.WritableRepository)//can-read: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.CanRead(arg1Val) var res0Obj env.Object @@ -149313,24 +147340,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_WritableRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//can-write: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.WritableRepository)//can-write: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.WritableRepository) - if !ok { + if vc, ok := v.Value.(repository.WritableRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//can-write: arg 1: expected native of type repository.WritableRepository") + return env.NewError("Go(repository.WritableRepository)//can-write: arg 1: " + "expected native of type repository.WritableRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//can-write: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.WritableRepository)//can-write: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//can-write: arg 1: expected native") + return env.NewError("Go(repository.WritableRepository)//can-write: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -149339,24 +147366,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//can-write: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.WritableRepository)//can-write: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//can-write: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.WritableRepository)//can-write: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//can-write: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.WritableRepository)//can-write: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//can-write: arg 2: expected native") + return env.NewError("Go(repository.WritableRepository)//can-write: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.CanWrite(arg1Val) var res0Obj env.Object @@ -149383,24 +147410,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_WritableRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//delete: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.WritableRepository)//delete: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.WritableRepository) - if !ok { + if vc, ok := v.Value.(repository.WritableRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//delete: arg 1: expected native of type repository.WritableRepository") + return env.NewError("Go(repository.WritableRepository)//delete: arg 1: " + "expected native of type repository.WritableRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//delete: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.WritableRepository)//delete: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//delete: arg 1: expected native") + return env.NewError("Go(repository.WritableRepository)//delete: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -149409,24 +147436,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//delete: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.WritableRepository)//delete: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//delete: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.WritableRepository)//delete: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//delete: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.WritableRepository)//delete: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//delete: arg 2: expected native") + return env.NewError("Go(repository.WritableRepository)//delete: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := arg0Val.Delete(arg1Val) var resErrObj env.Object @@ -149451,31 +147478,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_WritableRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//destroy: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.WritableRepository)//destroy: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.WritableRepository) - if !ok { + if vc, ok := v.Value.(repository.WritableRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//destroy: arg 1: expected native of type repository.WritableRepository") + return env.NewError("Go(repository.WritableRepository)//destroy: arg 1: " + "expected native of type repository.WritableRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//destroy: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.WritableRepository)//destroy: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//destroy: arg 1: expected native") + return env.NewError("Go(repository.WritableRepository)//destroy: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//destroy: arg 2: expected string") + return env.NewError("Go(repository.WritableRepository)//destroy: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.Destroy(arg1Val) return arg0 @@ -149492,24 +147519,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_WritableRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//exists: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.WritableRepository)//exists: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.WritableRepository) - if !ok { + if vc, ok := v.Value.(repository.WritableRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//exists: arg 1: expected native of type repository.WritableRepository") + return env.NewError("Go(repository.WritableRepository)//exists: arg 1: " + "expected native of type repository.WritableRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//exists: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.WritableRepository)//exists: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//exists: arg 1: expected native") + return env.NewError("Go(repository.WritableRepository)//exists: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -149518,24 +147545,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//exists: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.WritableRepository)//exists: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//exists: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.WritableRepository)//exists: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//exists: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.WritableRepository)//exists: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//exists: arg 2: expected native") + return env.NewError("Go(repository.WritableRepository)//exists: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Exists(arg1Val) var res0Obj env.Object @@ -149562,24 +147589,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_WritableRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//reader: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.WritableRepository)//reader: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.WritableRepository) - if !ok { + if vc, ok := v.Value.(repository.WritableRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//reader: arg 1: expected native of type repository.WritableRepository") + return env.NewError("Go(repository.WritableRepository)//reader: arg 1: " + "expected native of type repository.WritableRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//reader: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.WritableRepository)//reader: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//reader: arg 1: expected native") + return env.NewError("Go(repository.WritableRepository)//reader: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -149588,45 +147615,28 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//reader: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.WritableRepository)//reader: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//reader: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.WritableRepository)//reader: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//reader: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.WritableRepository)//reader: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//reader: arg 2: expected native") + return env.NewError("Go(repository.WritableRepository)//reader: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Reader(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URIReadCloser)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URIReadCloser)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -149649,24 +147659,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_repository_WritableRepository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//writer: arg 1: " + err.Error() + "") + return env.NewError("Go(repository.WritableRepository)//writer: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(repository.WritableRepository) - if !ok { + if vc, ok := v.Value.(repository.WritableRepository); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//writer: arg 1: expected native of type repository.WritableRepository") + return env.NewError("Go(repository.WritableRepository)//writer: arg 1: " + "expected native of type repository.WritableRepository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//writer: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(repository.WritableRepository)//writer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//writer: arg 1: expected native") + return env.NewError("Go(repository.WritableRepository)//writer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -149675,45 +147685,28 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//writer: arg 2: " + err.Error() + "") + return env.NewError("Go(repository.WritableRepository)//writer: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//writer: arg 2: expected native of type fyne.URI") + return env.NewError("Go(repository.WritableRepository)//writer: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//writer: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(repository.WritableRepository)//writer: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(repository.WritableRepository)//writer: arg 2: expected native") + return env.NewError("Go(repository.WritableRepository)//writer: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := arg0Val.Writer(arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URIWriteCloser)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URIWriteCloser)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -149736,24 +147729,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_storage_FileFilter(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(storage.FileFilter)//matches: arg 1: " + err.Error() + "") + return env.NewError("Go(storage.FileFilter)//matches: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(storage.FileFilter) - if !ok { + if vc, ok := v.Value.(storage.FileFilter); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(storage.FileFilter)//matches: arg 1: expected native of type storage.FileFilter") + return env.NewError("Go(storage.FileFilter)//matches: arg 1: " + "expected native of type storage.FileFilter, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(storage.FileFilter)//matches: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(storage.FileFilter)//matches: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(storage.FileFilter)//matches: arg 1: expected native") + return env.NewError("Go(storage.FileFilter)//matches: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -149762,24 +147755,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(storage.FileFilter)//matches: arg 2: " + err.Error() + "") + return env.NewError("Go(storage.FileFilter)//matches: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(storage.FileFilter)//matches: arg 2: expected native of type fyne.URI") + return env.NewError("Go(storage.FileFilter)//matches: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(storage.FileFilter)//matches: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(storage.FileFilter)//matches: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(storage.FileFilter)//matches: arg 2: expected native") + return env.NewError("Go(storage.FileFilter)//matches: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Matches(arg1Val) var res0Obj env.Object @@ -149798,24 +147791,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_test_SoftwarePainter(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.SoftwarePainter)//paint: arg 1: " + err.Error() + "") + return env.NewError("Go(test.SoftwarePainter)//paint: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(test.SoftwarePainter) - if !ok { + if vc, ok := v.Value.(test.SoftwarePainter); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.SoftwarePainter)//paint: arg 1: expected native of type test.SoftwarePainter") + return env.NewError("Go(test.SoftwarePainter)//paint: arg 1: " + "expected native of type test.SoftwarePainter, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.SoftwarePainter)//paint: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(test.SoftwarePainter)//paint: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.SoftwarePainter)//paint: arg 1: expected native") + return env.NewError("Go(test.SoftwarePainter)//paint: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Canvas switch v := arg1.(type) { @@ -149824,24 +147817,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.SoftwarePainter)//paint: arg 2: " + err.Error() + "") + return env.NewError("Go(test.SoftwarePainter)//paint: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.SoftwarePainter)//paint: arg 2: expected native of type fyne.Canvas") + return env.NewError("Go(test.SoftwarePainter)//paint: arg 2: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.SoftwarePainter)//paint: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(test.SoftwarePainter)//paint: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.SoftwarePainter)//paint: arg 2: expected native") + return env.NewError("Go(test.SoftwarePainter)//paint: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Paint(arg1Val) var res0Obj env.Object @@ -149860,24 +147853,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_test_WindowlessCanvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//add-shortcut: arg 1: " + err.Error() + "") + return env.NewError("Go(test.WindowlessCanvas)//add-shortcut: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(test.WindowlessCanvas) - if !ok { + if vc, ok := v.Value.(test.WindowlessCanvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//add-shortcut: arg 1: expected native of type test.WindowlessCanvas") + return env.NewError("Go(test.WindowlessCanvas)//add-shortcut: arg 1: " + "expected native of type test.WindowlessCanvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//add-shortcut: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//add-shortcut: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//add-shortcut: arg 1: expected native") + return env.NewError("Go(test.WindowlessCanvas)//add-shortcut: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Shortcut switch v := arg1.(type) { @@ -149886,65 +147879,48 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Shortcut(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//add-shortcut: arg 2: " + err.Error() + "") + return env.NewError("Go(test.WindowlessCanvas)//add-shortcut: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Shortcut) - if !ok { + if vc, ok := v.Value.(fyne.Shortcut); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//add-shortcut: arg 2: expected native of type fyne.Shortcut") + return env.NewError("Go(test.WindowlessCanvas)//add-shortcut: arg 2: " + "expected native of type fyne.Shortcut, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//add-shortcut: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//add-shortcut: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//add-shortcut: arg 2: expected native") + return env.NewError("Go(test.WindowlessCanvas)//add-shortcut: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg2Val func(fyne.Shortcut) switch fn := arg2.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//add-shortcut: arg 3: function has invalid number of arguments (expected 1)") + return env.NewError("Go(test.WindowlessCanvas)//add-shortcut: arg 3: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg2Val = func(arg0 fyne.Shortcut) { - var arg0Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.Shortcut)") - } - } + arg2Val = func(farg0 fyne.Shortcut) { + var farg0Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.Shortcut)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//add-shortcut: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//add-shortcut: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//add-shortcut: arg 3: expected function or nil") + return env.NewError("Go(test.WindowlessCanvas)//add-shortcut: arg 3: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } arg0Val.AddShortcut(arg1Val, arg2Val) return arg0 @@ -149961,24 +147937,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_test_WindowlessCanvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//capture: arg 1: " + err.Error() + "") + return env.NewError("Go(test.WindowlessCanvas)//capture: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(test.WindowlessCanvas) - if !ok { + if vc, ok := v.Value.(test.WindowlessCanvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//capture: arg 1: expected native of type test.WindowlessCanvas") + return env.NewError("Go(test.WindowlessCanvas)//capture: arg 1: " + "expected native of type test.WindowlessCanvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//capture: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//capture: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//capture: arg 1: expected native") + return env.NewError("Go(test.WindowlessCanvas)//capture: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Capture() var res0Obj env.Object @@ -149997,45 +147973,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_test_WindowlessCanvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//content: arg 1: " + err.Error() + "") + return env.NewError("Go(test.WindowlessCanvas)//content: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(test.WindowlessCanvas) - if !ok { + if vc, ok := v.Value.(test.WindowlessCanvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//content: arg 1: expected native of type test.WindowlessCanvas") + return env.NewError("Go(test.WindowlessCanvas)//content: arg 1: " + "expected native of type test.WindowlessCanvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//content: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//content: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//content: arg 1: expected native") + return env.NewError("Go(test.WindowlessCanvas)//content: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Content() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.CanvasObject)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.CanvasObject)") return res0Obj }, }, @@ -150050,24 +148009,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_test_WindowlessCanvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//focus: arg 1: " + err.Error() + "") + return env.NewError("Go(test.WindowlessCanvas)//focus: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(test.WindowlessCanvas) - if !ok { + if vc, ok := v.Value.(test.WindowlessCanvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//focus: arg 1: expected native of type test.WindowlessCanvas") + return env.NewError("Go(test.WindowlessCanvas)//focus: arg 1: " + "expected native of type test.WindowlessCanvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//focus: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//focus: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//focus: arg 1: expected native") + return env.NewError("Go(test.WindowlessCanvas)//focus: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Focusable switch v := arg1.(type) { @@ -150076,24 +148035,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Focusable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//focus: arg 2: " + err.Error() + "") + return env.NewError("Go(test.WindowlessCanvas)//focus: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Focusable) - if !ok { + if vc, ok := v.Value.(fyne.Focusable); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//focus: arg 2: expected native of type fyne.Focusable") + return env.NewError("Go(test.WindowlessCanvas)//focus: arg 2: " + "expected native of type fyne.Focusable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//focus: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//focus: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//focus: arg 2: expected native") + return env.NewError("Go(test.WindowlessCanvas)//focus: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Focus(arg1Val) return arg0 @@ -150110,24 +148069,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_test_WindowlessCanvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//focus-next: arg 1: " + err.Error() + "") + return env.NewError("Go(test.WindowlessCanvas)//focus-next: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(test.WindowlessCanvas) - if !ok { + if vc, ok := v.Value.(test.WindowlessCanvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//focus-next: arg 1: expected native of type test.WindowlessCanvas") + return env.NewError("Go(test.WindowlessCanvas)//focus-next: arg 1: " + "expected native of type test.WindowlessCanvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//focus-next: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//focus-next: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//focus-next: arg 1: expected native") + return env.NewError("Go(test.WindowlessCanvas)//focus-next: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusNext() return arg0 @@ -150144,24 +148103,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_test_WindowlessCanvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//focus-previous: arg 1: " + err.Error() + "") + return env.NewError("Go(test.WindowlessCanvas)//focus-previous: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(test.WindowlessCanvas) - if !ok { + if vc, ok := v.Value.(test.WindowlessCanvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//focus-previous: arg 1: expected native of type test.WindowlessCanvas") + return env.NewError("Go(test.WindowlessCanvas)//focus-previous: arg 1: " + "expected native of type test.WindowlessCanvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//focus-previous: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//focus-previous: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//focus-previous: arg 1: expected native") + return env.NewError("Go(test.WindowlessCanvas)//focus-previous: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.FocusPrevious() return arg0 @@ -150178,45 +148137,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_test_WindowlessCanvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//focused: arg 1: " + err.Error() + "") + return env.NewError("Go(test.WindowlessCanvas)//focused: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(test.WindowlessCanvas) - if !ok { + if vc, ok := v.Value.(test.WindowlessCanvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//focused: arg 1: expected native of type test.WindowlessCanvas") + return env.NewError("Go(test.WindowlessCanvas)//focused: arg 1: " + "expected native of type test.WindowlessCanvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//focused: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//focused: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//focused: arg 1: expected native") + return env.NewError("Go(test.WindowlessCanvas)//focused: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Focused() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Focusable)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Focusable)") return res0Obj }, }, @@ -150231,24 +148173,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_test_WindowlessCanvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//interactive-area: arg 1: " + err.Error() + "") + return env.NewError("Go(test.WindowlessCanvas)//interactive-area: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(test.WindowlessCanvas) - if !ok { + if vc, ok := v.Value.(test.WindowlessCanvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//interactive-area: arg 1: expected native of type test.WindowlessCanvas") + return env.NewError("Go(test.WindowlessCanvas)//interactive-area: arg 1: " + "expected native of type test.WindowlessCanvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//interactive-area: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//interactive-area: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//interactive-area: arg 1: expected native") + return env.NewError("Go(test.WindowlessCanvas)//interactive-area: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, res1 := arg0Val.InteractiveArea() var res0Obj env.Object @@ -150272,28 +148214,50 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_test_WindowlessCanvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//on-typed-key: arg 1: " + err.Error() + "") + return env.NewError("Go(test.WindowlessCanvas)//on-typed-key: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(test.WindowlessCanvas) - if !ok { + if vc, ok := v.Value.(test.WindowlessCanvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//on-typed-key: arg 1: expected native of type test.WindowlessCanvas") + return env.NewError("Go(test.WindowlessCanvas)//on-typed-key: arg 1: " + "expected native of type test.WindowlessCanvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//on-typed-key: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//on-typed-key: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//on-typed-key: arg 1: expected native") + return env.NewError("Go(test.WindowlessCanvas)//on-typed-key: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.OnTypedKey() var res0Obj env.Object - res0Obj = *env.NewNative(ps.Idx, res0, "Go(func(*fyne.KeyEvent))") + res0Obj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val *fyne.KeyEvent + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(*fyne.KeyEvent); ok { + arg0Val = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(test.WindowlessCanvas)//on-typed-key: arg 1: " + "expected native of type *fyne.KeyEvent, but got " + objectDebugString(ps.Idx, v)) + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + return env.NewError("Go(test.WindowlessCanvas)//on-typed-key: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) + } + arg0Val = nil + default: + ps.FailureFlag = true + return env.NewError("Go(test.WindowlessCanvas)//on-typed-key: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + res0(arg0Val) + return nil + }, 1, false, false, "Returned func") return res0Obj }, }, @@ -150308,28 +148272,44 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_test_WindowlessCanvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//on-typed-rune: arg 1: " + err.Error() + "") + return env.NewError("Go(test.WindowlessCanvas)//on-typed-rune: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(test.WindowlessCanvas) - if !ok { + if vc, ok := v.Value.(test.WindowlessCanvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//on-typed-rune: arg 1: expected native of type test.WindowlessCanvas") + return env.NewError("Go(test.WindowlessCanvas)//on-typed-rune: arg 1: " + "expected native of type test.WindowlessCanvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//on-typed-rune: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//on-typed-rune: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//on-typed-rune: arg 1: expected native") + return env.NewError("Go(test.WindowlessCanvas)//on-typed-rune: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.OnTypedRune() var res0Obj env.Object - res0Obj = *env.NewNative(ps.Idx, res0, "Go(func(rune))") + res0Obj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val rune + switch v := arg0.(type) { + case env.Native: + if vc, ok := v.Value.(rune); ok { + arg0Val = vc + } else { + ps.FailureFlag = true + return env.NewError("Go(test.WindowlessCanvas)//on-typed-rune: arg 1: " + "expected native of type rune, but got " + objectDebugString(ps.Idx, v)) + } + default: + ps.FailureFlag = true + return env.NewError("Go(test.WindowlessCanvas)//on-typed-rune: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) + } + res0(arg0Val) + return nil + }, 1, false, false, "Returned func") return res0Obj }, }, @@ -150344,45 +148324,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_test_WindowlessCanvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//overlays: arg 1: " + err.Error() + "") + return env.NewError("Go(test.WindowlessCanvas)//overlays: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(test.WindowlessCanvas) - if !ok { + if vc, ok := v.Value.(test.WindowlessCanvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//overlays: arg 1: expected native of type test.WindowlessCanvas") + return env.NewError("Go(test.WindowlessCanvas)//overlays: arg 1: " + "expected native of type test.WindowlessCanvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//overlays: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//overlays: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//overlays: arg 1: expected native") + return env.NewError("Go(test.WindowlessCanvas)//overlays: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Overlays() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.OverlayStack)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.OverlayStack)") return res0Obj }, }, @@ -150397,24 +148360,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_test_WindowlessCanvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//padded: arg 1: " + err.Error() + "") + return env.NewError("Go(test.WindowlessCanvas)//padded: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(test.WindowlessCanvas) - if !ok { + if vc, ok := v.Value.(test.WindowlessCanvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//padded: arg 1: expected native of type test.WindowlessCanvas") + return env.NewError("Go(test.WindowlessCanvas)//padded: arg 1: " + "expected native of type test.WindowlessCanvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//padded: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//padded: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//padded: arg 1: expected native") + return env.NewError("Go(test.WindowlessCanvas)//padded: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Padded() var res0Obj env.Object @@ -150433,45 +148396,39 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_test_WindowlessCanvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//pixel-coordinate-for-position: arg 1: " + err.Error() + "") + return env.NewError("Go(test.WindowlessCanvas)//pixel-coordinate-for-position: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(test.WindowlessCanvas) - if !ok { + if vc, ok := v.Value.(test.WindowlessCanvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//pixel-coordinate-for-position: arg 1: expected native of type test.WindowlessCanvas") + return env.NewError("Go(test.WindowlessCanvas)//pixel-coordinate-for-position: arg 1: " + "expected native of type test.WindowlessCanvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//pixel-coordinate-for-position: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//pixel-coordinate-for-position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//pixel-coordinate-for-position: arg 1: expected native") + return env.NewError("Go(test.WindowlessCanvas)//pixel-coordinate-for-position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//pixel-coordinate-for-position: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//pixel-coordinate-for-position: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//pixel-coordinate-for-position: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//pixel-coordinate-for-position: arg 2: expected native") + return env.NewError("Go(test.WindowlessCanvas)//pixel-coordinate-for-position: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - res0, res1 := arg0Val.PixelCoordinateForPosition(*arg1Val) + res0, res1 := arg0Val.PixelCoordinateForPosition(arg1Val) var res0Obj env.Object res0Obj = *env.NewInteger(int64(res0)) var res1Obj env.Object @@ -150493,24 +148450,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_test_WindowlessCanvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//refresh: arg 1: " + err.Error() + "") + return env.NewError("Go(test.WindowlessCanvas)//refresh: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(test.WindowlessCanvas) - if !ok { + if vc, ok := v.Value.(test.WindowlessCanvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//refresh: arg 1: expected native of type test.WindowlessCanvas") + return env.NewError("Go(test.WindowlessCanvas)//refresh: arg 1: " + "expected native of type test.WindowlessCanvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//refresh: arg 1: expected native") + return env.NewError("Go(test.WindowlessCanvas)//refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.CanvasObject switch v := arg1.(type) { @@ -150519,24 +148476,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//refresh: arg 2: " + err.Error() + "") + return env.NewError("Go(test.WindowlessCanvas)//refresh: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//refresh: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("Go(test.WindowlessCanvas)//refresh: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//refresh: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//refresh: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//refresh: arg 2: expected native") + return env.NewError("Go(test.WindowlessCanvas)//refresh: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Refresh(arg1Val) return arg0 @@ -150553,24 +148510,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_test_WindowlessCanvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//remove-shortcut: arg 1: " + err.Error() + "") + return env.NewError("Go(test.WindowlessCanvas)//remove-shortcut: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(test.WindowlessCanvas) - if !ok { + if vc, ok := v.Value.(test.WindowlessCanvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//remove-shortcut: arg 1: expected native of type test.WindowlessCanvas") + return env.NewError("Go(test.WindowlessCanvas)//remove-shortcut: arg 1: " + "expected native of type test.WindowlessCanvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//remove-shortcut: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//remove-shortcut: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//remove-shortcut: arg 1: expected native") + return env.NewError("Go(test.WindowlessCanvas)//remove-shortcut: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Shortcut switch v := arg1.(type) { @@ -150579,24 +148536,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Shortcut(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//remove-shortcut: arg 2: " + err.Error() + "") + return env.NewError("Go(test.WindowlessCanvas)//remove-shortcut: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Shortcut) - if !ok { + if vc, ok := v.Value.(fyne.Shortcut); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//remove-shortcut: arg 2: expected native of type fyne.Shortcut") + return env.NewError("Go(test.WindowlessCanvas)//remove-shortcut: arg 2: " + "expected native of type fyne.Shortcut, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//remove-shortcut: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//remove-shortcut: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//remove-shortcut: arg 2: expected native") + return env.NewError("Go(test.WindowlessCanvas)//remove-shortcut: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.RemoveShortcut(arg1Val) return arg0 @@ -150613,45 +148570,39 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_test_WindowlessCanvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//resize: arg 1: " + err.Error() + "") + return env.NewError("Go(test.WindowlessCanvas)//resize: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(test.WindowlessCanvas) - if !ok { + if vc, ok := v.Value.(test.WindowlessCanvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//resize: arg 1: expected native of type test.WindowlessCanvas") + return env.NewError("Go(test.WindowlessCanvas)//resize: arg 1: " + "expected native of type test.WindowlessCanvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//resize: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//resize: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//resize: arg 1: expected native") + return env.NewError("Go(test.WindowlessCanvas)//resize: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//resize: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//resize: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//resize: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//resize: arg 2: expected native") + return env.NewError("Go(test.WindowlessCanvas)//resize: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Resize(*arg1Val) + arg0Val.Resize(arg1Val) return arg0 }, }, @@ -150666,24 +148617,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_test_WindowlessCanvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//scale: arg 1: " + err.Error() + "") + return env.NewError("Go(test.WindowlessCanvas)//scale: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(test.WindowlessCanvas) - if !ok { + if vc, ok := v.Value.(test.WindowlessCanvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//scale: arg 1: expected native of type test.WindowlessCanvas") + return env.NewError("Go(test.WindowlessCanvas)//scale: arg 1: " + "expected native of type test.WindowlessCanvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//scale: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//scale: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//scale: arg 1: expected native") + return env.NewError("Go(test.WindowlessCanvas)//scale: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Scale() var res0Obj env.Object @@ -150702,24 +148653,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_test_WindowlessCanvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-content: arg 1: " + err.Error() + "") + return env.NewError("Go(test.WindowlessCanvas)//set-content: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(test.WindowlessCanvas) - if !ok { + if vc, ok := v.Value.(test.WindowlessCanvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-content: arg 1: expected native of type test.WindowlessCanvas") + return env.NewError("Go(test.WindowlessCanvas)//set-content: arg 1: " + "expected native of type test.WindowlessCanvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-content: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//set-content: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-content: arg 1: expected native") + return env.NewError("Go(test.WindowlessCanvas)//set-content: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.CanvasObject switch v := arg1.(type) { @@ -150728,24 +148679,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-content: arg 2: " + err.Error() + "") + return env.NewError("Go(test.WindowlessCanvas)//set-content: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-content: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("Go(test.WindowlessCanvas)//set-content: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-content: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//set-content: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-content: arg 2: expected native") + return env.NewError("Go(test.WindowlessCanvas)//set-content: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.SetContent(arg1Val) return arg0 @@ -150762,48 +148713,48 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_test_WindowlessCanvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-on-typed-key: arg 1: " + err.Error() + "") + return env.NewError("Go(test.WindowlessCanvas)//set-on-typed-key: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(test.WindowlessCanvas) - if !ok { + if vc, ok := v.Value.(test.WindowlessCanvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-on-typed-key: arg 1: expected native of type test.WindowlessCanvas") + return env.NewError("Go(test.WindowlessCanvas)//set-on-typed-key: arg 1: " + "expected native of type test.WindowlessCanvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-on-typed-key: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//set-on-typed-key: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-on-typed-key: arg 1: expected native") + return env.NewError("Go(test.WindowlessCanvas)//set-on-typed-key: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func(*fyne.KeyEvent) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-on-typed-key: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(test.WindowlessCanvas)//set-on-typed-key: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg1Val = func(arg0 *fyne.KeyEvent) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(*fyne.KeyEvent)") + arg1Val = func(farg0 *fyne.KeyEvent) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(*fyne.KeyEvent)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-on-typed-key: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//set-on-typed-key: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-on-typed-key: arg 2: expected function or nil") + return env.NewError("Go(test.WindowlessCanvas)//set-on-typed-key: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } arg0Val.SetOnTypedKey(arg1Val) return arg0 @@ -150820,48 +148771,48 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_test_WindowlessCanvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-on-typed-rune: arg 1: " + err.Error() + "") + return env.NewError("Go(test.WindowlessCanvas)//set-on-typed-rune: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(test.WindowlessCanvas) - if !ok { + if vc, ok := v.Value.(test.WindowlessCanvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-on-typed-rune: arg 1: expected native of type test.WindowlessCanvas") + return env.NewError("Go(test.WindowlessCanvas)//set-on-typed-rune: arg 1: " + "expected native of type test.WindowlessCanvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-on-typed-rune: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//set-on-typed-rune: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-on-typed-rune: arg 1: expected native") + return env.NewError("Go(test.WindowlessCanvas)//set-on-typed-rune: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func(rune) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-on-typed-rune: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("Go(test.WindowlessCanvas)//set-on-typed-rune: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg1Val = func(arg0 rune) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(rune)") + arg1Val = func(farg0 rune) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(rune)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-on-typed-rune: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//set-on-typed-rune: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-on-typed-rune: arg 2: expected function or nil") + return env.NewError("Go(test.WindowlessCanvas)//set-on-typed-rune: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } arg0Val.SetOnTypedRune(arg1Val) return arg0 @@ -150878,31 +148829,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_test_WindowlessCanvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-padded: arg 1: " + err.Error() + "") + return env.NewError("Go(test.WindowlessCanvas)//set-padded: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(test.WindowlessCanvas) - if !ok { + if vc, ok := v.Value.(test.WindowlessCanvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-padded: arg 1: expected native of type test.WindowlessCanvas") + return env.NewError("Go(test.WindowlessCanvas)//set-padded: arg 1: " + "expected native of type test.WindowlessCanvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-padded: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//set-padded: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-padded: arg 1: expected native") + return env.NewError("Go(test.WindowlessCanvas)//set-padded: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val bool - if v, ok := arg1.(env.Integer); ok { - arg1Val = v.Value != 0 + if vc, ok := arg1.(env.Integer); ok { + arg1Val = vc.Value != 0 } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-padded: arg 2: expected integer") + return env.NewError("Go(test.WindowlessCanvas)//set-padded: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetPadded(arg1Val) return arg0 @@ -150919,31 +148870,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_test_WindowlessCanvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-scale: arg 1: " + err.Error() + "") + return env.NewError("Go(test.WindowlessCanvas)//set-scale: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(test.WindowlessCanvas) - if !ok { + if vc, ok := v.Value.(test.WindowlessCanvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-scale: arg 1: expected native of type test.WindowlessCanvas") + return env.NewError("Go(test.WindowlessCanvas)//set-scale: arg 1: " + "expected native of type test.WindowlessCanvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-scale: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//set-scale: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-scale: arg 1: expected native") + return env.NewError("Go(test.WindowlessCanvas)//set-scale: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val float32 - if v, ok := arg1.(env.Decimal); ok { - arg1Val = float32(v.Value) + if vc, ok := arg1.(env.Decimal); ok { + arg1Val = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//set-scale: arg 2: expected decimal") + return env.NewError("Go(test.WindowlessCanvas)//set-scale: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } arg0Val.SetScale(arg1Val) return arg0 @@ -150960,24 +148911,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_test_WindowlessCanvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//size: arg 1: " + err.Error() + "") + return env.NewError("Go(test.WindowlessCanvas)//size: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(test.WindowlessCanvas) - if !ok { + if vc, ok := v.Value.(test.WindowlessCanvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//size: arg 1: expected native of type test.WindowlessCanvas") + return env.NewError("Go(test.WindowlessCanvas)//size: arg 1: " + "expected native of type test.WindowlessCanvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//size: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//size: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//size: arg 1: expected native") + return env.NewError("Go(test.WindowlessCanvas)//size: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Size() var res0Obj env.Object @@ -150996,24 +148947,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_test_WindowlessCanvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//unfocus: arg 1: " + err.Error() + "") + return env.NewError("Go(test.WindowlessCanvas)//unfocus: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(test.WindowlessCanvas) - if !ok { + if vc, ok := v.Value.(test.WindowlessCanvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//unfocus: arg 1: expected native of type test.WindowlessCanvas") + return env.NewError("Go(test.WindowlessCanvas)//unfocus: arg 1: " + "expected native of type test.WindowlessCanvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//unfocus: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(test.WindowlessCanvas)//unfocus: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(test.WindowlessCanvas)//unfocus: arg 1: expected native") + return env.NewError("Go(test.WindowlessCanvas)//unfocus: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Unfocus() return arg0 @@ -151030,48 +148981,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_widget_RichTextBlock(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(widget.RichTextBlock)//segments: arg 1: " + err.Error() + "") + return env.NewError("Go(widget.RichTextBlock)//segments: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(widget.RichTextBlock) - if !ok { + if vc, ok := v.Value.(widget.RichTextBlock); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(widget.RichTextBlock)//segments: arg 1: expected native of type widget.RichTextBlock") + return env.NewError("Go(widget.RichTextBlock)//segments: arg 1: " + "expected native of type widget.RichTextBlock, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(widget.RichTextBlock)//segments: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(widget.RichTextBlock)//segments: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(widget.RichTextBlock)//segments: arg 1: expected native") + return env.NewError("Go(widget.RichTextBlock)//segments: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Segments() var res0Obj env.Object { items := make([]env.Object, len(res0)) for i, it := range res0 { - { - typ := reflect.TypeOf(it) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - items[i] = *env.NewNative(ps.Idx, it, typRyeName) - } else { - items[i] = *env.NewNative(ps.Idx, it, "Go(widget.RichTextSegment)") - } - } + items[i] = ifaceToNative(ps.Idx, it, "Go(widget.RichTextSegment)") } res0Obj = *env.NewBlock(*env.NewTSeries(items)) } @@ -151089,24 +149023,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_widget_RichTextSegment(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//inline: arg 1: " + err.Error() + "") + return env.NewError("Go(widget.RichTextSegment)//inline: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(widget.RichTextSegment) - if !ok { + if vc, ok := v.Value.(widget.RichTextSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//inline: arg 1: expected native of type widget.RichTextSegment") + return env.NewError("Go(widget.RichTextSegment)//inline: arg 1: " + "expected native of type widget.RichTextSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//inline: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(widget.RichTextSegment)//inline: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//inline: arg 1: expected native") + return env.NewError("Go(widget.RichTextSegment)//inline: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Inline() var res0Obj env.Object @@ -151125,64 +149059,52 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_widget_RichTextSegment(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//select: arg 1: " + err.Error() + "") + return env.NewError("Go(widget.RichTextSegment)//select: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(widget.RichTextSegment) - if !ok { + if vc, ok := v.Value.(widget.RichTextSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//select: arg 1: expected native of type widget.RichTextSegment") + return env.NewError("Go(widget.RichTextSegment)//select: arg 1: " + "expected native of type widget.RichTextSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//select: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(widget.RichTextSegment)//select: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//select: arg 1: expected native") + return env.NewError("Go(widget.RichTextSegment)//select: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//select: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//select: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(widget.RichTextSegment)//select: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//select: arg 2: expected native") + return env.NewError("Go(widget.RichTextSegment)//select: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg2Val *fyne.Position + var arg2Val fyne.Position switch v := arg2.(type) { case env.Native: - var ok bool - arg2Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//select: arg 3: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg2Val = *vc + } else { ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//select: arg 3: expected integer to be 0 or nil") + return env.NewError("Go(widget.RichTextSegment)//select: arg 3: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg2Val = nil default: ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//select: arg 3: expected native") + return env.NewError("Go(widget.RichTextSegment)//select: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - arg0Val.Select(*arg1Val, *arg2Val) + arg0Val.Select(arg1Val, arg2Val) return arg0 }, }, @@ -151197,24 +149119,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_widget_RichTextSegment(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//selected-text: arg 1: " + err.Error() + "") + return env.NewError("Go(widget.RichTextSegment)//selected-text: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(widget.RichTextSegment) - if !ok { + if vc, ok := v.Value.(widget.RichTextSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//selected-text: arg 1: expected native of type widget.RichTextSegment") + return env.NewError("Go(widget.RichTextSegment)//selected-text: arg 1: " + "expected native of type widget.RichTextSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//selected-text: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(widget.RichTextSegment)//selected-text: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//selected-text: arg 1: expected native") + return env.NewError("Go(widget.RichTextSegment)//selected-text: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.SelectedText() var res0Obj env.Object @@ -151233,24 +149155,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_widget_RichTextSegment(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//textual: arg 1: " + err.Error() + "") + return env.NewError("Go(widget.RichTextSegment)//textual: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(widget.RichTextSegment) - if !ok { + if vc, ok := v.Value.(widget.RichTextSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//textual: arg 1: expected native of type widget.RichTextSegment") + return env.NewError("Go(widget.RichTextSegment)//textual: arg 1: " + "expected native of type widget.RichTextSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//textual: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(widget.RichTextSegment)//textual: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//textual: arg 1: expected native") + return env.NewError("Go(widget.RichTextSegment)//textual: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Textual() var res0Obj env.Object @@ -151269,24 +149191,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_widget_RichTextSegment(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//unselect: arg 1: " + err.Error() + "") + return env.NewError("Go(widget.RichTextSegment)//unselect: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(widget.RichTextSegment) - if !ok { + if vc, ok := v.Value.(widget.RichTextSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//unselect: arg 1: expected native of type widget.RichTextSegment") + return env.NewError("Go(widget.RichTextSegment)//unselect: arg 1: " + "expected native of type widget.RichTextSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//unselect: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(widget.RichTextSegment)//unselect: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//unselect: arg 1: expected native") + return env.NewError("Go(widget.RichTextSegment)//unselect: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Unselect() return arg0 @@ -151303,24 +149225,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_widget_RichTextSegment(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//update: arg 1: " + err.Error() + "") + return env.NewError("Go(widget.RichTextSegment)//update: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(widget.RichTextSegment) - if !ok { + if vc, ok := v.Value.(widget.RichTextSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//update: arg 1: expected native of type widget.RichTextSegment") + return env.NewError("Go(widget.RichTextSegment)//update: arg 1: " + "expected native of type widget.RichTextSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//update: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(widget.RichTextSegment)//update: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//update: arg 1: expected native") + return env.NewError("Go(widget.RichTextSegment)//update: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.CanvasObject switch v := arg1.(type) { @@ -151329,24 +149251,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//update: arg 2: " + err.Error() + "") + return env.NewError("Go(widget.RichTextSegment)//update: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//update: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("Go(widget.RichTextSegment)//update: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//update: arg 2: expected integer to be 0 or nil") + return env.NewError("Go(widget.RichTextSegment)//update: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//update: arg 2: expected native") + return env.NewError("Go(widget.RichTextSegment)//update: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } arg0Val.Update(arg1Val) return arg0 @@ -151363,45 +149285,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_widget_RichTextSegment(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//visual: arg 1: " + err.Error() + "") + return env.NewError("Go(widget.RichTextSegment)//visual: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(widget.RichTextSegment) - if !ok { + if vc, ok := v.Value.(widget.RichTextSegment); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//visual: arg 1: expected native of type widget.RichTextSegment") + return env.NewError("Go(widget.RichTextSegment)//visual: arg 1: " + "expected native of type widget.RichTextSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//visual: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(widget.RichTextSegment)//visual: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(widget.RichTextSegment)//visual: arg 1: expected native") + return env.NewError("Go(widget.RichTextSegment)//visual: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.Visual() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.CanvasObject)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.CanvasObject)") return res0Obj }, }, @@ -151416,24 +149321,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_widget_TextGridStyle(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(widget.TextGridStyle)//background-color: arg 1: " + err.Error() + "") + return env.NewError("Go(widget.TextGridStyle)//background-color: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(widget.TextGridStyle) - if !ok { + if vc, ok := v.Value.(widget.TextGridStyle); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(widget.TextGridStyle)//background-color: arg 1: expected native of type widget.TextGridStyle") + return env.NewError("Go(widget.TextGridStyle)//background-color: arg 1: " + "expected native of type widget.TextGridStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(widget.TextGridStyle)//background-color: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(widget.TextGridStyle)//background-color: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(widget.TextGridStyle)//background-color: arg 1: expected native") + return env.NewError("Go(widget.TextGridStyle)//background-color: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.BackgroundColor() var res0Obj env.Object @@ -151452,24 +149357,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_widget_TextGridStyle(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(widget.TextGridStyle)//text-color: arg 1: " + err.Error() + "") + return env.NewError("Go(widget.TextGridStyle)//text-color: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(widget.TextGridStyle) - if !ok { + if vc, ok := v.Value.(widget.TextGridStyle); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(widget.TextGridStyle)//text-color: arg 1: expected native of type widget.TextGridStyle") + return env.NewError("Go(widget.TextGridStyle)//text-color: arg 1: " + "expected native of type widget.TextGridStyle, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(widget.TextGridStyle)//text-color: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(widget.TextGridStyle)//text-color: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(widget.TextGridStyle)//text-color: arg 1: expected native") + return env.NewError("Go(widget.TextGridStyle)//text-color: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.TextColor() var res0Obj env.Object @@ -151488,45 +149393,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_widget_ToolbarItem(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("Go(widget.ToolbarItem)//toolbar-object: arg 1: " + err.Error() + "") + return env.NewError("Go(widget.ToolbarItem)//toolbar-object: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(widget.ToolbarItem) - if !ok { + if vc, ok := v.Value.(widget.ToolbarItem); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("Go(widget.ToolbarItem)//toolbar-object: arg 1: expected native of type widget.ToolbarItem") + return env.NewError("Go(widget.ToolbarItem)//toolbar-object: arg 1: " + "expected native of type widget.ToolbarItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("Go(widget.ToolbarItem)//toolbar-object: arg 1: expected integer to be 0 or nil") + return env.NewError("Go(widget.ToolbarItem)//toolbar-object: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("Go(widget.ToolbarItem)//toolbar-object: arg 1: expected native") + return env.NewError("Go(widget.ToolbarItem)//toolbar-object: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := arg0Val.ToolbarObject() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.CanvasObject)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.CanvasObject)") return res0Obj }, }, @@ -151536,24 +149424,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := app.New() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.App)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.App)") return res0Obj }, }, @@ -151572,32 +149443,15 @@ var Builtins = map[string]*env.Builtin{ Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("with-id: arg 1: expected string") + return env.NewError("with-id: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } res0 := app.NewWithID(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.App)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.App)") return res0Obj }, }, @@ -151605,26 +149459,20 @@ var Builtins = map[string]*env.Builtin{ Doc: "app.SetMetadata", Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var arg0Val *fyne.AppMetadata + var arg0Val fyne.AppMetadata switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.AppMetadata) - if !ok { - ps.FailureFlag = true - return env.NewError("set-metadata: arg 1: expected native of type *fyne.AppMetadata") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.AppMetadata); ok { + arg0Val = *vc + } else { ps.FailureFlag = true - return env.NewError("set-metadata: arg 1: expected integer to be 0 or nil") + return env.NewError("set-metadata: arg 1: " + "expected native of type *fyne.AppMetadata, but got " + objectDebugString(ps.Idx, v)) } - arg0Val = nil default: ps.FailureFlag = true - return env.NewError("set-metadata: arg 1: expected native") + return env.NewError("set-metadata: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - app.SetMetadata(*arg0Val) + app.SetMetadata(arg0Val) return nil }, }, @@ -151643,63 +149491,39 @@ var Builtins = map[string]*env.Builtin{ arg0Val[i], err = ctxTo_binding_Bool(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("binding-and: arg 1: block item: " + err.Error() + "") + return env.NewError("binding-and: arg 1: " + "block item: " + err.Error()) } case env.Native: - var ok bool - arg0Val[i], ok = v.Value.(binding.Bool) - if !ok { + if vc, ok := v.Value.(binding.Bool); ok { + arg0Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("binding-and: arg 1: block item: expected native of type binding.Bool") + return env.NewError("binding-and: arg 1: " + "block item: " + "expected native of type binding.Bool, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-and: arg 1: block item: expected integer to be 0 or nil") + return env.NewError("binding-and: arg 1: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val[i] = nil default: ps.FailureFlag = true - return env.NewError("binding-and: arg 1: block item: expected native") + return env.NewError("binding-and: arg 1: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg0Val, ok = v.Value.([]binding.Bool) - if !ok { - ps.FailureFlag = true - return env.NewError("binding-and: arg 1: expected native of type []binding.Bool") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-and: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-and: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-and: arg 1: expected block, native or nil") + return env.NewError("binding-and: arg 1: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.And(arg0Val...) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.Bool)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.Bool)") return res0Obj }, }, @@ -151710,42 +149534,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *bool switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*bool) - if !ok { + if vc, ok := v.Value.(*bool); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-bool: arg 1: expected native of type *bool") + return env.NewError("binding-bind-bool: arg 1: " + "expected native of type *bool, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-bool: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-bind-bool: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-bool: arg 1: expected native") + return env.NewError("binding-bind-bool: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BindBool(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.ExternalBool)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.ExternalBool)") return res0Obj }, }, @@ -151756,42 +149563,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *[]bool switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*[]bool) - if !ok { + if vc, ok := v.Value.(*[]bool); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-bool-list: arg 1: expected native of type *[]bool") + return env.NewError("binding-bind-bool-list: arg 1: " + "expected native of type *[]bool, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-bool-list: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-bind-bool-list: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-bool-list: arg 1: expected native") + return env.NewError("binding-bind-bool-list: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BindBoolList(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.ExternalBoolList)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.ExternalBoolList)") return res0Obj }, }, @@ -151802,61 +149592,44 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *map[string][]string switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*map[string][]string) - if !ok { + if vc, ok := v.Value.(*map[string][]string); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-bool-tree: arg 1: expected native of type *map[string][]string") + return env.NewError("binding-bind-bool-tree: arg 1: " + "expected native of type *map[string][]string, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-bool-tree: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-bind-bool-tree: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-bool-tree: arg 1: expected native") + return env.NewError("binding-bind-bool-tree: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *map[string]bool switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*map[string]bool) - if !ok { + if vc, ok := v.Value.(*map[string]bool); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-bool-tree: arg 2: expected native of type *map[string]bool") + return env.NewError("binding-bind-bool-tree: arg 2: " + "expected native of type *map[string]bool, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-bool-tree: arg 2: expected integer to be 0 or nil") + return env.NewError("binding-bind-bool-tree: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-bool-tree: arg 2: expected native") + return env.NewError("binding-bind-bool-tree: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BindBoolTree(arg0Val, arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.ExternalBoolTree)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.ExternalBoolTree)") return res0Obj }, }, @@ -151867,42 +149640,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *[]byte switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*[]byte) - if !ok { + if vc, ok := v.Value.(*[]byte); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-bytes: arg 1: expected native of type *[]byte") + return env.NewError("binding-bind-bytes: arg 1: " + "expected native of type *[]byte, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-bytes: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-bind-bytes: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-bytes: arg 1: expected native") + return env.NewError("binding-bind-bytes: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BindBytes(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.ExternalBytes)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.ExternalBytes)") return res0Obj }, }, @@ -151913,42 +149669,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *[][]byte switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*[][]byte) - if !ok { + if vc, ok := v.Value.(*[][]byte); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-bytes-list: arg 1: expected native of type *[][]byte") + return env.NewError("binding-bind-bytes-list: arg 1: " + "expected native of type *[][]byte, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-bytes-list: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-bind-bytes-list: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-bytes-list: arg 1: expected native") + return env.NewError("binding-bind-bytes-list: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BindBytesList(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.ExternalBytesList)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.ExternalBytesList)") return res0Obj }, }, @@ -151959,61 +149698,44 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *map[string][]string switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*map[string][]string) - if !ok { + if vc, ok := v.Value.(*map[string][]string); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-bytes-tree: arg 1: expected native of type *map[string][]string") + return env.NewError("binding-bind-bytes-tree: arg 1: " + "expected native of type *map[string][]string, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-bytes-tree: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-bind-bytes-tree: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-bytes-tree: arg 1: expected native") + return env.NewError("binding-bind-bytes-tree: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *map[string][]byte switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*map[string][]byte) - if !ok { + if vc, ok := v.Value.(*map[string][]byte); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-bytes-tree: arg 2: expected native of type *map[string][]byte") + return env.NewError("binding-bind-bytes-tree: arg 2: " + "expected native of type *map[string][]byte, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-bytes-tree: arg 2: expected integer to be 0 or nil") + return env.NewError("binding-bind-bytes-tree: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-bytes-tree: arg 2: expected native") + return env.NewError("binding-bind-bytes-tree: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BindBytesTree(arg0Val, arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.ExternalBytesTree)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.ExternalBytesTree)") return res0Obj }, }, @@ -152024,42 +149746,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *float64 switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*float64) - if !ok { + if vc, ok := v.Value.(*float64); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-float: arg 1: expected native of type *float64") + return env.NewError("binding-bind-float: arg 1: " + "expected native of type *float64, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-float: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-bind-float: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-float: arg 1: expected native") + return env.NewError("binding-bind-float: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BindFloat(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.ExternalFloat)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.ExternalFloat)") return res0Obj }, }, @@ -152070,42 +149775,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *[]float64 switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*[]float64) - if !ok { + if vc, ok := v.Value.(*[]float64); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-float-list: arg 1: expected native of type *[]float64") + return env.NewError("binding-bind-float-list: arg 1: " + "expected native of type *[]float64, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-float-list: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-bind-float-list: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-float-list: arg 1: expected native") + return env.NewError("binding-bind-float-list: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BindFloatList(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.ExternalFloatList)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.ExternalFloatList)") return res0Obj }, }, @@ -152116,61 +149804,44 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *map[string][]string switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*map[string][]string) - if !ok { + if vc, ok := v.Value.(*map[string][]string); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-float-tree: arg 1: expected native of type *map[string][]string") + return env.NewError("binding-bind-float-tree: arg 1: " + "expected native of type *map[string][]string, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-float-tree: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-bind-float-tree: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-float-tree: arg 1: expected native") + return env.NewError("binding-bind-float-tree: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *map[string]float64 switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*map[string]float64) - if !ok { + if vc, ok := v.Value.(*map[string]float64); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-float-tree: arg 2: expected native of type *map[string]float64") + return env.NewError("binding-bind-float-tree: arg 2: " + "expected native of type *map[string]float64, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-float-tree: arg 2: expected integer to be 0 or nil") + return env.NewError("binding-bind-float-tree: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-float-tree: arg 2: expected native") + return env.NewError("binding-bind-float-tree: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BindFloatTree(arg0Val, arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.ExternalFloatTree)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.ExternalFloatTree)") return res0Obj }, }, @@ -152181,42 +149852,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *int switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*int) - if !ok { + if vc, ok := v.Value.(*int); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-int: arg 1: expected native of type *int") + return env.NewError("binding-bind-int: arg 1: " + "expected native of type *int, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-int: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-bind-int: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-int: arg 1: expected native") + return env.NewError("binding-bind-int: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BindInt(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.ExternalInt)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.ExternalInt)") return res0Obj }, }, @@ -152227,42 +149881,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *[]int switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*[]int) - if !ok { + if vc, ok := v.Value.(*[]int); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-int-list: arg 1: expected native of type *[]int") + return env.NewError("binding-bind-int-list: arg 1: " + "expected native of type *[]int, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-int-list: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-bind-int-list: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-int-list: arg 1: expected native") + return env.NewError("binding-bind-int-list: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BindIntList(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.ExternalIntList)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.ExternalIntList)") return res0Obj }, }, @@ -152273,61 +149910,44 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *map[string][]string switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*map[string][]string) - if !ok { + if vc, ok := v.Value.(*map[string][]string); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-int-tree: arg 1: expected native of type *map[string][]string") + return env.NewError("binding-bind-int-tree: arg 1: " + "expected native of type *map[string][]string, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-int-tree: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-bind-int-tree: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-int-tree: arg 1: expected native") + return env.NewError("binding-bind-int-tree: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *map[string]int switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*map[string]int) - if !ok { + if vc, ok := v.Value.(*map[string]int); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-int-tree: arg 2: expected native of type *map[string]int") + return env.NewError("binding-bind-int-tree: arg 2: " + "expected native of type *map[string]int, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-int-tree: arg 2: expected integer to be 0 or nil") + return env.NewError("binding-bind-int-tree: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-int-tree: arg 2: expected native") + return env.NewError("binding-bind-int-tree: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BindIntTree(arg0Val, arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.ExternalIntTree)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.ExternalIntTree)") return res0Obj }, }, @@ -152336,11 +149956,11 @@ var Builtins = map[string]*env.Builtin{ Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("binding-bind-preference-bool: arg 1: expected string") + return env.NewError("binding-bind-preference-bool: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val fyne.Preferences switch v := arg1.(type) { @@ -152349,45 +149969,28 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("binding-bind-preference-bool: arg 2: " + err.Error() + "") + return env.NewError("binding-bind-preference-bool: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-preference-bool: arg 2: expected native of type fyne.Preferences") + return env.NewError("binding-bind-preference-bool: arg 2: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-preference-bool: arg 2: expected integer to be 0 or nil") + return env.NewError("binding-bind-preference-bool: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-preference-bool: arg 2: expected native") + return env.NewError("binding-bind-preference-bool: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BindPreferenceBool(arg0Val, arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.Bool)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.Bool)") return res0Obj }, }, @@ -152396,11 +149999,11 @@ var Builtins = map[string]*env.Builtin{ Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("binding-bind-preference-float: arg 1: expected string") + return env.NewError("binding-bind-preference-float: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val fyne.Preferences switch v := arg1.(type) { @@ -152409,45 +150012,28 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("binding-bind-preference-float: arg 2: " + err.Error() + "") + return env.NewError("binding-bind-preference-float: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-preference-float: arg 2: expected native of type fyne.Preferences") + return env.NewError("binding-bind-preference-float: arg 2: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-preference-float: arg 2: expected integer to be 0 or nil") + return env.NewError("binding-bind-preference-float: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-preference-float: arg 2: expected native") + return env.NewError("binding-bind-preference-float: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BindPreferenceFloat(arg0Val, arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.Float)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.Float)") return res0Obj }, }, @@ -152456,11 +150042,11 @@ var Builtins = map[string]*env.Builtin{ Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("binding-bind-preference-int: arg 1: expected string") + return env.NewError("binding-bind-preference-int: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val fyne.Preferences switch v := arg1.(type) { @@ -152469,45 +150055,28 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("binding-bind-preference-int: arg 2: " + err.Error() + "") + return env.NewError("binding-bind-preference-int: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-preference-int: arg 2: expected native of type fyne.Preferences") + return env.NewError("binding-bind-preference-int: arg 2: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-preference-int: arg 2: expected integer to be 0 or nil") + return env.NewError("binding-bind-preference-int: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-preference-int: arg 2: expected native") + return env.NewError("binding-bind-preference-int: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BindPreferenceInt(arg0Val, arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.Int)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.Int)") return res0Obj }, }, @@ -152516,11 +150085,11 @@ var Builtins = map[string]*env.Builtin{ Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("binding-bind-preference-string: arg 1: expected string") + return env.NewError("binding-bind-preference-string: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val fyne.Preferences switch v := arg1.(type) { @@ -152529,45 +150098,28 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Preferences(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("binding-bind-preference-string: arg 2: " + err.Error() + "") + return env.NewError("binding-bind-preference-string: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Preferences) - if !ok { + if vc, ok := v.Value.(fyne.Preferences); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-preference-string: arg 2: expected native of type fyne.Preferences") + return env.NewError("binding-bind-preference-string: arg 2: " + "expected native of type fyne.Preferences, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-preference-string: arg 2: expected integer to be 0 or nil") + return env.NewError("binding-bind-preference-string: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-preference-string: arg 2: expected native") + return env.NewError("binding-bind-preference-string: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BindPreferenceString(arg0Val, arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.String)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.String)") return res0Obj }, }, @@ -152578,42 +150130,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *rune switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*rune) - if !ok { + if vc, ok := v.Value.(*rune); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-rune: arg 1: expected native of type *rune") + return env.NewError("binding-bind-rune: arg 1: " + "expected native of type *rune, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-rune: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-bind-rune: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-rune: arg 1: expected native") + return env.NewError("binding-bind-rune: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BindRune(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.ExternalRune)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.ExternalRune)") return res0Obj }, }, @@ -152624,42 +150159,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *[]rune switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*[]rune) - if !ok { + if vc, ok := v.Value.(*[]rune); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-rune-list: arg 1: expected native of type *[]rune") + return env.NewError("binding-bind-rune-list: arg 1: " + "expected native of type *[]rune, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-rune-list: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-bind-rune-list: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-rune-list: arg 1: expected native") + return env.NewError("binding-bind-rune-list: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BindRuneList(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.ExternalRuneList)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.ExternalRuneList)") return res0Obj }, }, @@ -152670,61 +150188,44 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *map[string][]string switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*map[string][]string) - if !ok { + if vc, ok := v.Value.(*map[string][]string); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-rune-tree: arg 1: expected native of type *map[string][]string") + return env.NewError("binding-bind-rune-tree: arg 1: " + "expected native of type *map[string][]string, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-rune-tree: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-bind-rune-tree: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-rune-tree: arg 1: expected native") + return env.NewError("binding-bind-rune-tree: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *map[string]rune switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*map[string]rune) - if !ok { + if vc, ok := v.Value.(*map[string]rune); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-rune-tree: arg 2: expected native of type *map[string]rune") + return env.NewError("binding-bind-rune-tree: arg 2: " + "expected native of type *map[string]rune, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-rune-tree: arg 2: expected integer to be 0 or nil") + return env.NewError("binding-bind-rune-tree: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-rune-tree: arg 2: expected native") + return env.NewError("binding-bind-rune-tree: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BindRuneTree(arg0Val, arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.ExternalRuneTree)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.ExternalRuneTree)") return res0Obj }, }, @@ -152735,42 +150236,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *string switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*string) - if !ok { + if vc, ok := v.Value.(*string); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-string: arg 1: expected native of type *string") + return env.NewError("binding-bind-string: arg 1: " + "expected native of type *string, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-string: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-bind-string: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-string: arg 1: expected native") + return env.NewError("binding-bind-string: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BindString(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.ExternalString)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.ExternalString)") return res0Obj }, }, @@ -152781,42 +150265,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *[]string switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*[]string) - if !ok { + if vc, ok := v.Value.(*[]string); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-string-list: arg 1: expected native of type *[]string") + return env.NewError("binding-bind-string-list: arg 1: " + "expected native of type *[]string, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-string-list: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-bind-string-list: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-string-list: arg 1: expected native") + return env.NewError("binding-bind-string-list: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BindStringList(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.ExternalStringList)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.ExternalStringList)") return res0Obj }, }, @@ -152827,61 +150294,44 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *map[string][]string switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*map[string][]string) - if !ok { + if vc, ok := v.Value.(*map[string][]string); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-string-tree: arg 1: expected native of type *map[string][]string") + return env.NewError("binding-bind-string-tree: arg 1: " + "expected native of type *map[string][]string, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-string-tree: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-bind-string-tree: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-string-tree: arg 1: expected native") + return env.NewError("binding-bind-string-tree: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *map[string]string switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*map[string]string) - if !ok { + if vc, ok := v.Value.(*map[string]string); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-string-tree: arg 2: expected native of type *map[string]string") + return env.NewError("binding-bind-string-tree: arg 2: " + "expected native of type *map[string]string, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-string-tree: arg 2: expected integer to be 0 or nil") + return env.NewError("binding-bind-string-tree: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-string-tree: arg 2: expected native") + return env.NewError("binding-bind-string-tree: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BindStringTree(arg0Val, arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.ExternalStringTree)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.ExternalStringTree)") return res0Obj }, }, @@ -152889,39 +150339,22 @@ var Builtins = map[string]*env.Builtin{ Doc: "binding.BindStruct", Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var arg0Val any + var arg0Val interface{} switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-struct: arg 1: expected native of type any") + return env.NewError("binding-bind-struct: arg 1: " + "expected native of type interface{}, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("binding-bind-struct: arg 1: expected native") + return env.NewError("binding-bind-struct: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BindStruct(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.Struct)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.Struct)") return res0Obj }, }, @@ -152929,39 +150362,22 @@ var Builtins = map[string]*env.Builtin{ Doc: "binding.BindUntyped", Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var arg0Val any + var arg0Val interface{} switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-untyped: arg 1: expected native of type any") + return env.NewError("binding-bind-untyped: arg 1: " + "expected native of type interface{}, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("binding-bind-untyped: arg 1: expected native") + return env.NewError("binding-bind-untyped: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BindUntyped(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.ExternalUntyped)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.ExternalUntyped)") return res0Obj }, }, @@ -152969,45 +150385,28 @@ var Builtins = map[string]*env.Builtin{ Doc: "binding.BindUntypedList", Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var arg0Val *[]any + var arg0Val *[]interface{} switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*[]any) - if !ok { + if vc, ok := v.Value.(*[]interface{}); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-untyped-list: arg 1: expected native of type *[]any") + return env.NewError("binding-bind-untyped-list: arg 1: " + "expected native of type *[]interface{}, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-untyped-list: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-bind-untyped-list: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-untyped-list: arg 1: expected native") + return env.NewError("binding-bind-untyped-list: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BindUntypedList(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.ExternalUntypedList)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.ExternalUntypedList)") return res0Obj }, }, @@ -153015,45 +150414,28 @@ var Builtins = map[string]*env.Builtin{ Doc: "binding.BindUntypedMap", Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var arg0Val *map[string]any + var arg0Val *map[string]interface{} switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*map[string]any) - if !ok { + if vc, ok := v.Value.(*map[string]interface{}); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-untyped-map: arg 1: expected native of type *map[string]any") + return env.NewError("binding-bind-untyped-map: arg 1: " + "expected native of type *map[string]interface{}, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-untyped-map: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-bind-untyped-map: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-untyped-map: arg 1: expected native") + return env.NewError("binding-bind-untyped-map: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BindUntypedMap(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.ExternalUntypedMap)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.ExternalUntypedMap)") return res0Obj }, }, @@ -153064,42 +150446,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.URI switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.URI) - if !ok { + if vc, ok := v.Value.(*fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-uri: arg 1: expected native of type *fyne.URI") + return env.NewError("binding-bind-uri: arg 1: " + "expected native of type *fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-uri: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-bind-uri: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-uri: arg 1: expected native") + return env.NewError("binding-bind-uri: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BindURI(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.ExternalURI)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.ExternalURI)") return res0Obj }, }, @@ -153110,42 +150475,25 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *[]fyne.URI switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*[]fyne.URI) - if !ok { + if vc, ok := v.Value.(*[]fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-uri-list: arg 1: expected native of type *[]fyne.URI") + return env.NewError("binding-bind-uri-list: arg 1: " + "expected native of type *[]fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-uri-list: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-bind-uri-list: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-uri-list: arg 1: expected native") + return env.NewError("binding-bind-uri-list: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BindURIList(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.ExternalURIList)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.ExternalURIList)") return res0Obj }, }, @@ -153156,61 +150504,44 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *map[string][]string switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*map[string][]string) - if !ok { + if vc, ok := v.Value.(*map[string][]string); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-uri-tree: arg 1: expected native of type *map[string][]string") + return env.NewError("binding-bind-uri-tree: arg 1: " + "expected native of type *map[string][]string, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-uri-tree: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-bind-uri-tree: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-uri-tree: arg 1: expected native") + return env.NewError("binding-bind-uri-tree: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *map[string]fyne.URI switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*map[string]fyne.URI) - if !ok { + if vc, ok := v.Value.(*map[string]fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bind-uri-tree: arg 2: expected native of type *map[string]fyne.URI") + return env.NewError("binding-bind-uri-tree: arg 2: " + "expected native of type *map[string]fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bind-uri-tree: arg 2: expected integer to be 0 or nil") + return env.NewError("binding-bind-uri-tree: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bind-uri-tree: arg 2: expected native") + return env.NewError("binding-bind-uri-tree: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BindURITree(arg0Val, arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.ExternalURITree)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.ExternalURITree)") return res0Obj }, }, @@ -153225,45 +150556,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Bool(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("binding-bool-to-string: arg 1: " + err.Error() + "") + return env.NewError("binding-bool-to-string: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Bool) - if !ok { + if vc, ok := v.Value.(binding.Bool); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bool-to-string: arg 1: expected native of type binding.Bool") + return env.NewError("binding-bool-to-string: arg 1: " + "expected native of type binding.Bool, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bool-to-string: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-bool-to-string: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bool-to-string: arg 1: expected native") + return env.NewError("binding-bool-to-string: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.BoolToString(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.String)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.String)") return res0Obj }, }, @@ -153278,52 +150592,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Bool(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("binding-bool-to-string-with-format: arg 1: " + err.Error() + "") + return env.NewError("binding-bool-to-string-with-format: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Bool) - if !ok { + if vc, ok := v.Value.(binding.Bool); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-bool-to-string-with-format: arg 1: expected native of type binding.Bool") + return env.NewError("binding-bool-to-string-with-format: arg 1: " + "expected native of type binding.Bool, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-bool-to-string-with-format: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-bool-to-string-with-format: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-bool-to-string-with-format: arg 1: expected native") + return env.NewError("binding-bool-to-string-with-format: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("binding-bool-to-string-with-format: arg 2: expected string") + return env.NewError("binding-bool-to-string-with-format: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := binding.BoolToStringWithFormat(arg0Val, arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.String)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.String)") return res0Obj }, }, @@ -153338,45 +150635,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Float(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("binding-float-to-string: arg 1: " + err.Error() + "") + return env.NewError("binding-float-to-string: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Float) - if !ok { + if vc, ok := v.Value.(binding.Float); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-float-to-string: arg 1: expected native of type binding.Float") + return env.NewError("binding-float-to-string: arg 1: " + "expected native of type binding.Float, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-float-to-string: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-float-to-string: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-float-to-string: arg 1: expected native") + return env.NewError("binding-float-to-string: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.FloatToString(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.String)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.String)") return res0Obj }, }, @@ -153391,52 +150671,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Float(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("binding-float-to-string-with-format: arg 1: " + err.Error() + "") + return env.NewError("binding-float-to-string-with-format: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Float) - if !ok { + if vc, ok := v.Value.(binding.Float); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-float-to-string-with-format: arg 1: expected native of type binding.Float") + return env.NewError("binding-float-to-string-with-format: arg 1: " + "expected native of type binding.Float, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-float-to-string-with-format: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-float-to-string-with-format: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-float-to-string-with-format: arg 1: expected native") + return env.NewError("binding-float-to-string-with-format: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("binding-float-to-string-with-format: arg 2: expected string") + return env.NewError("binding-float-to-string-with-format: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := binding.FloatToStringWithFormat(arg0Val, arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.String)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.String)") return res0Obj }, }, @@ -153451,45 +150714,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Int(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("binding-int-to-string: arg 1: " + err.Error() + "") + return env.NewError("binding-int-to-string: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Int) - if !ok { + if vc, ok := v.Value.(binding.Int); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-int-to-string: arg 1: expected native of type binding.Int") + return env.NewError("binding-int-to-string: arg 1: " + "expected native of type binding.Int, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-int-to-string: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-int-to-string: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-int-to-string: arg 1: expected native") + return env.NewError("binding-int-to-string: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.IntToString(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.String)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.String)") return res0Obj }, }, @@ -153504,52 +150750,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Int(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("binding-int-to-string-with-format: arg 1: " + err.Error() + "") + return env.NewError("binding-int-to-string-with-format: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Int) - if !ok { + if vc, ok := v.Value.(binding.Int); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-int-to-string-with-format: arg 1: expected native of type binding.Int") + return env.NewError("binding-int-to-string-with-format: arg 1: " + "expected native of type binding.Int, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-int-to-string-with-format: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-int-to-string-with-format: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-int-to-string-with-format: arg 1: expected native") + return env.NewError("binding-int-to-string-with-format: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("binding-int-to-string-with-format: arg 2: expected string") + return env.NewError("binding-int-to-string-with-format: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := binding.IntToStringWithFormat(arg0Val, arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.String)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.String)") return res0Obj }, }, @@ -153559,24 +150788,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := binding.NewBool() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.Bool)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.Bool)") return res0Obj }, }, @@ -153586,24 +150798,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := binding.NewBoolList() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.BoolList)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.BoolList)") return res0Obj }, }, @@ -153613,24 +150808,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := binding.NewBoolTree() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.BoolTree)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.BoolTree)") return res0Obj }, }, @@ -153640,24 +150818,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := binding.NewBytes() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.Bytes)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.Bytes)") return res0Obj }, }, @@ -153667,24 +150828,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := binding.NewBytesList() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.BytesList)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.BytesList)") return res0Obj }, }, @@ -153694,24 +150838,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := binding.NewBytesTree() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.BytesTree)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.BytesTree)") return res0Obj }, }, @@ -153724,7 +150851,7 @@ var Builtins = map[string]*env.Builtin{ case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("binding-data-listener: arg 1: function has invalid number of arguments (expected 0)") + return env.NewError("binding-data-listener: arg 1: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } arg0Val = func() { actualFn := fn @@ -153734,33 +150861,16 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-data-listener: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-data-listener: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-data-listener: arg 1: expected function or nil") + return env.NewError("binding-data-listener: arg 1: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } res0 := binding.NewDataListener(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.DataListener)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.DataListener)") return res0Obj }, }, @@ -153770,24 +150880,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := binding.NewFloat() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.Float)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.Float)") return res0Obj }, }, @@ -153797,24 +150890,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := binding.NewFloatList() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.FloatList)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.FloatList)") return res0Obj }, }, @@ -153824,24 +150900,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := binding.NewFloatTree() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.FloatTree)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.FloatTree)") return res0Obj }, }, @@ -153851,24 +150910,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := binding.NewInt() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.Int)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.Int)") return res0Obj }, }, @@ -153878,24 +150920,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := binding.NewIntList() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.IntList)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.IntList)") return res0Obj }, }, @@ -153905,24 +150930,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := binding.NewIntTree() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.IntTree)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.IntTree)") return res0Obj }, }, @@ -153932,24 +150940,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := binding.NewRune() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.Rune)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.Rune)") return res0Obj }, }, @@ -153959,24 +150950,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := binding.NewRuneList() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.RuneList)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.RuneList)") return res0Obj }, }, @@ -153986,24 +150960,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := binding.NewRuneTree() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.RuneTree)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.RuneTree)") return res0Obj }, }, @@ -154012,11 +150969,11 @@ var Builtins = map[string]*env.Builtin{ Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("binding-sprintf: arg 1: expected string") + return env.NewError("binding-sprintf: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val []binding.DataItem switch v := arg1.(type) { @@ -154029,63 +150986,39 @@ var Builtins = map[string]*env.Builtin{ arg1Val[i], err = ctxTo_binding_DataItem(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("binding-sprintf: arg 2: block item: " + err.Error() + "") + return env.NewError("binding-sprintf: arg 2: " + "block item: " + err.Error()) } case env.Native: - var ok bool - arg1Val[i], ok = v.Value.(binding.DataItem) - if !ok { + if vc, ok := v.Value.(binding.DataItem); ok { + arg1Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("binding-sprintf: arg 2: block item: expected native of type binding.DataItem") + return env.NewError("binding-sprintf: arg 2: " + "block item: " + "expected native of type binding.DataItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-sprintf: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("binding-sprintf: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val[i] = nil default: ps.FailureFlag = true - return env.NewError("binding-sprintf: arg 2: block item: expected native") + return env.NewError("binding-sprintf: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]binding.DataItem) - if !ok { - ps.FailureFlag = true - return env.NewError("binding-sprintf: arg 2: expected native of type []binding.DataItem") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-sprintf: arg 2: expected integer to be 0 or nil") + return env.NewError("binding-sprintf: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("binding-sprintf: arg 2: expected block, native or nil") + return env.NewError("binding-sprintf: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.NewSprintf(arg0Val, arg1Val...) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.String)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.String)") return res0Obj }, }, @@ -154095,24 +151028,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := binding.NewString() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.String)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.String)") return res0Obj }, }, @@ -154122,24 +151038,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := binding.NewStringList() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.StringList)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.StringList)") return res0Obj }, }, @@ -154149,24 +151048,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := binding.NewStringTree() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.StringTree)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.StringTree)") return res0Obj }, }, @@ -154176,24 +151058,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := binding.NewUntyped() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.Untyped)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.Untyped)") return res0Obj }, }, @@ -154203,24 +151068,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := binding.NewUntypedList() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.UntypedList)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.UntypedList)") return res0Obj }, }, @@ -154230,24 +151078,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := binding.NewUntypedMap() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.UntypedMap)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.UntypedMap)") return res0Obj }, }, @@ -154257,24 +151088,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := binding.NewURI() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.URI)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.URI)") return res0Obj }, }, @@ -154284,24 +151098,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := binding.NewURIList() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.URIList)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.URIList)") return res0Obj }, }, @@ -154311,24 +151108,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := binding.NewURITree() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.URITree)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.URITree)") return res0Obj }, }, @@ -154343,45 +151123,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Bool(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("binding-not: arg 1: " + err.Error() + "") + return env.NewError("binding-not: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Bool) - if !ok { + if vc, ok := v.Value.(binding.Bool); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-not: arg 1: expected native of type binding.Bool") + return env.NewError("binding-not: arg 1: " + "expected native of type binding.Bool, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-not: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-not: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-not: arg 1: expected native") + return env.NewError("binding-not: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.Not(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.Bool)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.Bool)") return res0Obj }, }, @@ -154400,63 +151163,39 @@ var Builtins = map[string]*env.Builtin{ arg0Val[i], err = ctxTo_binding_Bool(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("binding-or: arg 1: block item: " + err.Error() + "") + return env.NewError("binding-or: arg 1: " + "block item: " + err.Error()) } case env.Native: - var ok bool - arg0Val[i], ok = v.Value.(binding.Bool) - if !ok { + if vc, ok := v.Value.(binding.Bool); ok { + arg0Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("binding-or: arg 1: block item: expected native of type binding.Bool") + return env.NewError("binding-or: arg 1: " + "block item: " + "expected native of type binding.Bool, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-or: arg 1: block item: expected integer to be 0 or nil") + return env.NewError("binding-or: arg 1: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val[i] = nil default: ps.FailureFlag = true - return env.NewError("binding-or: arg 1: block item: expected native") + return env.NewError("binding-or: arg 1: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg0Val, ok = v.Value.([]binding.Bool) - if !ok { - ps.FailureFlag = true - return env.NewError("binding-or: arg 1: expected native of type []binding.Bool") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-or: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-or: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-or: arg 1: expected block, native or nil") + return env.NewError("binding-or: arg 1: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.Or(arg0Val...) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.Bool)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.Bool)") return res0Obj }, }, @@ -154471,45 +151210,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_String(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("binding-string-to-bool: arg 1: " + err.Error() + "") + return env.NewError("binding-string-to-bool: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.String) - if !ok { + if vc, ok := v.Value.(binding.String); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-string-to-bool: arg 1: expected native of type binding.String") + return env.NewError("binding-string-to-bool: arg 1: " + "expected native of type binding.String, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-string-to-bool: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-string-to-bool: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-string-to-bool: arg 1: expected native") + return env.NewError("binding-string-to-bool: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.StringToBool(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.Bool)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.Bool)") return res0Obj }, }, @@ -154524,52 +151246,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_String(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("binding-string-to-bool-with-format: arg 1: " + err.Error() + "") + return env.NewError("binding-string-to-bool-with-format: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.String) - if !ok { + if vc, ok := v.Value.(binding.String); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-string-to-bool-with-format: arg 1: expected native of type binding.String") + return env.NewError("binding-string-to-bool-with-format: arg 1: " + "expected native of type binding.String, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-string-to-bool-with-format: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-string-to-bool-with-format: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-string-to-bool-with-format: arg 1: expected native") + return env.NewError("binding-string-to-bool-with-format: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("binding-string-to-bool-with-format: arg 2: expected string") + return env.NewError("binding-string-to-bool-with-format: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := binding.StringToBoolWithFormat(arg0Val, arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.Bool)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.Bool)") return res0Obj }, }, @@ -154584,45 +151289,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_String(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("binding-string-to-float: arg 1: " + err.Error() + "") + return env.NewError("binding-string-to-float: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.String) - if !ok { + if vc, ok := v.Value.(binding.String); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-string-to-float: arg 1: expected native of type binding.String") + return env.NewError("binding-string-to-float: arg 1: " + "expected native of type binding.String, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-string-to-float: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-string-to-float: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-string-to-float: arg 1: expected native") + return env.NewError("binding-string-to-float: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.StringToFloat(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.Float)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.Float)") return res0Obj }, }, @@ -154637,52 +151325,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_String(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("binding-string-to-float-with-format: arg 1: " + err.Error() + "") + return env.NewError("binding-string-to-float-with-format: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.String) - if !ok { + if vc, ok := v.Value.(binding.String); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-string-to-float-with-format: arg 1: expected native of type binding.String") + return env.NewError("binding-string-to-float-with-format: arg 1: " + "expected native of type binding.String, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-string-to-float-with-format: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-string-to-float-with-format: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-string-to-float-with-format: arg 1: expected native") + return env.NewError("binding-string-to-float-with-format: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("binding-string-to-float-with-format: arg 2: expected string") + return env.NewError("binding-string-to-float-with-format: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := binding.StringToFloatWithFormat(arg0Val, arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.Float)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.Float)") return res0Obj }, }, @@ -154697,45 +151368,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_String(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("binding-string-to-int: arg 1: " + err.Error() + "") + return env.NewError("binding-string-to-int: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.String) - if !ok { + if vc, ok := v.Value.(binding.String); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-string-to-int: arg 1: expected native of type binding.String") + return env.NewError("binding-string-to-int: arg 1: " + "expected native of type binding.String, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-string-to-int: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-string-to-int: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-string-to-int: arg 1: expected native") + return env.NewError("binding-string-to-int: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.StringToInt(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.Int)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.Int)") return res0Obj }, }, @@ -154750,52 +151404,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_String(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("binding-string-to-int-with-format: arg 1: " + err.Error() + "") + return env.NewError("binding-string-to-int-with-format: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.String) - if !ok { + if vc, ok := v.Value.(binding.String); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-string-to-int-with-format: arg 1: expected native of type binding.String") + return env.NewError("binding-string-to-int-with-format: arg 1: " + "expected native of type binding.String, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-string-to-int-with-format: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-string-to-int-with-format: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-string-to-int-with-format: arg 1: expected native") + return env.NewError("binding-string-to-int-with-format: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("binding-string-to-int-with-format: arg 2: expected string") + return env.NewError("binding-string-to-int-with-format: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := binding.StringToIntWithFormat(arg0Val, arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.Int)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.Int)") return res0Obj }, }, @@ -154810,52 +151447,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_String(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("binding-string-to-string-with-format: arg 1: " + err.Error() + "") + return env.NewError("binding-string-to-string-with-format: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.String) - if !ok { + if vc, ok := v.Value.(binding.String); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-string-to-string-with-format: arg 1: expected native of type binding.String") + return env.NewError("binding-string-to-string-with-format: arg 1: " + "expected native of type binding.String, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-string-to-string-with-format: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-string-to-string-with-format: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-string-to-string-with-format: arg 1: expected native") + return env.NewError("binding-string-to-string-with-format: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("binding-string-to-string-with-format: arg 2: expected string") + return env.NewError("binding-string-to-string-with-format: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := binding.StringToStringWithFormat(arg0Val, arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.String)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.String)") return res0Obj }, }, @@ -154870,45 +151490,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_String(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("binding-string-to-uri: arg 1: " + err.Error() + "") + return env.NewError("binding-string-to-uri: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.String) - if !ok { + if vc, ok := v.Value.(binding.String); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-string-to-uri: arg 1: expected native of type binding.String") + return env.NewError("binding-string-to-uri: arg 1: " + "expected native of type binding.String, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-string-to-uri: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-string-to-uri: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-string-to-uri: arg 1: expected native") + return env.NewError("binding-string-to-uri: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.StringToURI(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.URI)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.URI)") return res0Obj }, }, @@ -154923,45 +151526,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("binding-uri-to-string: arg 1: " + err.Error() + "") + return env.NewError("binding-uri-to-string: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.URI) - if !ok { + if vc, ok := v.Value.(binding.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("binding-uri-to-string: arg 1: expected native of type binding.URI") + return env.NewError("binding-uri-to-string: arg 1: " + "expected native of type binding.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("binding-uri-to-string: arg 1: expected integer to be 0 or nil") + return env.NewError("binding-uri-to-string: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("binding-uri-to-string: arg 1: expected native") + return env.NewError("binding-uri-to-string: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := binding.URIToString(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(binding.String)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(binding.String)") return res0Obj }, }, @@ -155026,15 +151612,15 @@ var Builtins = map[string]*env.Builtin{ var arg0Val color.Color switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("canvas-circle: arg 1: expected native of type color.Color") + return env.NewError("canvas-circle: arg 1: " + "expected native of type color.Color, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("canvas-circle: arg 1: expected native") + return env.NewError("canvas-circle: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := canvas.NewCircle(arg0Val) var res0Obj env.Object @@ -155049,65 +151635,65 @@ var Builtins = map[string]*env.Builtin{ var arg0Val color.Color switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("canvas-color-rgba-animation: arg 1: expected native of type color.Color") + return env.NewError("canvas-color-rgba-animation: arg 1: " + "expected native of type color.Color, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("canvas-color-rgba-animation: arg 1: expected native") + return env.NewError("canvas-color-rgba-animation: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val color.Color switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("canvas-color-rgba-animation: arg 2: expected native of type color.Color") + return env.NewError("canvas-color-rgba-animation: arg 2: " + "expected native of type color.Color, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("canvas-color-rgba-animation: arg 2: expected native") + return env.NewError("canvas-color-rgba-animation: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg2Val time.Duration switch v := arg2.(type) { case env.Native: - var ok bool - arg2Val, ok = v.Value.(time.Duration) - if !ok { + if vc, ok := v.Value.(time.Duration); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("canvas-color-rgba-animation: arg 3: expected native of type time.Duration") + return env.NewError("canvas-color-rgba-animation: arg 3: " + "expected native of type time.Duration, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("canvas-color-rgba-animation: arg 3: expected native") + return env.NewError("canvas-color-rgba-animation: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg3Val func(color.Color) switch fn := arg3.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("canvas-color-rgba-animation: arg 4: function has invalid number of arguments (expected 1)") + return env.NewError("canvas-color-rgba-animation: arg 4: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg3Val = func(arg0 color.Color) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(color.Color)") + arg3Val = func(farg0 color.Color) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(color.Color)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("canvas-color-rgba-animation: arg 4: expected integer to be 0 or nil") + return env.NewError("canvas-color-rgba-animation: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("canvas-color-rgba-animation: arg 4: expected function or nil") + return env.NewError("canvas-color-rgba-animation: arg 4: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } res0 := canvas.NewColorRGBAAnimation(arg0Val, arg1Val, arg2Val, arg3Val) var res0Obj env.Object @@ -155122,28 +151708,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val color.Color switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("canvas-horizontal-gradient: arg 1: expected native of type color.Color") + return env.NewError("canvas-horizontal-gradient: arg 1: " + "expected native of type color.Color, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("canvas-horizontal-gradient: arg 1: expected native") + return env.NewError("canvas-horizontal-gradient: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val color.Color switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("canvas-horizontal-gradient: arg 2: expected native of type color.Color") + return env.NewError("canvas-horizontal-gradient: arg 2: " + "expected native of type color.Color, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("canvas-horizontal-gradient: arg 2: expected native") + return env.NewError("canvas-horizontal-gradient: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := canvas.NewHorizontalGradient(arg0Val, arg1Val) var res0Obj env.Object @@ -155166,11 +151752,11 @@ var Builtins = map[string]*env.Builtin{ Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("canvas-image-from-file: arg 1: expected string") + return env.NewError("canvas-image-from-file: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } res0 := canvas.NewImageFromFile(arg0Val) var res0Obj env.Object @@ -155185,15 +151771,15 @@ var Builtins = map[string]*env.Builtin{ var arg0Val image.Image switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(image.Image) - if !ok { + if vc, ok := v.Value.(image.Image); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("canvas-image-from-image: arg 1: expected native of type image.Image") + return env.NewError("canvas-image-from-image: arg 1: " + "expected native of type image.Image, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("canvas-image-from-image: arg 1: expected native") + return env.NewError("canvas-image-from-image: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := canvas.NewImageFromImage(arg0Val) var res0Obj env.Object @@ -155212,31 +151798,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_io_Reader(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("canvas-image-from-reader: arg 1: " + err.Error() + "") + return env.NewError("canvas-image-from-reader: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(io.Reader) - if !ok { + if vc, ok := v.Value.(io.Reader); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("canvas-image-from-reader: arg 1: expected native of type io.Reader") + return env.NewError("canvas-image-from-reader: arg 1: " + "expected native of type io.Reader, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("canvas-image-from-reader: arg 1: expected integer to be 0 or nil") + return env.NewError("canvas-image-from-reader: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("canvas-image-from-reader: arg 1: expected native") + return env.NewError("canvas-image-from-reader: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("canvas-image-from-reader: arg 2: expected string") + return env.NewError("canvas-image-from-reader: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := canvas.NewImageFromReader(arg0Val, arg1Val) var res0Obj env.Object @@ -155255,24 +151841,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Resource(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("canvas-image-from-resource: arg 1: " + err.Error() + "") + return env.NewError("canvas-image-from-resource: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("canvas-image-from-resource: arg 1: expected native of type fyne.Resource") + return env.NewError("canvas-image-from-resource: arg 1: " + "expected native of type fyne.Resource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("canvas-image-from-resource: arg 1: expected integer to be 0 or nil") + return env.NewError("canvas-image-from-resource: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("canvas-image-from-resource: arg 1: expected native") + return env.NewError("canvas-image-from-resource: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := canvas.NewImageFromResource(arg0Val) var res0Obj env.Object @@ -155291,24 +151877,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("canvas-image-from-uri: arg 1: " + err.Error() + "") + return env.NewError("canvas-image-from-uri: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("canvas-image-from-uri: arg 1: expected native of type fyne.URI") + return env.NewError("canvas-image-from-uri: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("canvas-image-from-uri: arg 1: expected integer to be 0 or nil") + return env.NewError("canvas-image-from-uri: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("canvas-image-from-uri: arg 1: expected native") + return env.NewError("canvas-image-from-uri: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := canvas.NewImageFromURI(arg0Val) var res0Obj env.Object @@ -155323,15 +151909,15 @@ var Builtins = map[string]*env.Builtin{ var arg0Val color.Color switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("canvas-line: arg 1: expected native of type color.Color") + return env.NewError("canvas-line: arg 1: " + "expected native of type color.Color, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("canvas-line: arg 1: expected native") + return env.NewError("canvas-line: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := canvas.NewLine(arg0Val) var res0Obj env.Object @@ -155346,35 +151932,35 @@ var Builtins = map[string]*env.Builtin{ var arg0Val color.Color switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("canvas-linear-gradient: arg 1: expected native of type color.Color") + return env.NewError("canvas-linear-gradient: arg 1: " + "expected native of type color.Color, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("canvas-linear-gradient: arg 1: expected native") + return env.NewError("canvas-linear-gradient: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val color.Color switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("canvas-linear-gradient: arg 2: expected native of type color.Color") + return env.NewError("canvas-linear-gradient: arg 2: " + "expected native of type color.Color, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("canvas-linear-gradient: arg 2: expected native") + return env.NewError("canvas-linear-gradient: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg2Val float64 - if v, ok := arg2.(env.Decimal); ok { - arg2Val = float64(v.Value) + if vc, ok := arg2.(env.Decimal); ok { + arg2Val = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("canvas-linear-gradient: arg 3: expected decimal") + return env.NewError("canvas-linear-gradient: arg 3: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg2)) } res0 := canvas.NewLinearGradient(arg0Val, arg1Val, arg2Val) var res0Obj env.Object @@ -155386,82 +151972,70 @@ var Builtins = map[string]*env.Builtin{ Doc: "canvas.NewPositionAnimation", Argsn: 4, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var arg0Val *fyne.Position + var arg0Val fyne.Position switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("canvas-position-animation: arg 1: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg0Val = *vc + } else { ps.FailureFlag = true - return env.NewError("canvas-position-animation: arg 1: expected integer to be 0 or nil") + return env.NewError("canvas-position-animation: arg 1: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg0Val = nil default: ps.FailureFlag = true - return env.NewError("canvas-position-animation: arg 1: expected native") + return env.NewError("canvas-position-animation: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("canvas-position-animation: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("canvas-position-animation: arg 2: expected integer to be 0 or nil") + return env.NewError("canvas-position-animation: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("canvas-position-animation: arg 2: expected native") + return env.NewError("canvas-position-animation: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg2Val time.Duration switch v := arg2.(type) { case env.Native: - var ok bool - arg2Val, ok = v.Value.(time.Duration) - if !ok { + if vc, ok := v.Value.(time.Duration); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("canvas-position-animation: arg 3: expected native of type time.Duration") + return env.NewError("canvas-position-animation: arg 3: " + "expected native of type time.Duration, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("canvas-position-animation: arg 3: expected native") + return env.NewError("canvas-position-animation: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg3Val func(fyne.Position) switch fn := arg3.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("canvas-position-animation: arg 4: function has invalid number of arguments (expected 1)") + return env.NewError("canvas-position-animation: arg 4: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg3Val = func(arg0 fyne.Position) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, &arg0, "Go(*fyne.Position)") + arg3Val = func(farg0 fyne.Position) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, &farg0, "Go(*fyne.Position)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("canvas-position-animation: arg 4: expected integer to be 0 or nil") + return env.NewError("canvas-position-animation: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("canvas-position-animation: arg 4: expected function or nil") + return env.NewError("canvas-position-animation: arg 4: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } - res0 := canvas.NewPositionAnimation(*arg0Val, *arg1Val, arg2Val, arg3Val) + res0 := canvas.NewPositionAnimation(arg0Val, arg1Val, arg2Val, arg3Val) var res0Obj env.Object res0Obj = *env.NewNative(ps.Idx, res0, "Go(*fyne.Animation)") return res0Obj @@ -155474,28 +152048,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val color.Color switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("canvas-radial-gradient: arg 1: expected native of type color.Color") + return env.NewError("canvas-radial-gradient: arg 1: " + "expected native of type color.Color, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("canvas-radial-gradient: arg 1: expected native") + return env.NewError("canvas-radial-gradient: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val color.Color switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("canvas-radial-gradient: arg 2: expected native of type color.Color") + return env.NewError("canvas-radial-gradient: arg 2: " + "expected native of type color.Color, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("canvas-radial-gradient: arg 2: expected native") + return env.NewError("canvas-radial-gradient: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := canvas.NewRadialGradient(arg0Val, arg1Val) var res0Obj env.Object @@ -155512,31 +152086,33 @@ var Builtins = map[string]*env.Builtin{ case env.Function: if fn.Argsn != 2 { ps.FailureFlag = true - return env.NewError("canvas-raster: arg 1: function has invalid number of arguments (expected 2)") + return env.NewError("canvas-raster: arg 1: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg0Val = func(arg0 int, arg1 int) image.Image { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) - arg1Val = *env.NewInteger(int64(arg1)) + arg0Val = func(farg0 int, farg1 int) image.Image { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) + farg1Val = *env.NewInteger(int64(farg1)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val, farg1Val) var res image.Image switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(image.Image) - if !ok { + if vc, ok := v.Value.(image.Image); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "canvas-raster: arg 1: callback result: expected native of type image.Image", + "canvas-raster: arg 1: callback result: "+"expected native of type image.Image, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "canvas-raster: arg 1: callback result: expected native", + "canvas-raster: arg 1: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -155547,12 +152123,12 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("canvas-raster: arg 1: expected integer to be 0 or nil") + return env.NewError("canvas-raster: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("canvas-raster: arg 1: expected function or nil") + return env.NewError("canvas-raster: arg 1: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } res0 := canvas.NewRaster(arg0Val) var res0Obj env.Object @@ -155567,15 +152143,15 @@ var Builtins = map[string]*env.Builtin{ var arg0Val image.Image switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(image.Image) - if !ok { + if vc, ok := v.Value.(image.Image); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("canvas-raster-from-image: arg 1: expected native of type image.Image") + return env.NewError("canvas-raster-from-image: arg 1: " + "expected native of type image.Image, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("canvas-raster-from-image: arg 1: expected native") + return env.NewError("canvas-raster-from-image: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := canvas.NewRasterFromImage(arg0Val) var res0Obj env.Object @@ -155592,33 +152168,35 @@ var Builtins = map[string]*env.Builtin{ case env.Function: if fn.Argsn != 4 { ps.FailureFlag = true - return env.NewError("canvas-raster-with-pixels: arg 1: function has invalid number of arguments (expected 4)") + return env.NewError("canvas-raster-with-pixels: arg 1: " + "expected 4 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg0Val = func(arg0 int, arg1 int, arg2 int, arg3 int) color.Color { - var arg0Val, arg1Val, arg2Val, arg3Val env.Object - arg0Val = *env.NewInteger(int64(arg0)) - arg1Val = *env.NewInteger(int64(arg1)) - arg2Val = *env.NewInteger(int64(arg2)) - arg3Val = *env.NewInteger(int64(arg3)) + arg0Val = func(farg0 int, farg1 int, farg2 int, farg3 int) color.Color { + var farg0Val, farg1Val, farg2Val, farg3Val env.Object + farg0Val = *env.NewInteger(int64(farg0)) + farg1Val = *env.NewInteger(int64(farg1)) + farg2Val = *env.NewInteger(int64(farg2)) + farg3Val = *env.NewInteger(int64(farg3)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val, arg1Val, arg2Val, arg3Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val, farg1Val, farg2Val, farg3Val) var res color.Color switch v := ps.Res.(type) { case env.Native: - var ok bool - res, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "canvas-raster-with-pixels: arg 1: callback result: expected native of type color.Color", + "canvas-raster-with-pixels: arg 1: callback result: "+"expected native of type color.Color, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "canvas-raster-with-pixels: arg 1: callback result: expected native", + "canvas-raster-with-pixels: arg 1: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -155629,12 +152207,12 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("canvas-raster-with-pixels: arg 1: expected integer to be 0 or nil") + return env.NewError("canvas-raster-with-pixels: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("canvas-raster-with-pixels: arg 1: expected function or nil") + return env.NewError("canvas-raster-with-pixels: arg 1: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } res0 := canvas.NewRasterWithPixels(arg0Val) var res0Obj env.Object @@ -155649,15 +152227,15 @@ var Builtins = map[string]*env.Builtin{ var arg0Val color.Color switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("canvas-rectangle: arg 1: expected native of type color.Color") + return env.NewError("canvas-rectangle: arg 1: " + "expected native of type color.Color, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("canvas-rectangle: arg 1: expected native") + return env.NewError("canvas-rectangle: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := canvas.NewRectangle(arg0Val) var res0Obj env.Object @@ -155669,82 +152247,70 @@ var Builtins = map[string]*env.Builtin{ Doc: "canvas.NewSizeAnimation", Argsn: 4, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var arg0Val *fyne.Size + var arg0Val fyne.Size switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("canvas-size-animation: arg 1: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg0Val = *vc + } else { ps.FailureFlag = true - return env.NewError("canvas-size-animation: arg 1: expected integer to be 0 or nil") + return env.NewError("canvas-size-animation: arg 1: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg0Val = nil default: ps.FailureFlag = true - return env.NewError("canvas-size-animation: arg 1: expected native") + return env.NewError("canvas-size-animation: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Size + var arg1Val fyne.Size switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("canvas-size-animation: arg 2: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("canvas-size-animation: arg 2: expected integer to be 0 or nil") + return env.NewError("canvas-size-animation: arg 2: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("canvas-size-animation: arg 2: expected native") + return env.NewError("canvas-size-animation: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg2Val time.Duration switch v := arg2.(type) { case env.Native: - var ok bool - arg2Val, ok = v.Value.(time.Duration) - if !ok { + if vc, ok := v.Value.(time.Duration); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("canvas-size-animation: arg 3: expected native of type time.Duration") + return env.NewError("canvas-size-animation: arg 3: " + "expected native of type time.Duration, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("canvas-size-animation: arg 3: expected native") + return env.NewError("canvas-size-animation: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg3Val func(fyne.Size) switch fn := arg3.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("canvas-size-animation: arg 4: function has invalid number of arguments (expected 1)") + return env.NewError("canvas-size-animation: arg 4: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg3Val = func(arg0 fyne.Size) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, &arg0, "Go(*fyne.Size)") + arg3Val = func(farg0 fyne.Size) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, &farg0, "Go(*fyne.Size)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("canvas-size-animation: arg 4: expected integer to be 0 or nil") + return env.NewError("canvas-size-animation: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("canvas-size-animation: arg 4: expected function or nil") + return env.NewError("canvas-size-animation: arg 4: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } - res0 := canvas.NewSizeAnimation(*arg0Val, *arg1Val, arg2Val, arg3Val) + res0 := canvas.NewSizeAnimation(arg0Val, arg1Val, arg2Val, arg3Val) var res0Obj env.Object res0Obj = *env.NewNative(ps.Idx, res0, "Go(*fyne.Animation)") return res0Obj @@ -155755,24 +152321,24 @@ var Builtins = map[string]*env.Builtin{ Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("canvas-text: arg 1: expected string") + return env.NewError("canvas-text: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val color.Color switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("canvas-text: arg 2: expected native of type color.Color") + return env.NewError("canvas-text: arg 2: " + "expected native of type color.Color, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("canvas-text: arg 2: expected native") + return env.NewError("canvas-text: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := canvas.NewText(arg0Val, arg1Val) var res0Obj env.Object @@ -155787,28 +152353,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val color.Color switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("canvas-vertical-gradient: arg 1: expected native of type color.Color") + return env.NewError("canvas-vertical-gradient: arg 1: " + "expected native of type color.Color, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("canvas-vertical-gradient: arg 1: expected native") + return env.NewError("canvas-vertical-gradient: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val color.Color switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(color.Color) - if !ok { + if vc, ok := v.Value.(color.Color); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("canvas-vertical-gradient: arg 2: expected native of type color.Color") + return env.NewError("canvas-vertical-gradient: arg 2: " + "expected native of type color.Color, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("canvas-vertical-gradient: arg 2: expected native") + return env.NewError("canvas-vertical-gradient: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := canvas.NewVerticalGradient(arg0Val, arg1Val) var res0Obj env.Object @@ -155827,24 +152393,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("canvas-refresh: arg 1: " + err.Error() + "") + return env.NewError("canvas-refresh: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("canvas-refresh: arg 1: expected native of type fyne.CanvasObject") + return env.NewError("canvas-refresh: arg 1: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("canvas-refresh: arg 1: expected integer to be 0 or nil") + return env.NewError("canvas-refresh: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("canvas-refresh: arg 1: expected native") + return env.NewError("canvas-refresh: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } canvas.Refresh(arg0Val) return nil @@ -155861,24 +152427,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Layout(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("container-container: arg 1: " + err.Error() + "") + return env.NewError("container-container: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Layout) - if !ok { + if vc, ok := v.Value.(fyne.Layout); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("container-container: arg 1: expected native of type fyne.Layout") + return env.NewError("container-container: arg 1: " + "expected native of type fyne.Layout, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("container-container: arg 1: expected integer to be 0 or nil") + return env.NewError("container-container: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("container-container: arg 1: expected native") + return env.NewError("container-container: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []fyne.CanvasObject switch v := arg1.(type) { @@ -155891,42 +152457,35 @@ var Builtins = map[string]*env.Builtin{ arg1Val[i], err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("container-container: arg 2: block item: " + err.Error() + "") + return env.NewError("container-container: arg 2: " + "block item: " + err.Error()) } case env.Native: - var ok bool - arg1Val[i], ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("container-container: arg 2: block item: expected native of type fyne.CanvasObject") + return env.NewError("container-container: arg 2: " + "block item: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("container-container: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("container-container: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val[i] = nil default: ps.FailureFlag = true - return env.NewError("container-container: arg 2: block item: expected native") + return env.NewError("container-container: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]fyne.CanvasObject) - if !ok { - ps.FailureFlag = true - return env.NewError("container-container: arg 2: expected native of type []fyne.CanvasObject") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("container-container: arg 2: expected integer to be 0 or nil") + return env.NewError("container-container: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("container-container: arg 2: expected block, native or nil") + return env.NewError("container-container: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := container.New(arg0Val, arg1Val...) var res0Obj env.Object @@ -155939,11 +152498,11 @@ var Builtins = map[string]*env.Builtin{ Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val int - if v, ok := arg0.(env.Integer); ok { - arg0Val = int(v.Value) + if vc, ok := arg0.(env.Integer); ok { + arg0Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("adaptive-grid: arg 1: expected integer") + return env.NewError("adaptive-grid: arg 1: " + "expected integer, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val []fyne.CanvasObject switch v := arg1.(type) { @@ -155956,42 +152515,35 @@ var Builtins = map[string]*env.Builtin{ arg1Val[i], err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("adaptive-grid: arg 2: block item: " + err.Error() + "") + return env.NewError("adaptive-grid: arg 2: " + "block item: " + err.Error()) } case env.Native: - var ok bool - arg1Val[i], ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("adaptive-grid: arg 2: block item: expected native of type fyne.CanvasObject") + return env.NewError("adaptive-grid: arg 2: " + "block item: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("adaptive-grid: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("adaptive-grid: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val[i] = nil default: ps.FailureFlag = true - return env.NewError("adaptive-grid: arg 2: block item: expected native") + return env.NewError("adaptive-grid: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]fyne.CanvasObject) - if !ok { - ps.FailureFlag = true - return env.NewError("adaptive-grid: arg 2: expected native of type []fyne.CanvasObject") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("adaptive-grid: arg 2: expected integer to be 0 or nil") + return env.NewError("adaptive-grid: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("adaptive-grid: arg 2: expected block, native or nil") + return env.NewError("adaptive-grid: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := container.NewAdaptiveGrid(arg0Val, arg1Val...) var res0Obj env.Object @@ -156010,39 +152562,32 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg0Val[i], ok = v.Value.(*container.TabItem) - if !ok { + if vc, ok := v.Value.(*container.TabItem); ok { + arg0Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("app-tabs: arg 1: block item: expected native of type *container.TabItem") + return env.NewError("app-tabs: arg 1: " + "block item: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("app-tabs: arg 1: block item: expected integer to be 0 or nil") + return env.NewError("app-tabs: arg 1: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val[i] = nil default: ps.FailureFlag = true - return env.NewError("app-tabs: arg 1: block item: expected native") + return env.NewError("app-tabs: arg 1: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg0Val, ok = v.Value.([]*container.TabItem) - if !ok { - ps.FailureFlag = true - return env.NewError("app-tabs: arg 1: expected native of type []*container.TabItem") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("app-tabs: arg 1: expected integer to be 0 or nil") + return env.NewError("app-tabs: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("app-tabs: arg 1: expected block, native or nil") + return env.NewError("app-tabs: arg 1: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := container.NewAppTabs(arg0Val...) var res0Obj env.Object @@ -156061,24 +152606,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("border: arg 1: " + err.Error() + "") + return env.NewError("border: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("border: arg 1: expected native of type fyne.CanvasObject") + return env.NewError("border: arg 1: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("border: arg 1: expected integer to be 0 or nil") + return env.NewError("border: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("border: arg 1: expected native") + return env.NewError("border: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.CanvasObject switch v := arg1.(type) { @@ -156087,24 +152632,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("border: arg 2: " + err.Error() + "") + return env.NewError("border: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("border: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("border: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("border: arg 2: expected integer to be 0 or nil") + return env.NewError("border: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("border: arg 2: expected native") + return env.NewError("border: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg2Val fyne.CanvasObject switch v := arg2.(type) { @@ -156113,24 +152658,24 @@ var Builtins = map[string]*env.Builtin{ arg2Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("border: arg 3: " + err.Error() + "") + return env.NewError("border: arg 3: " + err.Error()) } case env.Native: - var ok bool - arg2Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("border: arg 3: expected native of type fyne.CanvasObject") + return env.NewError("border: arg 3: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("border: arg 3: expected integer to be 0 or nil") + return env.NewError("border: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("border: arg 3: expected native") + return env.NewError("border: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg3Val fyne.CanvasObject switch v := arg3.(type) { @@ -156139,24 +152684,24 @@ var Builtins = map[string]*env.Builtin{ arg3Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("border: arg 4: " + err.Error() + "") + return env.NewError("border: arg 4: " + err.Error()) } case env.Native: - var ok bool - arg3Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg3Val = vc + } else { ps.FailureFlag = true - return env.NewError("border: arg 4: expected native of type fyne.CanvasObject") + return env.NewError("border: arg 4: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("border: arg 4: expected integer to be 0 or nil") + return env.NewError("border: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("border: arg 4: expected native") + return env.NewError("border: arg 4: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg4Val []fyne.CanvasObject switch v := arg4.(type) { @@ -156169,42 +152714,35 @@ var Builtins = map[string]*env.Builtin{ arg4Val[i], err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("border: arg 5: block item: " + err.Error() + "") + return env.NewError("border: arg 5: " + "block item: " + err.Error()) } case env.Native: - var ok bool - arg4Val[i], ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg4Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("border: arg 5: block item: expected native of type fyne.CanvasObject") + return env.NewError("border: arg 5: " + "block item: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("border: arg 5: block item: expected integer to be 0 or nil") + return env.NewError("border: arg 5: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg4Val[i] = nil default: ps.FailureFlag = true - return env.NewError("border: arg 5: block item: expected native") + return env.NewError("border: arg 5: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg4Val, ok = v.Value.([]fyne.CanvasObject) - if !ok { - ps.FailureFlag = true - return env.NewError("border: arg 5: expected native of type []fyne.CanvasObject") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("border: arg 5: expected integer to be 0 or nil") + return env.NewError("border: arg 5: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg4Val = nil default: ps.FailureFlag = true - return env.NewError("border: arg 5: expected block, native or nil") + return env.NewError("border: arg 5: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := container.NewBorder(arg0Val, arg1Val, arg2Val, arg3Val, arg4Val...) var res0Obj env.Object @@ -156227,42 +152765,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val[i], err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("center: arg 1: block item: " + err.Error() + "") + return env.NewError("center: arg 1: " + "block item: " + err.Error()) } case env.Native: - var ok bool - arg0Val[i], ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("center: arg 1: block item: expected native of type fyne.CanvasObject") + return env.NewError("center: arg 1: " + "block item: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("center: arg 1: block item: expected integer to be 0 or nil") + return env.NewError("center: arg 1: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val[i] = nil default: ps.FailureFlag = true - return env.NewError("center: arg 1: block item: expected native") + return env.NewError("center: arg 1: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg0Val, ok = v.Value.([]fyne.CanvasObject) - if !ok { - ps.FailureFlag = true - return env.NewError("center: arg 1: expected native of type []fyne.CanvasObject") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("center: arg 1: expected integer to be 0 or nil") + return env.NewError("center: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("center: arg 1: expected block, native or nil") + return env.NewError("center: arg 1: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := container.NewCenter(arg0Val...) var res0Obj env.Object @@ -156281,39 +152812,32 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg0Val[i], ok = v.Value.(*container.TabItem) - if !ok { + if vc, ok := v.Value.(*container.TabItem); ok { + arg0Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("doc-tabs: arg 1: block item: expected native of type *container.TabItem") + return env.NewError("doc-tabs: arg 1: " + "block item: " + "expected native of type *container.TabItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("doc-tabs: arg 1: block item: expected integer to be 0 or nil") + return env.NewError("doc-tabs: arg 1: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val[i] = nil default: ps.FailureFlag = true - return env.NewError("doc-tabs: arg 1: block item: expected native") + return env.NewError("doc-tabs: arg 1: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg0Val, ok = v.Value.([]*container.TabItem) - if !ok { - ps.FailureFlag = true - return env.NewError("doc-tabs: arg 1: expected native of type []*container.TabItem") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("doc-tabs: arg 1: expected integer to be 0 or nil") + return env.NewError("doc-tabs: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("doc-tabs: arg 1: expected block, native or nil") + return env.NewError("doc-tabs: arg 1: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := container.NewDocTabs(arg0Val...) var res0Obj env.Object @@ -156326,11 +152850,11 @@ var Builtins = map[string]*env.Builtin{ Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val int - if v, ok := arg0.(env.Integer); ok { - arg0Val = int(v.Value) + if vc, ok := arg0.(env.Integer); ok { + arg0Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("grid-with-columns: arg 1: expected integer") + return env.NewError("grid-with-columns: arg 1: " + "expected integer, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val []fyne.CanvasObject switch v := arg1.(type) { @@ -156343,42 +152867,35 @@ var Builtins = map[string]*env.Builtin{ arg1Val[i], err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("grid-with-columns: arg 2: block item: " + err.Error() + "") + return env.NewError("grid-with-columns: arg 2: " + "block item: " + err.Error()) } case env.Native: - var ok bool - arg1Val[i], ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("grid-with-columns: arg 2: block item: expected native of type fyne.CanvasObject") + return env.NewError("grid-with-columns: arg 2: " + "block item: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("grid-with-columns: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("grid-with-columns: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val[i] = nil default: ps.FailureFlag = true - return env.NewError("grid-with-columns: arg 2: block item: expected native") + return env.NewError("grid-with-columns: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]fyne.CanvasObject) - if !ok { - ps.FailureFlag = true - return env.NewError("grid-with-columns: arg 2: expected native of type []fyne.CanvasObject") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("grid-with-columns: arg 2: expected integer to be 0 or nil") + return env.NewError("grid-with-columns: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("grid-with-columns: arg 2: expected block, native or nil") + return env.NewError("grid-with-columns: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := container.NewGridWithColumns(arg0Val, arg1Val...) var res0Obj env.Object @@ -156391,11 +152908,11 @@ var Builtins = map[string]*env.Builtin{ Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val int - if v, ok := arg0.(env.Integer); ok { - arg0Val = int(v.Value) + if vc, ok := arg0.(env.Integer); ok { + arg0Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("grid-with-rows: arg 1: expected integer") + return env.NewError("grid-with-rows: arg 1: " + "expected integer, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val []fyne.CanvasObject switch v := arg1.(type) { @@ -156408,42 +152925,35 @@ var Builtins = map[string]*env.Builtin{ arg1Val[i], err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("grid-with-rows: arg 2: block item: " + err.Error() + "") + return env.NewError("grid-with-rows: arg 2: " + "block item: " + err.Error()) } case env.Native: - var ok bool - arg1Val[i], ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("grid-with-rows: arg 2: block item: expected native of type fyne.CanvasObject") + return env.NewError("grid-with-rows: arg 2: " + "block item: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("grid-with-rows: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("grid-with-rows: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val[i] = nil default: ps.FailureFlag = true - return env.NewError("grid-with-rows: arg 2: block item: expected native") + return env.NewError("grid-with-rows: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]fyne.CanvasObject) - if !ok { - ps.FailureFlag = true - return env.NewError("grid-with-rows: arg 2: expected native of type []fyne.CanvasObject") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("grid-with-rows: arg 2: expected integer to be 0 or nil") + return env.NewError("grid-with-rows: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("grid-with-rows: arg 2: expected block, native or nil") + return env.NewError("grid-with-rows: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := container.NewGridWithRows(arg0Val, arg1Val...) var res0Obj env.Object @@ -156455,24 +152965,18 @@ var Builtins = map[string]*env.Builtin{ Doc: "container.NewGridWrap", Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var arg0Val *fyne.Size + var arg0Val fyne.Size switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("grid-wrap: arg 1: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg0Val = *vc + } else { ps.FailureFlag = true - return env.NewError("grid-wrap: arg 1: expected integer to be 0 or nil") + return env.NewError("grid-wrap: arg 1: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg0Val = nil default: ps.FailureFlag = true - return env.NewError("grid-wrap: arg 1: expected native") + return env.NewError("grid-wrap: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []fyne.CanvasObject switch v := arg1.(type) { @@ -156485,44 +152989,37 @@ var Builtins = map[string]*env.Builtin{ arg1Val[i], err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("grid-wrap: arg 2: block item: " + err.Error() + "") + return env.NewError("grid-wrap: arg 2: " + "block item: " + err.Error()) } case env.Native: - var ok bool - arg1Val[i], ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("grid-wrap: arg 2: block item: expected native of type fyne.CanvasObject") + return env.NewError("grid-wrap: arg 2: " + "block item: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("grid-wrap: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("grid-wrap: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val[i] = nil default: ps.FailureFlag = true - return env.NewError("grid-wrap: arg 2: block item: expected native") + return env.NewError("grid-wrap: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]fyne.CanvasObject) - if !ok { - ps.FailureFlag = true - return env.NewError("grid-wrap: arg 2: expected native of type []fyne.CanvasObject") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("grid-wrap: arg 2: expected integer to be 0 or nil") + return env.NewError("grid-wrap: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("grid-wrap: arg 2: expected block, native or nil") + return env.NewError("grid-wrap: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } - res0 := container.NewGridWrap(*arg0Val, arg1Val...) + res0 := container.NewGridWrap(arg0Val, arg1Val...) var res0Obj env.Object res0Obj = *env.NewNative(ps.Idx, res0, "Go(*fyne.Container)") return res0Obj @@ -156543,42 +153040,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val[i], err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("h-box: arg 1: block item: " + err.Error() + "") + return env.NewError("h-box: arg 1: " + "block item: " + err.Error()) } case env.Native: - var ok bool - arg0Val[i], ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("h-box: arg 1: block item: expected native of type fyne.CanvasObject") + return env.NewError("h-box: arg 1: " + "block item: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("h-box: arg 1: block item: expected integer to be 0 or nil") + return env.NewError("h-box: arg 1: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val[i] = nil default: ps.FailureFlag = true - return env.NewError("h-box: arg 1: block item: expected native") + return env.NewError("h-box: arg 1: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg0Val, ok = v.Value.([]fyne.CanvasObject) - if !ok { - ps.FailureFlag = true - return env.NewError("h-box: arg 1: expected native of type []fyne.CanvasObject") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("h-box: arg 1: expected integer to be 0 or nil") + return env.NewError("h-box: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("h-box: arg 1: expected block, native or nil") + return env.NewError("h-box: arg 1: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := container.NewHBox(arg0Val...) var res0Obj env.Object @@ -156597,24 +153087,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("h-scroll: arg 1: " + err.Error() + "") + return env.NewError("h-scroll: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("h-scroll: arg 1: expected native of type fyne.CanvasObject") + return env.NewError("h-scroll: arg 1: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("h-scroll: arg 1: expected integer to be 0 or nil") + return env.NewError("h-scroll: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("h-scroll: arg 1: expected native") + return env.NewError("h-scroll: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := container.NewHScroll(arg0Val) var res0Obj env.Object @@ -156633,24 +153123,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("h-split: arg 1: " + err.Error() + "") + return env.NewError("h-split: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("h-split: arg 1: expected native of type fyne.CanvasObject") + return env.NewError("h-split: arg 1: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("h-split: arg 1: expected integer to be 0 or nil") + return env.NewError("h-split: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("h-split: arg 1: expected native") + return env.NewError("h-split: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.CanvasObject switch v := arg1.(type) { @@ -156659,24 +153149,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("h-split: arg 2: " + err.Error() + "") + return env.NewError("h-split: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("h-split: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("h-split: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("h-split: arg 2: expected integer to be 0 or nil") + return env.NewError("h-split: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("h-split: arg 2: expected native") + return env.NewError("h-split: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := container.NewHSplit(arg0Val, arg1Val) var res0Obj env.Object @@ -156699,42 +153189,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val[i], err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("container-max: arg 1: block item: " + err.Error() + "") + return env.NewError("container-max: arg 1: " + "block item: " + err.Error()) } case env.Native: - var ok bool - arg0Val[i], ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("container-max: arg 1: block item: expected native of type fyne.CanvasObject") + return env.NewError("container-max: arg 1: " + "block item: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("container-max: arg 1: block item: expected integer to be 0 or nil") + return env.NewError("container-max: arg 1: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val[i] = nil default: ps.FailureFlag = true - return env.NewError("container-max: arg 1: block item: expected native") + return env.NewError("container-max: arg 1: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg0Val, ok = v.Value.([]fyne.CanvasObject) - if !ok { - ps.FailureFlag = true - return env.NewError("container-max: arg 1: expected native of type []fyne.CanvasObject") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("container-max: arg 1: expected integer to be 0 or nil") + return env.NewError("container-max: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("container-max: arg 1: expected block, native or nil") + return env.NewError("container-max: arg 1: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := container.NewMax(arg0Val...) var res0Obj env.Object @@ -156757,42 +153240,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val[i], err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("padded: arg 1: block item: " + err.Error() + "") + return env.NewError("padded: arg 1: " + "block item: " + err.Error()) } case env.Native: - var ok bool - arg0Val[i], ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("padded: arg 1: block item: expected native of type fyne.CanvasObject") + return env.NewError("padded: arg 1: " + "block item: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("padded: arg 1: block item: expected integer to be 0 or nil") + return env.NewError("padded: arg 1: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val[i] = nil default: ps.FailureFlag = true - return env.NewError("padded: arg 1: block item: expected native") + return env.NewError("padded: arg 1: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg0Val, ok = v.Value.([]fyne.CanvasObject) - if !ok { - ps.FailureFlag = true - return env.NewError("padded: arg 1: expected native of type []fyne.CanvasObject") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("padded: arg 1: expected integer to be 0 or nil") + return env.NewError("padded: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("padded: arg 1: expected block, native or nil") + return env.NewError("padded: arg 1: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := container.NewPadded(arg0Val...) var res0Obj env.Object @@ -156811,24 +153287,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("scroll: arg 1: " + err.Error() + "") + return env.NewError("scroll: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("scroll: arg 1: expected native of type fyne.CanvasObject") + return env.NewError("scroll: arg 1: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("scroll: arg 1: expected integer to be 0 or nil") + return env.NewError("scroll: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("scroll: arg 1: expected native") + return env.NewError("scroll: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := container.NewScroll(arg0Val) var res0Obj env.Object @@ -156861,42 +153337,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val[i], err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("stack: arg 1: block item: " + err.Error() + "") + return env.NewError("stack: arg 1: " + "block item: " + err.Error()) } case env.Native: - var ok bool - arg0Val[i], ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("stack: arg 1: block item: expected native of type fyne.CanvasObject") + return env.NewError("stack: arg 1: " + "block item: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("stack: arg 1: block item: expected integer to be 0 or nil") + return env.NewError("stack: arg 1: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val[i] = nil default: ps.FailureFlag = true - return env.NewError("stack: arg 1: block item: expected native") + return env.NewError("stack: arg 1: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg0Val, ok = v.Value.([]fyne.CanvasObject) - if !ok { - ps.FailureFlag = true - return env.NewError("stack: arg 1: expected native of type []fyne.CanvasObject") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("stack: arg 1: expected integer to be 0 or nil") + return env.NewError("stack: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("stack: arg 1: expected block, native or nil") + return env.NewError("stack: arg 1: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := container.NewStack(arg0Val...) var res0Obj env.Object @@ -156909,11 +153378,11 @@ var Builtins = map[string]*env.Builtin{ Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("tab-item: arg 1: expected string") + return env.NewError("tab-item: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val fyne.CanvasObject switch v := arg1.(type) { @@ -156922,24 +153391,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("tab-item: arg 2: " + err.Error() + "") + return env.NewError("tab-item: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("tab-item: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("tab-item: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("tab-item: arg 2: expected integer to be 0 or nil") + return env.NewError("tab-item: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("tab-item: arg 2: expected native") + return env.NewError("tab-item: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := container.NewTabItem(arg0Val, arg1Val) var res0Obj env.Object @@ -156952,11 +153421,11 @@ var Builtins = map[string]*env.Builtin{ Argsn: 3, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("tab-item-with-icon: arg 1: expected string") + return env.NewError("tab-item-with-icon: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val fyne.Resource switch v := arg1.(type) { @@ -156965,24 +153434,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Resource(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("tab-item-with-icon: arg 2: " + err.Error() + "") + return env.NewError("tab-item-with-icon: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("tab-item-with-icon: arg 2: expected native of type fyne.Resource") + return env.NewError("tab-item-with-icon: arg 2: " + "expected native of type fyne.Resource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("tab-item-with-icon: arg 2: expected integer to be 0 or nil") + return env.NewError("tab-item-with-icon: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("tab-item-with-icon: arg 2: expected native") + return env.NewError("tab-item-with-icon: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg2Val fyne.CanvasObject switch v := arg2.(type) { @@ -156991,24 +153460,24 @@ var Builtins = map[string]*env.Builtin{ arg2Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("tab-item-with-icon: arg 3: " + err.Error() + "") + return env.NewError("tab-item-with-icon: arg 3: " + err.Error()) } case env.Native: - var ok bool - arg2Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("tab-item-with-icon: arg 3: expected native of type fyne.CanvasObject") + return env.NewError("tab-item-with-icon: arg 3: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("tab-item-with-icon: arg 3: expected integer to be 0 or nil") + return env.NewError("tab-item-with-icon: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("tab-item-with-icon: arg 3: expected native") + return env.NewError("tab-item-with-icon: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := container.NewTabItemWithIcon(arg0Val, arg1Val, arg2Val) var res0Obj env.Object @@ -157031,42 +153500,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val[i], err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("v-box: arg 1: block item: " + err.Error() + "") + return env.NewError("v-box: arg 1: " + "block item: " + err.Error()) } case env.Native: - var ok bool - arg0Val[i], ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("v-box: arg 1: block item: expected native of type fyne.CanvasObject") + return env.NewError("v-box: arg 1: " + "block item: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("v-box: arg 1: block item: expected integer to be 0 or nil") + return env.NewError("v-box: arg 1: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val[i] = nil default: ps.FailureFlag = true - return env.NewError("v-box: arg 1: block item: expected native") + return env.NewError("v-box: arg 1: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg0Val, ok = v.Value.([]fyne.CanvasObject) - if !ok { - ps.FailureFlag = true - return env.NewError("v-box: arg 1: expected native of type []fyne.CanvasObject") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("v-box: arg 1: expected integer to be 0 or nil") + return env.NewError("v-box: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("v-box: arg 1: expected block, native or nil") + return env.NewError("v-box: arg 1: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := container.NewVBox(arg0Val...) var res0Obj env.Object @@ -157085,24 +153547,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("v-scroll: arg 1: " + err.Error() + "") + return env.NewError("v-scroll: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("v-scroll: arg 1: expected native of type fyne.CanvasObject") + return env.NewError("v-scroll: arg 1: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("v-scroll: arg 1: expected integer to be 0 or nil") + return env.NewError("v-scroll: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("v-scroll: arg 1: expected native") + return env.NewError("v-scroll: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := container.NewVScroll(arg0Val) var res0Obj env.Object @@ -157121,24 +153583,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("v-split: arg 1: " + err.Error() + "") + return env.NewError("v-split: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("v-split: arg 1: expected native of type fyne.CanvasObject") + return env.NewError("v-split: arg 1: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("v-split: arg 1: expected integer to be 0 or nil") + return env.NewError("v-split: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("v-split: arg 1: expected native") + return env.NewError("v-split: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.CanvasObject switch v := arg1.(type) { @@ -157147,24 +153609,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("v-split: arg 2: " + err.Error() + "") + return env.NewError("v-split: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("v-split: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("v-split: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("v-split: arg 2: expected integer to be 0 or nil") + return env.NewError("v-split: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("v-split: arg 2: expected native") + return env.NewError("v-split: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := container.NewVSplit(arg0Val, arg1Val) var res0Obj env.Object @@ -157187,42 +153649,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val[i], err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("without-layout: arg 1: block item: " + err.Error() + "") + return env.NewError("without-layout: arg 1: " + "block item: " + err.Error()) } case env.Native: - var ok bool - arg0Val[i], ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("without-layout: arg 1: block item: expected native of type fyne.CanvasObject") + return env.NewError("without-layout: arg 1: " + "block item: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("without-layout: arg 1: block item: expected integer to be 0 or nil") + return env.NewError("without-layout: arg 1: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val[i] = nil default: ps.FailureFlag = true - return env.NewError("without-layout: arg 1: block item: expected native") + return env.NewError("without-layout: arg 1: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg0Val, ok = v.Value.([]fyne.CanvasObject) - if !ok { - ps.FailureFlag = true - return env.NewError("without-layout: arg 1: expected native of type []fyne.CanvasObject") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("without-layout: arg 1: expected integer to be 0 or nil") + return env.NewError("without-layout: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("without-layout: arg 1: expected block, native or nil") + return env.NewError("without-layout: arg 1: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := container.NewWithoutLayout(arg0Val...) var res0Obj env.Object @@ -157235,7 +153690,7 @@ var Builtins = map[string]*env.Builtin{ Argsn: 0, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var resObj env.Object - resObj = *env.NewInteger(int64(int(container.ScrollBoth))) + resObj = *env.NewNative(ps.Idx, container.ScrollBoth, "Go(container.ScrollDirection)") return resObj }, }, @@ -157244,7 +153699,7 @@ var Builtins = map[string]*env.Builtin{ Argsn: 0, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var resObj env.Object - resObj = *env.NewInteger(int64(int(container.ScrollHorizontalOnly))) + resObj = *env.NewNative(ps.Idx, container.ScrollHorizontalOnly, "Go(container.ScrollDirection)") return resObj }, }, @@ -157253,7 +153708,7 @@ var Builtins = map[string]*env.Builtin{ Argsn: 0, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var resObj env.Object - resObj = *env.NewInteger(int64(int(container.ScrollNone))) + resObj = *env.NewNative(ps.Idx, container.ScrollNone, "Go(container.ScrollDirection)") return resObj }, }, @@ -157262,7 +153717,7 @@ var Builtins = map[string]*env.Builtin{ Argsn: 0, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var resObj env.Object - resObj = *env.NewInteger(int64(int(container.ScrollVerticalOnly))) + resObj = *env.NewNative(ps.Idx, container.ScrollVerticalOnly, "Go(container.ScrollDirection)") return resObj }, }, @@ -157543,42 +153998,42 @@ var Builtins = map[string]*env.Builtin{ Argsn: 4, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("dialog-color-picker: arg 1: expected string") + return env.NewError("dialog-color-picker: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("dialog-color-picker: arg 2: expected string") + return env.NewError("dialog-color-picker: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val func(color.Color) switch fn := arg2.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("dialog-color-picker: arg 3: function has invalid number of arguments (expected 1)") + return env.NewError("dialog-color-picker: arg 3: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg2Val = func(arg0 color.Color) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(color.Color)") + arg2Val = func(farg0 color.Color) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(color.Color)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-color-picker: arg 3: expected integer to be 0 or nil") + return env.NewError("dialog-color-picker: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-color-picker: arg 3: expected function or nil") + return env.NewError("dialog-color-picker: arg 3: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } var arg3Val fyne.Window switch v := arg3.(type) { @@ -157587,24 +154042,24 @@ var Builtins = map[string]*env.Builtin{ arg3Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("dialog-color-picker: arg 4: " + err.Error() + "") + return env.NewError("dialog-color-picker: arg 4: " + err.Error()) } case env.Native: - var ok bool - arg3Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg3Val = vc + } else { ps.FailureFlag = true - return env.NewError("dialog-color-picker: arg 4: expected native of type fyne.Window") + return env.NewError("dialog-color-picker: arg 4: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-color-picker: arg 4: expected integer to be 0 or nil") + return env.NewError("dialog-color-picker: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-color-picker: arg 4: expected native") + return env.NewError("dialog-color-picker: arg 4: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := dialog.NewColorPicker(arg0Val, arg1Val, arg2Val, arg3Val) var res0Obj env.Object @@ -157627,42 +154082,42 @@ var Builtins = map[string]*env.Builtin{ Argsn: 4, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("dialog-confirm: arg 1: expected string") + return env.NewError("dialog-confirm: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("dialog-confirm: arg 2: expected string") + return env.NewError("dialog-confirm: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val func(bool) switch fn := arg2.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("dialog-confirm: arg 3: function has invalid number of arguments (expected 1)") + return env.NewError("dialog-confirm: arg 3: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg2Val = func(arg0 bool) { - var arg0Val env.Object - arg0Val = *env.NewInteger(boolToInt64(arg0)) + arg2Val = func(farg0 bool) { + var farg0Val env.Object + farg0Val = *env.NewInteger(boolToInt64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-confirm: arg 3: expected integer to be 0 or nil") + return env.NewError("dialog-confirm: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-confirm: arg 3: expected function or nil") + return env.NewError("dialog-confirm: arg 3: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } var arg3Val fyne.Window switch v := arg3.(type) { @@ -157671,24 +154126,24 @@ var Builtins = map[string]*env.Builtin{ arg3Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("dialog-confirm: arg 4: " + err.Error() + "") + return env.NewError("dialog-confirm: arg 4: " + err.Error()) } case env.Native: - var ok bool - arg3Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg3Val = vc + } else { ps.FailureFlag = true - return env.NewError("dialog-confirm: arg 4: expected native of type fyne.Window") + return env.NewError("dialog-confirm: arg 4: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-confirm: arg 4: expected integer to be 0 or nil") + return env.NewError("dialog-confirm: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-confirm: arg 4: expected native") + return env.NewError("dialog-confirm: arg 4: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := dialog.NewConfirm(arg0Val, arg1Val, arg2Val, arg3Val) var res0Obj env.Object @@ -157711,18 +154166,18 @@ var Builtins = map[string]*env.Builtin{ Argsn: 4, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("dialog-custom: arg 1: expected string") + return env.NewError("dialog-custom: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("dialog-custom: arg 2: expected string") + return env.NewError("dialog-custom: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val fyne.CanvasObject switch v := arg2.(type) { @@ -157731,24 +154186,24 @@ var Builtins = map[string]*env.Builtin{ arg2Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("dialog-custom: arg 3: " + err.Error() + "") + return env.NewError("dialog-custom: arg 3: " + err.Error()) } case env.Native: - var ok bool - arg2Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("dialog-custom: arg 3: expected native of type fyne.CanvasObject") + return env.NewError("dialog-custom: arg 3: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-custom: arg 3: expected integer to be 0 or nil") + return env.NewError("dialog-custom: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-custom: arg 3: expected native") + return env.NewError("dialog-custom: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg3Val fyne.Window switch v := arg3.(type) { @@ -157757,24 +154212,24 @@ var Builtins = map[string]*env.Builtin{ arg3Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("dialog-custom: arg 4: " + err.Error() + "") + return env.NewError("dialog-custom: arg 4: " + err.Error()) } case env.Native: - var ok bool - arg3Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg3Val = vc + } else { ps.FailureFlag = true - return env.NewError("dialog-custom: arg 4: expected native of type fyne.Window") + return env.NewError("dialog-custom: arg 4: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-custom: arg 4: expected integer to be 0 or nil") + return env.NewError("dialog-custom: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-custom: arg 4: expected native") + return env.NewError("dialog-custom: arg 4: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := dialog.NewCustom(arg0Val, arg1Val, arg2Val, arg3Val) var res0Obj env.Object @@ -157797,11 +154252,11 @@ var Builtins = map[string]*env.Builtin{ Argsn: 3, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("dialog-custom-without-buttons: arg 1: expected string") + return env.NewError("dialog-custom-without-buttons: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val fyne.CanvasObject switch v := arg1.(type) { @@ -157810,24 +154265,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("dialog-custom-without-buttons: arg 2: " + err.Error() + "") + return env.NewError("dialog-custom-without-buttons: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("dialog-custom-without-buttons: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("dialog-custom-without-buttons: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-custom-without-buttons: arg 2: expected integer to be 0 or nil") + return env.NewError("dialog-custom-without-buttons: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-custom-without-buttons: arg 2: expected native") + return env.NewError("dialog-custom-without-buttons: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg2Val fyne.Window switch v := arg2.(type) { @@ -157836,24 +154291,24 @@ var Builtins = map[string]*env.Builtin{ arg2Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("dialog-custom-without-buttons: arg 3: " + err.Error() + "") + return env.NewError("dialog-custom-without-buttons: arg 3: " + err.Error()) } case env.Native: - var ok bool - arg2Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("dialog-custom-without-buttons: arg 3: expected native of type fyne.Window") + return env.NewError("dialog-custom-without-buttons: arg 3: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-custom-without-buttons: arg 3: expected integer to be 0 or nil") + return env.NewError("dialog-custom-without-buttons: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-custom-without-buttons: arg 3: expected native") + return env.NewError("dialog-custom-without-buttons: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := dialog.NewCustomWithoutButtons(arg0Val, arg1Val, arg2Val) var res0Obj env.Object @@ -157866,42 +154321,42 @@ var Builtins = map[string]*env.Builtin{ Argsn: 4, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("dialog-entry-dialog: arg 1: expected string") + return env.NewError("dialog-entry-dialog: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("dialog-entry-dialog: arg 2: expected string") + return env.NewError("dialog-entry-dialog: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val func(string) switch fn := arg2.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("dialog-entry-dialog: arg 3: function has invalid number of arguments (expected 1)") + return env.NewError("dialog-entry-dialog: arg 3: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg2Val = func(arg0 string) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + arg2Val = func(farg0 string) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-entry-dialog: arg 3: expected integer to be 0 or nil") + return env.NewError("dialog-entry-dialog: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-entry-dialog: arg 3: expected function or nil") + return env.NewError("dialog-entry-dialog: arg 3: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } var arg3Val fyne.Window switch v := arg3.(type) { @@ -157910,24 +154365,24 @@ var Builtins = map[string]*env.Builtin{ arg3Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("dialog-entry-dialog: arg 4: " + err.Error() + "") + return env.NewError("dialog-entry-dialog: arg 4: " + err.Error()) } case env.Native: - var ok bool - arg3Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg3Val = vc + } else { ps.FailureFlag = true - return env.NewError("dialog-entry-dialog: arg 4: expected native of type fyne.Window") + return env.NewError("dialog-entry-dialog: arg 4: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-entry-dialog: arg 4: expected integer to be 0 or nil") + return env.NewError("dialog-entry-dialog: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-entry-dialog: arg 4: expected native") + return env.NewError("dialog-entry-dialog: arg 4: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := dialog.NewEntryDialog(arg0Val, arg1Val, arg2Val, arg3Val) var res0Obj env.Object @@ -157948,12 +154403,12 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-error: arg 1: expected integer to be 0 or nil") + return env.NewError("dialog-error: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-error: arg 1: expected error, string or nil") + return env.NewError("dialog-error: arg 1: " + "expected error, string or nil, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Window switch v := arg1.(type) { @@ -157962,45 +154417,28 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("dialog-error: arg 2: " + err.Error() + "") + return env.NewError("dialog-error: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("dialog-error: arg 2: expected native of type fyne.Window") + return env.NewError("dialog-error: arg 2: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-error: arg 2: expected integer to be 0 or nil") + return env.NewError("dialog-error: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-error: arg 2: expected native") + return env.NewError("dialog-error: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := dialog.NewError(arg0Val, arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(dialog.Dialog)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(dialog.Dialog)") return res0Obj }, }, @@ -158023,44 +154461,27 @@ var Builtins = map[string]*env.Builtin{ case env.Function: if fn.Argsn != 2 { ps.FailureFlag = true - return env.NewError("dialog-file-open: arg 1: function has invalid number of arguments (expected 2)") + return env.NewError("dialog-file-open: arg 1: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg0Val = func(arg0 fyne.URIReadCloser, arg1 error) { - var arg0Val, arg1Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URIReadCloser)") - } - } - if arg1 != nil { - arg1Val = env.NewError(arg1.Error()) + arg0Val = func(farg0 fyne.URIReadCloser, farg1 error) { + var farg0Val, farg1Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URIReadCloser)") + if farg1 != nil { + farg1Val = env.NewError(farg1.Error()) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val, farg1Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-file-open: arg 1: expected integer to be 0 or nil") + return env.NewError("dialog-file-open: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-file-open: arg 1: expected function or nil") + return env.NewError("dialog-file-open: arg 1: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } var arg1Val fyne.Window switch v := arg1.(type) { @@ -158069,24 +154490,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("dialog-file-open: arg 2: " + err.Error() + "") + return env.NewError("dialog-file-open: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("dialog-file-open: arg 2: expected native of type fyne.Window") + return env.NewError("dialog-file-open: arg 2: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-file-open: arg 2: expected integer to be 0 or nil") + return env.NewError("dialog-file-open: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-file-open: arg 2: expected native") + return env.NewError("dialog-file-open: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := dialog.NewFileOpen(arg0Val, arg1Val) var res0Obj env.Object @@ -158103,44 +154524,27 @@ var Builtins = map[string]*env.Builtin{ case env.Function: if fn.Argsn != 2 { ps.FailureFlag = true - return env.NewError("dialog-file-save: arg 1: function has invalid number of arguments (expected 2)") + return env.NewError("dialog-file-save: arg 1: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg0Val = func(arg0 fyne.URIWriteCloser, arg1 error) { - var arg0Val, arg1Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URIWriteCloser)") - } - } - if arg1 != nil { - arg1Val = env.NewError(arg1.Error()) + arg0Val = func(farg0 fyne.URIWriteCloser, farg1 error) { + var farg0Val, farg1Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URIWriteCloser)") + if farg1 != nil { + farg1Val = env.NewError(farg1.Error()) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val, farg1Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-file-save: arg 1: expected integer to be 0 or nil") + return env.NewError("dialog-file-save: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-file-save: arg 1: expected function or nil") + return env.NewError("dialog-file-save: arg 1: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } var arg1Val fyne.Window switch v := arg1.(type) { @@ -158149,24 +154553,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("dialog-file-save: arg 2: " + err.Error() + "") + return env.NewError("dialog-file-save: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("dialog-file-save: arg 2: expected native of type fyne.Window") + return env.NewError("dialog-file-save: arg 2: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-file-save: arg 2: expected integer to be 0 or nil") + return env.NewError("dialog-file-save: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-file-save: arg 2: expected native") + return env.NewError("dialog-file-save: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := dialog.NewFileSave(arg0Val, arg1Val) var res0Obj env.Object @@ -158183,44 +154587,27 @@ var Builtins = map[string]*env.Builtin{ case env.Function: if fn.Argsn != 2 { ps.FailureFlag = true - return env.NewError("dialog-folder-open: arg 1: function has invalid number of arguments (expected 2)") + return env.NewError("dialog-folder-open: arg 1: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg0Val = func(arg0 fyne.ListableURI, arg1 error) { - var arg0Val, arg1Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.ListableURI)") - } - } - if arg1 != nil { - arg1Val = env.NewError(arg1.Error()) + arg0Val = func(farg0 fyne.ListableURI, farg1 error) { + var farg0Val, farg1Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.ListableURI)") + if farg1 != nil { + farg1Val = env.NewError(farg1.Error()) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val, farg1Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-folder-open: arg 1: expected integer to be 0 or nil") + return env.NewError("dialog-folder-open: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-folder-open: arg 1: expected function or nil") + return env.NewError("dialog-folder-open: arg 1: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } var arg1Val fyne.Window switch v := arg1.(type) { @@ -158229,24 +154616,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("dialog-folder-open: arg 2: " + err.Error() + "") + return env.NewError("dialog-folder-open: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("dialog-folder-open: arg 2: expected native of type fyne.Window") + return env.NewError("dialog-folder-open: arg 2: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-folder-open: arg 2: expected integer to be 0 or nil") + return env.NewError("dialog-folder-open: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-folder-open: arg 2: expected native") + return env.NewError("dialog-folder-open: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := dialog.NewFolderOpen(arg0Val, arg1Val) var res0Obj env.Object @@ -158269,18 +154656,18 @@ var Builtins = map[string]*env.Builtin{ Argsn: 3, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("dialog-information: arg 1: expected string") + return env.NewError("dialog-information: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("dialog-information: arg 2: expected string") + return env.NewError("dialog-information: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val fyne.Window switch v := arg2.(type) { @@ -158289,45 +154676,28 @@ var Builtins = map[string]*env.Builtin{ arg2Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("dialog-information: arg 3: " + err.Error() + "") + return env.NewError("dialog-information: arg 3: " + err.Error()) } case env.Native: - var ok bool - arg2Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("dialog-information: arg 3: expected native of type fyne.Window") + return env.NewError("dialog-information: arg 3: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-information: arg 3: expected integer to be 0 or nil") + return env.NewError("dialog-information: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-information: arg 3: expected native") + return env.NewError("dialog-information: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := dialog.NewInformation(arg0Val, arg1Val, arg2Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(dialog.Dialog)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(dialog.Dialog)") return res0Obj }, }, @@ -158336,18 +154706,18 @@ var Builtins = map[string]*env.Builtin{ Argsn: 3, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("dialog-progress: arg 1: expected string") + return env.NewError("dialog-progress: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("dialog-progress: arg 2: expected string") + return env.NewError("dialog-progress: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val fyne.Window switch v := arg2.(type) { @@ -158356,24 +154726,24 @@ var Builtins = map[string]*env.Builtin{ arg2Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("dialog-progress: arg 3: " + err.Error() + "") + return env.NewError("dialog-progress: arg 3: " + err.Error()) } case env.Native: - var ok bool - arg2Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("dialog-progress: arg 3: expected native of type fyne.Window") + return env.NewError("dialog-progress: arg 3: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-progress: arg 3: expected integer to be 0 or nil") + return env.NewError("dialog-progress: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-progress: arg 3: expected native") + return env.NewError("dialog-progress: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := dialog.NewProgress(arg0Val, arg1Val, arg2Val) var res0Obj env.Object @@ -158396,18 +154766,18 @@ var Builtins = map[string]*env.Builtin{ Argsn: 3, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("dialog-progress-infinite: arg 1: expected string") + return env.NewError("dialog-progress-infinite: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("dialog-progress-infinite: arg 2: expected string") + return env.NewError("dialog-progress-infinite: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val fyne.Window switch v := arg2.(type) { @@ -158416,24 +154786,24 @@ var Builtins = map[string]*env.Builtin{ arg2Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("dialog-progress-infinite: arg 3: " + err.Error() + "") + return env.NewError("dialog-progress-infinite: arg 3: " + err.Error()) } case env.Native: - var ok bool - arg2Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("dialog-progress-infinite: arg 3: expected native of type fyne.Window") + return env.NewError("dialog-progress-infinite: arg 3: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-progress-infinite: arg 3: expected integer to be 0 or nil") + return env.NewError("dialog-progress-infinite: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-progress-infinite: arg 3: expected native") + return env.NewError("dialog-progress-infinite: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := dialog.NewProgressInfinite(arg0Val, arg1Val, arg2Val) var res0Obj env.Object @@ -158456,42 +154826,42 @@ var Builtins = map[string]*env.Builtin{ Argsn: 4, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("dialog-show-color-picker: arg 1: expected string") + return env.NewError("dialog-show-color-picker: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("dialog-show-color-picker: arg 2: expected string") + return env.NewError("dialog-show-color-picker: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val func(color.Color) switch fn := arg2.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("dialog-show-color-picker: arg 3: function has invalid number of arguments (expected 1)") + return env.NewError("dialog-show-color-picker: arg 3: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg2Val = func(arg0 color.Color) { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(color.Color)") + arg2Val = func(farg0 color.Color) { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(color.Color)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-show-color-picker: arg 3: expected integer to be 0 or nil") + return env.NewError("dialog-show-color-picker: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-show-color-picker: arg 3: expected function or nil") + return env.NewError("dialog-show-color-picker: arg 3: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } var arg3Val fyne.Window switch v := arg3.(type) { @@ -158500,24 +154870,24 @@ var Builtins = map[string]*env.Builtin{ arg3Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("dialog-show-color-picker: arg 4: " + err.Error() + "") + return env.NewError("dialog-show-color-picker: arg 4: " + err.Error()) } case env.Native: - var ok bool - arg3Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg3Val = vc + } else { ps.FailureFlag = true - return env.NewError("dialog-show-color-picker: arg 4: expected native of type fyne.Window") + return env.NewError("dialog-show-color-picker: arg 4: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-show-color-picker: arg 4: expected integer to be 0 or nil") + return env.NewError("dialog-show-color-picker: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-show-color-picker: arg 4: expected native") + return env.NewError("dialog-show-color-picker: arg 4: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } dialog.ShowColorPicker(arg0Val, arg1Val, arg2Val, arg3Val) return nil @@ -158528,42 +154898,42 @@ var Builtins = map[string]*env.Builtin{ Argsn: 4, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("dialog-show-confirm: arg 1: expected string") + return env.NewError("dialog-show-confirm: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("dialog-show-confirm: arg 2: expected string") + return env.NewError("dialog-show-confirm: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val func(bool) switch fn := arg2.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("dialog-show-confirm: arg 3: function has invalid number of arguments (expected 1)") + return env.NewError("dialog-show-confirm: arg 3: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg2Val = func(arg0 bool) { - var arg0Val env.Object - arg0Val = *env.NewInteger(boolToInt64(arg0)) + arg2Val = func(farg0 bool) { + var farg0Val env.Object + farg0Val = *env.NewInteger(boolToInt64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-show-confirm: arg 3: expected integer to be 0 or nil") + return env.NewError("dialog-show-confirm: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-show-confirm: arg 3: expected function or nil") + return env.NewError("dialog-show-confirm: arg 3: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } var arg3Val fyne.Window switch v := arg3.(type) { @@ -158572,24 +154942,24 @@ var Builtins = map[string]*env.Builtin{ arg3Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("dialog-show-confirm: arg 4: " + err.Error() + "") + return env.NewError("dialog-show-confirm: arg 4: " + err.Error()) } case env.Native: - var ok bool - arg3Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg3Val = vc + } else { ps.FailureFlag = true - return env.NewError("dialog-show-confirm: arg 4: expected native of type fyne.Window") + return env.NewError("dialog-show-confirm: arg 4: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-show-confirm: arg 4: expected integer to be 0 or nil") + return env.NewError("dialog-show-confirm: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-show-confirm: arg 4: expected native") + return env.NewError("dialog-show-confirm: arg 4: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } dialog.ShowConfirm(arg0Val, arg1Val, arg2Val, arg3Val) return nil @@ -158600,18 +154970,18 @@ var Builtins = map[string]*env.Builtin{ Argsn: 4, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("dialog-show-custom: arg 1: expected string") + return env.NewError("dialog-show-custom: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("dialog-show-custom: arg 2: expected string") + return env.NewError("dialog-show-custom: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val fyne.CanvasObject switch v := arg2.(type) { @@ -158620,24 +154990,24 @@ var Builtins = map[string]*env.Builtin{ arg2Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("dialog-show-custom: arg 3: " + err.Error() + "") + return env.NewError("dialog-show-custom: arg 3: " + err.Error()) } case env.Native: - var ok bool - arg2Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("dialog-show-custom: arg 3: expected native of type fyne.CanvasObject") + return env.NewError("dialog-show-custom: arg 3: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-show-custom: arg 3: expected integer to be 0 or nil") + return env.NewError("dialog-show-custom: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-show-custom: arg 3: expected native") + return env.NewError("dialog-show-custom: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg3Val fyne.Window switch v := arg3.(type) { @@ -158646,24 +155016,24 @@ var Builtins = map[string]*env.Builtin{ arg3Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("dialog-show-custom: arg 4: " + err.Error() + "") + return env.NewError("dialog-show-custom: arg 4: " + err.Error()) } case env.Native: - var ok bool - arg3Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg3Val = vc + } else { ps.FailureFlag = true - return env.NewError("dialog-show-custom: arg 4: expected native of type fyne.Window") + return env.NewError("dialog-show-custom: arg 4: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-show-custom: arg 4: expected integer to be 0 or nil") + return env.NewError("dialog-show-custom: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-show-custom: arg 4: expected native") + return env.NewError("dialog-show-custom: arg 4: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } dialog.ShowCustom(arg0Val, arg1Val, arg2Val, arg3Val) return nil @@ -158674,11 +155044,11 @@ var Builtins = map[string]*env.Builtin{ Argsn: 3, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("dialog-show-custom-without-buttons: arg 1: expected string") + return env.NewError("dialog-show-custom-without-buttons: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val fyne.CanvasObject switch v := arg1.(type) { @@ -158687,24 +155057,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("dialog-show-custom-without-buttons: arg 2: " + err.Error() + "") + return env.NewError("dialog-show-custom-without-buttons: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("dialog-show-custom-without-buttons: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("dialog-show-custom-without-buttons: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-show-custom-without-buttons: arg 2: expected integer to be 0 or nil") + return env.NewError("dialog-show-custom-without-buttons: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-show-custom-without-buttons: arg 2: expected native") + return env.NewError("dialog-show-custom-without-buttons: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg2Val fyne.Window switch v := arg2.(type) { @@ -158713,24 +155083,24 @@ var Builtins = map[string]*env.Builtin{ arg2Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("dialog-show-custom-without-buttons: arg 3: " + err.Error() + "") + return env.NewError("dialog-show-custom-without-buttons: arg 3: " + err.Error()) } case env.Native: - var ok bool - arg2Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("dialog-show-custom-without-buttons: arg 3: expected native of type fyne.Window") + return env.NewError("dialog-show-custom-without-buttons: arg 3: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-show-custom-without-buttons: arg 3: expected integer to be 0 or nil") + return env.NewError("dialog-show-custom-without-buttons: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-show-custom-without-buttons: arg 3: expected native") + return env.NewError("dialog-show-custom-without-buttons: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } dialog.ShowCustomWithoutButtons(arg0Val, arg1Val, arg2Val) return nil @@ -158741,42 +155111,42 @@ var Builtins = map[string]*env.Builtin{ Argsn: 4, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("dialog-show-entry-dialog: arg 1: expected string") + return env.NewError("dialog-show-entry-dialog: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("dialog-show-entry-dialog: arg 2: expected string") + return env.NewError("dialog-show-entry-dialog: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val func(string) switch fn := arg2.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("dialog-show-entry-dialog: arg 3: function has invalid number of arguments (expected 1)") + return env.NewError("dialog-show-entry-dialog: arg 3: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg2Val = func(arg0 string) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + arg2Val = func(farg0 string) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-show-entry-dialog: arg 3: expected integer to be 0 or nil") + return env.NewError("dialog-show-entry-dialog: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-show-entry-dialog: arg 3: expected function or nil") + return env.NewError("dialog-show-entry-dialog: arg 3: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } var arg3Val fyne.Window switch v := arg3.(type) { @@ -158785,24 +155155,24 @@ var Builtins = map[string]*env.Builtin{ arg3Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("dialog-show-entry-dialog: arg 4: " + err.Error() + "") + return env.NewError("dialog-show-entry-dialog: arg 4: " + err.Error()) } case env.Native: - var ok bool - arg3Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg3Val = vc + } else { ps.FailureFlag = true - return env.NewError("dialog-show-entry-dialog: arg 4: expected native of type fyne.Window") + return env.NewError("dialog-show-entry-dialog: arg 4: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-show-entry-dialog: arg 4: expected integer to be 0 or nil") + return env.NewError("dialog-show-entry-dialog: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-show-entry-dialog: arg 4: expected native") + return env.NewError("dialog-show-entry-dialog: arg 4: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } dialog.ShowEntryDialog(arg0Val, arg1Val, arg2Val, arg3Val) return nil @@ -158821,12 +155191,12 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-show-error: arg 1: expected integer to be 0 or nil") + return env.NewError("dialog-show-error: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-show-error: arg 1: expected error, string or nil") + return env.NewError("dialog-show-error: arg 1: " + "expected error, string or nil, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Window switch v := arg1.(type) { @@ -158835,24 +155205,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("dialog-show-error: arg 2: " + err.Error() + "") + return env.NewError("dialog-show-error: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("dialog-show-error: arg 2: expected native of type fyne.Window") + return env.NewError("dialog-show-error: arg 2: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-show-error: arg 2: expected integer to be 0 or nil") + return env.NewError("dialog-show-error: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-show-error: arg 2: expected native") + return env.NewError("dialog-show-error: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } dialog.ShowError(arg0Val, arg1Val) return nil @@ -158867,44 +155237,27 @@ var Builtins = map[string]*env.Builtin{ case env.Function: if fn.Argsn != 2 { ps.FailureFlag = true - return env.NewError("dialog-show-file-open: arg 1: function has invalid number of arguments (expected 2)") + return env.NewError("dialog-show-file-open: arg 1: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg0Val = func(arg0 fyne.URIReadCloser, arg1 error) { - var arg0Val, arg1Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URIReadCloser)") - } - } - if arg1 != nil { - arg1Val = env.NewError(arg1.Error()) + arg0Val = func(farg0 fyne.URIReadCloser, farg1 error) { + var farg0Val, farg1Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URIReadCloser)") + if farg1 != nil { + farg1Val = env.NewError(farg1.Error()) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val, farg1Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-show-file-open: arg 1: expected integer to be 0 or nil") + return env.NewError("dialog-show-file-open: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-show-file-open: arg 1: expected function or nil") + return env.NewError("dialog-show-file-open: arg 1: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } var arg1Val fyne.Window switch v := arg1.(type) { @@ -158913,24 +155266,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("dialog-show-file-open: arg 2: " + err.Error() + "") + return env.NewError("dialog-show-file-open: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("dialog-show-file-open: arg 2: expected native of type fyne.Window") + return env.NewError("dialog-show-file-open: arg 2: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-show-file-open: arg 2: expected integer to be 0 or nil") + return env.NewError("dialog-show-file-open: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-show-file-open: arg 2: expected native") + return env.NewError("dialog-show-file-open: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } dialog.ShowFileOpen(arg0Val, arg1Val) return nil @@ -158945,44 +155298,27 @@ var Builtins = map[string]*env.Builtin{ case env.Function: if fn.Argsn != 2 { ps.FailureFlag = true - return env.NewError("dialog-show-file-save: arg 1: function has invalid number of arguments (expected 2)") + return env.NewError("dialog-show-file-save: arg 1: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg0Val = func(arg0 fyne.URIWriteCloser, arg1 error) { - var arg0Val, arg1Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.URIWriteCloser)") - } - } - if arg1 != nil { - arg1Val = env.NewError(arg1.Error()) + arg0Val = func(farg0 fyne.URIWriteCloser, farg1 error) { + var farg0Val, farg1Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.URIWriteCloser)") + if farg1 != nil { + farg1Val = env.NewError(farg1.Error()) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val, farg1Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-show-file-save: arg 1: expected integer to be 0 or nil") + return env.NewError("dialog-show-file-save: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-show-file-save: arg 1: expected function or nil") + return env.NewError("dialog-show-file-save: arg 1: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } var arg1Val fyne.Window switch v := arg1.(type) { @@ -158991,24 +155327,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("dialog-show-file-save: arg 2: " + err.Error() + "") + return env.NewError("dialog-show-file-save: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("dialog-show-file-save: arg 2: expected native of type fyne.Window") + return env.NewError("dialog-show-file-save: arg 2: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-show-file-save: arg 2: expected integer to be 0 or nil") + return env.NewError("dialog-show-file-save: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-show-file-save: arg 2: expected native") + return env.NewError("dialog-show-file-save: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } dialog.ShowFileSave(arg0Val, arg1Val) return nil @@ -159023,44 +155359,27 @@ var Builtins = map[string]*env.Builtin{ case env.Function: if fn.Argsn != 2 { ps.FailureFlag = true - return env.NewError("dialog-show-folder-open: arg 1: function has invalid number of arguments (expected 2)") + return env.NewError("dialog-show-folder-open: arg 1: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg0Val = func(arg0 fyne.ListableURI, arg1 error) { - var arg0Val, arg1Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(fyne.ListableURI)") - } - } - if arg1 != nil { - arg1Val = env.NewError(arg1.Error()) + arg0Val = func(farg0 fyne.ListableURI, farg1 error) { + var farg0Val, farg1Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(fyne.ListableURI)") + if farg1 != nil { + farg1Val = env.NewError(farg1.Error()) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val, farg1Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-show-folder-open: arg 1: expected integer to be 0 or nil") + return env.NewError("dialog-show-folder-open: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-show-folder-open: arg 1: expected function or nil") + return env.NewError("dialog-show-folder-open: arg 1: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } var arg1Val fyne.Window switch v := arg1.(type) { @@ -159069,24 +155388,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("dialog-show-folder-open: arg 2: " + err.Error() + "") + return env.NewError("dialog-show-folder-open: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("dialog-show-folder-open: arg 2: expected native of type fyne.Window") + return env.NewError("dialog-show-folder-open: arg 2: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-show-folder-open: arg 2: expected integer to be 0 or nil") + return env.NewError("dialog-show-folder-open: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-show-folder-open: arg 2: expected native") + return env.NewError("dialog-show-folder-open: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } dialog.ShowFolderOpen(arg0Val, arg1Val) return nil @@ -159097,18 +155416,18 @@ var Builtins = map[string]*env.Builtin{ Argsn: 3, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("dialog-show-information: arg 1: expected string") + return env.NewError("dialog-show-information: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("dialog-show-information: arg 2: expected string") + return env.NewError("dialog-show-information: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val fyne.Window switch v := arg2.(type) { @@ -159117,24 +155436,24 @@ var Builtins = map[string]*env.Builtin{ arg2Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("dialog-show-information: arg 3: " + err.Error() + "") + return env.NewError("dialog-show-information: arg 3: " + err.Error()) } case env.Native: - var ok bool - arg2Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("dialog-show-information: arg 3: expected native of type fyne.Window") + return env.NewError("dialog-show-information: arg 3: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("dialog-show-information: arg 3: expected integer to be 0 or nil") + return env.NewError("dialog-show-information: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("dialog-show-information: arg 3: expected native") + return env.NewError("dialog-show-information: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } dialog.ShowInformation(arg0Val, arg1Val, arg2Val) return nil @@ -159173,24 +155492,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := fyne.CurrentApp() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.App)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.App)") return res0Obj }, }, @@ -159200,24 +155502,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := fyne.CurrentDevice() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Device)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Device)") return res0Obj }, }, @@ -159245,19 +155530,19 @@ var Builtins = map[string]*env.Builtin{ Doc: "fyne_driver.RunNative", Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var arg0Val func(any) error + var arg0Val func(interface{}) error switch fn := arg0.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("fyne-driver-run-native: arg 1: function has invalid number of arguments (expected 1)") + return env.NewError("fyne-driver-run-native: arg 1: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg0Val = func(arg0 any) error { - var arg0Val env.Object - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(any)") + arg0Val = func(farg0 interface{}) error { + var farg0Val env.Object + farg0Val = *env.NewNative(ps.Idx, farg0, "Go(interface{})") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -159266,8 +155551,9 @@ var Builtins = map[string]*env.Builtin{ res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "fyne-driver-run-native: arg 1: callback result: expected integer to be 0 or nil", + "fyne-driver-run-native: arg 1: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -159275,8 +155561,9 @@ var Builtins = map[string]*env.Builtin{ } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "fyne-driver-run-native: arg 1: callback result: expected error, string or nil", + "fyne-driver-run-native: arg 1: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -159287,12 +155574,12 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("fyne-driver-run-native: arg 1: expected integer to be 0 or nil") + return env.NewError("fyne-driver-run-native: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("fyne-driver-run-native: arg 1: expected function or nil") + return env.NewError("fyne-driver-run-native: arg 1: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } resErr := fyne_driver.RunNative(arg0Val) var resErrObj env.Object @@ -159322,11 +155609,11 @@ var Builtins = map[string]*env.Builtin{ arg0Val = natVal } else { var u int - if v, ok := arg0.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg0.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("is-horizontal: arg 1: expected integer") + return env.NewError("is-horizontal: arg 1: " + "expected integer, but got " + objectDebugString(ps.Idx, arg0)) } arg0Val = fyne.DeviceOrientation(u) } @@ -159353,11 +155640,11 @@ var Builtins = map[string]*env.Builtin{ arg0Val = natVal } else { var u int - if v, ok := arg0.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg0.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("is-vertical: arg 1: expected integer") + return env.NewError("is-vertical: arg 1: " + "expected integer, but got " + objectDebugString(ps.Idx, arg0)) } arg0Val = fyne.DeviceOrientation(u) } @@ -160111,32 +156398,15 @@ var Builtins = map[string]*env.Builtin{ Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("load-resource-from-path: arg 1: expected string") + return env.NewError("load-resource-from-path: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } res0, resErr := fyne.LoadResourceFromPath(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -160153,32 +156423,15 @@ var Builtins = map[string]*env.Builtin{ Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("load-resource-from-url-string: arg 1: expected string") + return env.NewError("load-resource-from-url-string: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } res0, resErr := fyne.LoadResourceFromURLString(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -160195,11 +156448,11 @@ var Builtins = map[string]*env.Builtin{ Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("log-error: arg 1: expected string") + return env.NewError("log-error: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val error switch v := arg1.(type) { @@ -160210,12 +156463,12 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("log-error: arg 2: expected integer to be 0 or nil") + return env.NewError("log-error: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("log-error: arg 2: expected error, string or nil") + return env.NewError("log-error: arg 2: " + "expected error, string or nil, but got " + objectDebugString(ps.Idx, v)) } fyne.LogError(arg0Val, arg1Val) return nil @@ -160226,18 +156479,18 @@ var Builtins = map[string]*env.Builtin{ Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val float32 - if v, ok := arg0.(env.Decimal); ok { - arg0Val = float32(v.Value) + if vc, ok := arg0.(env.Decimal); ok { + arg0Val = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("max: arg 1: expected decimal") + return env.NewError("max: arg 1: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val float32 - if v, ok := arg1.(env.Decimal); ok { - arg1Val = float32(v.Value) + if vc, ok := arg1.(env.Decimal); ok { + arg1Val = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("max: arg 2: expected decimal") + return env.NewError("max: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } res0 := fyne.Max(arg0Val, arg1Val) var res0Obj env.Object @@ -160250,39 +156503,33 @@ var Builtins = map[string]*env.Builtin{ Argsn: 3, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("measure-text: arg 1: expected string") + return env.NewError("measure-text: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val float32 - if v, ok := arg1.(env.Decimal); ok { - arg1Val = float32(v.Value) + if vc, ok := arg1.(env.Decimal); ok { + arg1Val = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("measure-text: arg 2: expected decimal") + return env.NewError("measure-text: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } - var arg2Val *fyne.TextStyle + var arg2Val fyne.TextStyle switch v := arg2.(type) { case env.Native: - var ok bool - arg2Val, ok = v.Value.(*fyne.TextStyle) - if !ok { - ps.FailureFlag = true - return env.NewError("measure-text: arg 3: expected native of type *fyne.TextStyle") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.TextStyle); ok { + arg2Val = *vc + } else { ps.FailureFlag = true - return env.NewError("measure-text: arg 3: expected integer to be 0 or nil") + return env.NewError("measure-text: arg 3: " + "expected native of type *fyne.TextStyle, but got " + objectDebugString(ps.Idx, v)) } - arg2Val = nil default: ps.FailureFlag = true - return env.NewError("measure-text: arg 3: expected native") + return env.NewError("measure-text: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - res0 := fyne.MeasureText(arg0Val, arg1Val, *arg2Val) + res0 := fyne.MeasureText(arg0Val, arg1Val, arg2Val) var res0Obj env.Object res0Obj = *env.NewNative(ps.Idx, &res0, "Go(*fyne.Size)") return res0Obj @@ -160293,18 +156540,18 @@ var Builtins = map[string]*env.Builtin{ Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val float32 - if v, ok := arg0.(env.Decimal); ok { - arg0Val = float32(v.Value) + if vc, ok := arg0.(env.Decimal); ok { + arg0Val = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("min: arg 1: expected decimal") + return env.NewError("min: arg 1: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val float32 - if v, ok := arg1.(env.Decimal); ok { - arg1Val = float32(v.Value) + if vc, ok := arg1.(env.Decimal); ok { + arg1Val = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("min: arg 2: expected decimal") + return env.NewError("min: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } res0 := fyne.Min(arg0Val, arg1Val) var res0Obj env.Object @@ -160319,39 +156566,39 @@ var Builtins = map[string]*env.Builtin{ var arg0Val time.Duration switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(time.Duration) - if !ok { + if vc, ok := v.Value.(time.Duration); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("animation: arg 1: expected native of type time.Duration") + return env.NewError("animation: arg 1: " + "expected native of type time.Duration, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("animation: arg 1: expected native") + return env.NewError("animation: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func(float32) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("animation: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("animation: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg1Val = func(arg0 float32) { - var arg0Val env.Object - arg0Val = *env.NewDecimal(float64(arg0)) + arg1Val = func(farg0 float32) { + var farg0Val env.Object + farg0Val = *env.NewDecimal(float64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("animation: arg 2: expected integer to be 0 or nil") + return env.NewError("animation: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("animation: arg 2: expected function or nil") + return env.NewError("animation: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } res0 := fyne.NewAnimation(arg0Val, arg1Val) var res0Obj env.Object @@ -160384,42 +156631,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val[i], err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("container: arg 1: block item: " + err.Error() + "") + return env.NewError("container: arg 1: " + "block item: " + err.Error()) } case env.Native: - var ok bool - arg0Val[i], ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("container: arg 1: block item: expected native of type fyne.CanvasObject") + return env.NewError("container: arg 1: " + "block item: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("container: arg 1: block item: expected integer to be 0 or nil") + return env.NewError("container: arg 1: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val[i] = nil default: ps.FailureFlag = true - return env.NewError("container: arg 1: block item: expected native") + return env.NewError("container: arg 1: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg0Val, ok = v.Value.([]fyne.CanvasObject) - if !ok { - ps.FailureFlag = true - return env.NewError("container: arg 1: expected native of type []fyne.CanvasObject") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("container: arg 1: expected integer to be 0 or nil") + return env.NewError("container: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("container: arg 1: expected block, native or nil") + return env.NewError("container: arg 1: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := fyne.NewContainer(arg0Val...) var res0Obj env.Object @@ -160438,24 +156678,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Layout(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("container-with-layout: arg 1: " + err.Error() + "") + return env.NewError("container-with-layout: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Layout) - if !ok { + if vc, ok := v.Value.(fyne.Layout); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("container-with-layout: arg 1: expected native of type fyne.Layout") + return env.NewError("container-with-layout: arg 1: " + "expected native of type fyne.Layout, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("container-with-layout: arg 1: expected integer to be 0 or nil") + return env.NewError("container-with-layout: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("container-with-layout: arg 1: expected native") + return env.NewError("container-with-layout: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val []fyne.CanvasObject switch v := arg1.(type) { @@ -160468,42 +156708,35 @@ var Builtins = map[string]*env.Builtin{ arg1Val[i], err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("container-with-layout: arg 2: block item: " + err.Error() + "") + return env.NewError("container-with-layout: arg 2: " + "block item: " + err.Error()) } case env.Native: - var ok bool - arg1Val[i], ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("container-with-layout: arg 2: block item: expected native of type fyne.CanvasObject") + return env.NewError("container-with-layout: arg 2: " + "block item: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("container-with-layout: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("container-with-layout: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val[i] = nil default: ps.FailureFlag = true - return env.NewError("container-with-layout: arg 2: block item: expected native") + return env.NewError("container-with-layout: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]fyne.CanvasObject) - if !ok { - ps.FailureFlag = true - return env.NewError("container-with-layout: arg 2: expected native of type []fyne.CanvasObject") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("container-with-layout: arg 2: expected integer to be 0 or nil") + return env.NewError("container-with-layout: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("container-with-layout: arg 2: expected block, native or nil") + return env.NewError("container-with-layout: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := fyne.NewContainerWithLayout(arg0Val, arg1Val...) var res0Obj env.Object @@ -160526,42 +156759,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val[i], err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("container-without-layout: arg 1: block item: " + err.Error() + "") + return env.NewError("container-without-layout: arg 1: " + "block item: " + err.Error()) } case env.Native: - var ok bool - arg0Val[i], ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("container-without-layout: arg 1: block item: expected native of type fyne.CanvasObject") + return env.NewError("container-without-layout: arg 1: " + "block item: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("container-without-layout: arg 1: block item: expected integer to be 0 or nil") + return env.NewError("container-without-layout: arg 1: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val[i] = nil default: ps.FailureFlag = true - return env.NewError("container-without-layout: arg 1: block item: expected native") + return env.NewError("container-without-layout: arg 1: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg0Val, ok = v.Value.([]fyne.CanvasObject) - if !ok { - ps.FailureFlag = true - return env.NewError("container-without-layout: arg 1: expected native of type []fyne.CanvasObject") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("container-without-layout: arg 1: expected integer to be 0 or nil") + return env.NewError("container-without-layout: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("container-without-layout: arg 1: expected block, native or nil") + return env.NewError("container-without-layout: arg 1: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := fyne.NewContainerWithoutLayout(arg0Val...) var res0Obj env.Object @@ -160574,18 +156800,18 @@ var Builtins = map[string]*env.Builtin{ Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val float32 - if v, ok := arg0.(env.Decimal); ok { - arg0Val = float32(v.Value) + if vc, ok := arg0.(env.Decimal); ok { + arg0Val = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("delta: arg 1: expected decimal") + return env.NewError("delta: arg 1: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val float32 - if v, ok := arg1.(env.Decimal); ok { - arg1Val = float32(v.Value) + if vc, ok := arg1.(env.Decimal); ok { + arg1Val = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("delta: arg 2: expected decimal") + return env.NewError("delta: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } res0 := fyne.NewDelta(arg0Val, arg1Val) var res0Obj env.Object @@ -160634,39 +156860,32 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg0Val[i], ok = v.Value.(*fyne.Menu) - if !ok { + if vc, ok := v.Value.(*fyne.Menu); ok { + arg0Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("main-menu: arg 1: block item: expected native of type *fyne.Menu") + return env.NewError("main-menu: arg 1: " + "block item: " + "expected native of type *fyne.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("main-menu: arg 1: block item: expected integer to be 0 or nil") + return env.NewError("main-menu: arg 1: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val[i] = nil default: ps.FailureFlag = true - return env.NewError("main-menu: arg 1: block item: expected native") + return env.NewError("main-menu: arg 1: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg0Val, ok = v.Value.([]*fyne.Menu) - if !ok { - ps.FailureFlag = true - return env.NewError("main-menu: arg 1: expected native of type []*fyne.Menu") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("main-menu: arg 1: expected integer to be 0 or nil") + return env.NewError("main-menu: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("main-menu: arg 1: expected block, native or nil") + return env.NewError("main-menu: arg 1: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := fyne.NewMainMenu(arg0Val...) var res0Obj env.Object @@ -160679,11 +156898,11 @@ var Builtins = map[string]*env.Builtin{ Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("menu: arg 1: expected string") + return env.NewError("menu: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val []*fyne.MenuItem switch v := arg1.(type) { @@ -160692,39 +156911,32 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg1Val[i], ok = v.Value.(*fyne.MenuItem) - if !ok { + if vc, ok := v.Value.(*fyne.MenuItem); ok { + arg1Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("menu: arg 2: block item: expected native of type *fyne.MenuItem") + return env.NewError("menu: arg 2: " + "block item: " + "expected native of type *fyne.MenuItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("menu: arg 2: block item: expected integer to be 0 or nil") + return env.NewError("menu: arg 2: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val[i] = nil default: ps.FailureFlag = true - return env.NewError("menu: arg 2: block item: expected native") + return env.NewError("menu: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]*fyne.MenuItem) - if !ok { - ps.FailureFlag = true - return env.NewError("menu: arg 2: expected native of type []*fyne.MenuItem") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("menu: arg 2: expected integer to be 0 or nil") + return env.NewError("menu: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("menu: arg 2: expected block, native or nil") + return env.NewError("menu: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := fyne.NewMenu(arg0Val, arg1Val...) var res0Obj env.Object @@ -160737,18 +156949,18 @@ var Builtins = map[string]*env.Builtin{ Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("menu-item: arg 1: expected string") + return env.NewError("menu-item: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val func() switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("menu-item: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("menu-item: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } arg1Val = func() { actualFn := fn @@ -160758,12 +156970,12 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("menu-item: arg 2: expected integer to be 0 or nil") + return env.NewError("menu-item: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("menu-item: arg 2: expected function or nil") + return env.NewError("menu-item: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } res0 := fyne.NewMenuItem(arg0Val, arg1Val) var res0Obj env.Object @@ -160786,18 +156998,18 @@ var Builtins = map[string]*env.Builtin{ Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("notification: arg 1: expected string") + return env.NewError("notification: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("notification: arg 2: expected string") + return env.NewError("notification: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := fyne.NewNotification(arg0Val, arg1Val) var res0Obj env.Object @@ -160820,18 +157032,18 @@ var Builtins = map[string]*env.Builtin{ Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val float32 - if v, ok := arg0.(env.Decimal); ok { - arg0Val = float32(v.Value) + if vc, ok := arg0.(env.Decimal); ok { + arg0Val = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("pos: arg 1: expected decimal") + return env.NewError("pos: arg 1: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val float32 - if v, ok := arg1.(env.Decimal); ok { - arg1Val = float32(v.Value) + if vc, ok := arg1.(env.Decimal); ok { + arg1Val = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("pos: arg 2: expected decimal") + return env.NewError("pos: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } res0 := fyne.NewPos(arg0Val, arg1Val) var res0Obj env.Object @@ -160914,18 +157126,18 @@ var Builtins = map[string]*env.Builtin{ Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val float32 - if v, ok := arg0.(env.Decimal); ok { - arg0Val = float32(v.Value) + if vc, ok := arg0.(env.Decimal); ok { + arg0Val = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("size: arg 1: expected decimal") + return env.NewError("size: arg 1: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val float32 - if v, ok := arg1.(env.Decimal); ok { - arg1Val = float32(v.Value) + if vc, ok := arg1.(env.Decimal); ok { + arg1Val = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("size: arg 2: expected decimal") + return env.NewError("size: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } res0 := fyne.NewSize(arg0Val, arg1Val) var res0Obj env.Object @@ -160938,11 +157150,11 @@ var Builtins = map[string]*env.Builtin{ Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val float32 - if v, ok := arg0.(env.Decimal); ok { - arg0Val = float32(v.Value) + if vc, ok := arg0.(env.Decimal); ok { + arg0Val = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("square-offset-pos: arg 1: expected decimal") + return env.NewError("square-offset-pos: arg 1: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg0)) } res0 := fyne.NewSquareOffsetPos(arg0Val) var res0Obj env.Object @@ -160955,11 +157167,11 @@ var Builtins = map[string]*env.Builtin{ Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val float32 - if v, ok := arg0.(env.Decimal); ok { - arg0Val = float32(v.Value) + if vc, ok := arg0.(env.Decimal); ok { + arg0Val = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("square-size: arg 1: expected decimal") + return env.NewError("square-size: arg 1: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg0)) } res0 := fyne.NewSquareSize(arg0Val) var res0Obj env.Object @@ -160972,11 +157184,11 @@ var Builtins = map[string]*env.Builtin{ Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("static-resource: arg 1: expected string") + return env.NewError("static-resource: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val []byte switch v := arg1.(type) { @@ -160985,33 +157197,26 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg1Val[i], ok = v.Value.(byte) - if !ok { + if vc, ok := v.Value.(byte); ok { + arg1Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("static-resource: arg 2: block item: expected native of type byte") + return env.NewError("static-resource: arg 2: " + "block item: " + "expected native of type byte, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("static-resource: arg 2: block item: expected native") + return env.NewError("static-resource: arg 2: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg1Val, ok = v.Value.([]byte) - if !ok { - ps.FailureFlag = true - return env.NewError("static-resource: arg 2: expected native of type []byte") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("static-resource: arg 2: expected integer to be 0 or nil") + return env.NewError("static-resource: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("static-resource: arg 2: expected block, native or nil") + return env.NewError("static-resource: arg 2: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := fyne.NewStaticResource(arg0Val, arg1Val) var res0Obj env.Object @@ -161076,24 +157281,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_App(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("set-current-app: arg 1: " + err.Error() + "") + return env.NewError("set-current-app: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.App) - if !ok { + if vc, ok := v.Value.(fyne.App); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("set-current-app: arg 1: expected native of type fyne.App") + return env.NewError("set-current-app: arg 1: " + "expected native of type fyne.App, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("set-current-app: arg 1: expected integer to be 0 or nil") + return env.NewError("set-current-app: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("set-current-app: arg 1: expected native") + return env.NewError("set-current-app: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } fyne.SetCurrentApp(arg0Val) return nil @@ -161194,32 +157399,15 @@ var Builtins = map[string]*env.Builtin{ Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val int - if v, ok := arg0.(env.Integer); ok { - arg0Val = int(v.Value) + if vc, ok := arg0.(env.Integer); ok { + arg0Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("layout-adaptive-grid-layout: arg 1: expected integer") + return env.NewError("layout-adaptive-grid-layout: arg 1: " + "expected integer, but got " + objectDebugString(ps.Idx, arg0)) } res0 := layout.NewAdaptiveGridLayout(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Layout)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Layout)") return res0Obj }, }, @@ -161234,24 +157422,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("layout-border-layout: arg 1: " + err.Error() + "") + return env.NewError("layout-border-layout: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("layout-border-layout: arg 1: expected native of type fyne.CanvasObject") + return env.NewError("layout-border-layout: arg 1: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("layout-border-layout: arg 1: expected integer to be 0 or nil") + return env.NewError("layout-border-layout: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("layout-border-layout: arg 1: expected native") + return env.NewError("layout-border-layout: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.CanvasObject switch v := arg1.(type) { @@ -161260,24 +157448,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("layout-border-layout: arg 2: " + err.Error() + "") + return env.NewError("layout-border-layout: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("layout-border-layout: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("layout-border-layout: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("layout-border-layout: arg 2: expected integer to be 0 or nil") + return env.NewError("layout-border-layout: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("layout-border-layout: arg 2: expected native") + return env.NewError("layout-border-layout: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg2Val fyne.CanvasObject switch v := arg2.(type) { @@ -161286,24 +157474,24 @@ var Builtins = map[string]*env.Builtin{ arg2Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("layout-border-layout: arg 3: " + err.Error() + "") + return env.NewError("layout-border-layout: arg 3: " + err.Error()) } case env.Native: - var ok bool - arg2Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("layout-border-layout: arg 3: expected native of type fyne.CanvasObject") + return env.NewError("layout-border-layout: arg 3: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("layout-border-layout: arg 3: expected integer to be 0 or nil") + return env.NewError("layout-border-layout: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("layout-border-layout: arg 3: expected native") + return env.NewError("layout-border-layout: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg3Val fyne.CanvasObject switch v := arg3.(type) { @@ -161312,45 +157500,28 @@ var Builtins = map[string]*env.Builtin{ arg3Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("layout-border-layout: arg 4: " + err.Error() + "") + return env.NewError("layout-border-layout: arg 4: " + err.Error()) } case env.Native: - var ok bool - arg3Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg3Val = vc + } else { ps.FailureFlag = true - return env.NewError("layout-border-layout: arg 4: expected native of type fyne.CanvasObject") + return env.NewError("layout-border-layout: arg 4: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("layout-border-layout: arg 4: expected integer to be 0 or nil") + return env.NewError("layout-border-layout: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("layout-border-layout: arg 4: expected native") + return env.NewError("layout-border-layout: arg 4: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := layout.NewBorderLayout(arg0Val, arg1Val, arg2Val, arg3Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Layout)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Layout)") return res0Obj }, }, @@ -161360,24 +157531,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := layout.NewCenterLayout() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Layout)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Layout)") return res0Obj }, }, @@ -161387,24 +157541,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := layout.NewFormLayout() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Layout)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Layout)") return res0Obj }, }, @@ -161413,32 +157550,15 @@ var Builtins = map[string]*env.Builtin{ Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val int - if v, ok := arg0.(env.Integer); ok { - arg0Val = int(v.Value) + if vc, ok := arg0.(env.Integer); ok { + arg0Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("layout-grid-layout: arg 1: expected integer") + return env.NewError("layout-grid-layout: arg 1: " + "expected integer, but got " + objectDebugString(ps.Idx, arg0)) } res0 := layout.NewGridLayout(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Layout)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Layout)") return res0Obj }, }, @@ -161447,32 +157567,15 @@ var Builtins = map[string]*env.Builtin{ Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val int - if v, ok := arg0.(env.Integer); ok { - arg0Val = int(v.Value) + if vc, ok := arg0.(env.Integer); ok { + arg0Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("layout-grid-layout-with-columns: arg 1: expected integer") + return env.NewError("layout-grid-layout-with-columns: arg 1: " + "expected integer, but got " + objectDebugString(ps.Idx, arg0)) } res0 := layout.NewGridLayoutWithColumns(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Layout)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Layout)") return res0Obj }, }, @@ -161481,32 +157584,15 @@ var Builtins = map[string]*env.Builtin{ Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val int - if v, ok := arg0.(env.Integer); ok { - arg0Val = int(v.Value) + if vc, ok := arg0.(env.Integer); ok { + arg0Val = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("layout-grid-layout-with-rows: arg 1: expected integer") + return env.NewError("layout-grid-layout-with-rows: arg 1: " + "expected integer, but got " + objectDebugString(ps.Idx, arg0)) } res0 := layout.NewGridLayoutWithRows(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Layout)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Layout)") return res0Obj }, }, @@ -161514,45 +157600,22 @@ var Builtins = map[string]*env.Builtin{ Doc: "layout.NewGridWrapLayout", Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var arg0Val *fyne.Size + var arg0Val fyne.Size switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Size) - if !ok { - ps.FailureFlag = true - return env.NewError("layout-grid-wrap-layout: arg 1: expected native of type *fyne.Size") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Size); ok { + arg0Val = *vc + } else { ps.FailureFlag = true - return env.NewError("layout-grid-wrap-layout: arg 1: expected integer to be 0 or nil") + return env.NewError("layout-grid-wrap-layout: arg 1: " + "expected native of type *fyne.Size, but got " + objectDebugString(ps.Idx, v)) } - arg0Val = nil default: ps.FailureFlag = true - return env.NewError("layout-grid-wrap-layout: arg 1: expected native") + return env.NewError("layout-grid-wrap-layout: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - res0 := layout.NewGridWrapLayout(*arg0Val) + res0 := layout.NewGridWrapLayout(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Layout)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Layout)") return res0Obj }, }, @@ -161562,24 +157625,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := layout.NewHBoxLayout() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Layout)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Layout)") return res0Obj }, }, @@ -161589,24 +157635,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := layout.NewMaxLayout() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Layout)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Layout)") return res0Obj }, }, @@ -161616,24 +157645,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := layout.NewPaddedLayout() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Layout)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Layout)") return res0Obj }, }, @@ -161643,24 +157655,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := layout.NewSpacer() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.CanvasObject)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.CanvasObject)") return res0Obj }, }, @@ -161670,24 +157665,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := layout.NewStackLayout() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Layout)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Layout)") return res0Obj }, }, @@ -161697,24 +157675,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := layout.NewVBoxLayout() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Layout)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Layout)") return res0Obj }, }, @@ -161779,24 +157740,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := playground.NewSoftwareCanvas() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(test.WindowlessCanvas)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(test.WindowlessCanvas)") return res0Obj }, }, @@ -161811,24 +157755,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("playground-render: arg 1: " + err.Error() + "") + return env.NewError("playground-render: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("playground-render: arg 1: expected native of type fyne.CanvasObject") + return env.NewError("playground-render: arg 1: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("playground-render: arg 1: expected integer to be 0 or nil") + return env.NewError("playground-render: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("playground-render: arg 1: expected native") + return env.NewError("playground-render: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } playground.Render(arg0Val) return nil @@ -161845,24 +157789,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("playground-render-canvas: arg 1: " + err.Error() + "") + return env.NewError("playground-render-canvas: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("playground-render-canvas: arg 1: expected native of type fyne.Canvas") + return env.NewError("playground-render-canvas: arg 1: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("playground-render-canvas: arg 1: expected integer to be 0 or nil") + return env.NewError("playground-render-canvas: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("playground-render-canvas: arg 1: expected native") + return env.NewError("playground-render-canvas: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } playground.RenderCanvas(arg0Val) return nil @@ -161879,24 +157823,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Window(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("playground-render-window: arg 1: " + err.Error() + "") + return env.NewError("playground-render-window: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Window) - if !ok { + if vc, ok := v.Value.(fyne.Window); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("playground-render-window: arg 1: expected native of type fyne.Window") + return env.NewError("playground-render-window: arg 1: " + "expected native of type fyne.Window, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("playground-render-window: arg 1: expected integer to be 0 or nil") + return env.NewError("playground-render-window: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("playground-render-window: arg 1: expected native") + return env.NewError("playground-render-window: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } playground.RenderWindow(arg0Val) return nil @@ -161907,32 +157851,15 @@ var Builtins = map[string]*env.Builtin{ Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("repository-for-scheme: arg 1: expected string") + return env.NewError("repository-for-scheme: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } res0, resErr := repository.ForScheme(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(repository.Repository)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(repository.Repository)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -161955,45 +157882,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("repository-for-uri: arg 1: " + err.Error() + "") + return env.NewError("repository-for-uri: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("repository-for-uri: arg 1: expected native of type fyne.URI") + return env.NewError("repository-for-uri: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("repository-for-uri: arg 1: expected integer to be 0 or nil") + return env.NewError("repository-for-uri: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("repository-for-uri: arg 1: expected native") + return env.NewError("repository-for-uri: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := repository.ForURI(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(repository.Repository)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(repository.Repository)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -162016,52 +157926,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("repository-generic-child: arg 1: " + err.Error() + "") + return env.NewError("repository-generic-child: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("repository-generic-child: arg 1: expected native of type fyne.URI") + return env.NewError("repository-generic-child: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("repository-generic-child: arg 1: expected integer to be 0 or nil") + return env.NewError("repository-generic-child: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("repository-generic-child: arg 1: expected native") + return env.NewError("repository-generic-child: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("repository-generic-child: arg 2: expected string") + return env.NewError("repository-generic-child: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := repository.GenericChild(arg0Val, arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URI)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URI)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -162084,24 +157977,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("repository-generic-copy: arg 1: " + err.Error() + "") + return env.NewError("repository-generic-copy: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("repository-generic-copy: arg 1: expected native of type fyne.URI") + return env.NewError("repository-generic-copy: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("repository-generic-copy: arg 1: expected integer to be 0 or nil") + return env.NewError("repository-generic-copy: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("repository-generic-copy: arg 1: expected native") + return env.NewError("repository-generic-copy: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -162110,24 +158003,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("repository-generic-copy: arg 2: " + err.Error() + "") + return env.NewError("repository-generic-copy: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("repository-generic-copy: arg 2: expected native of type fyne.URI") + return env.NewError("repository-generic-copy: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("repository-generic-copy: arg 2: expected integer to be 0 or nil") + return env.NewError("repository-generic-copy: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("repository-generic-copy: arg 2: expected native") + return env.NewError("repository-generic-copy: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := repository.GenericCopy(arg0Val, arg1Val) var resErrObj env.Object @@ -162152,24 +158045,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("repository-generic-move: arg 1: " + err.Error() + "") + return env.NewError("repository-generic-move: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("repository-generic-move: arg 1: expected native of type fyne.URI") + return env.NewError("repository-generic-move: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("repository-generic-move: arg 1: expected integer to be 0 or nil") + return env.NewError("repository-generic-move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("repository-generic-move: arg 1: expected native") + return env.NewError("repository-generic-move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -162178,24 +158071,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("repository-generic-move: arg 2: " + err.Error() + "") + return env.NewError("repository-generic-move: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("repository-generic-move: arg 2: expected native of type fyne.URI") + return env.NewError("repository-generic-move: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("repository-generic-move: arg 2: expected integer to be 0 or nil") + return env.NewError("repository-generic-move: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("repository-generic-move: arg 2: expected native") + return env.NewError("repository-generic-move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := repository.GenericMove(arg0Val, arg1Val) var resErrObj env.Object @@ -162220,45 +158113,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("repository-generic-parent: arg 1: " + err.Error() + "") + return env.NewError("repository-generic-parent: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("repository-generic-parent: arg 1: expected native of type fyne.URI") + return env.NewError("repository-generic-parent: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("repository-generic-parent: arg 1: expected integer to be 0 or nil") + return env.NewError("repository-generic-parent: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("repository-generic-parent: arg 1: expected native") + return env.NewError("repository-generic-parent: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := repository.GenericParent(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URI)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URI)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -162275,32 +158151,15 @@ var Builtins = map[string]*env.Builtin{ Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("repository-file-uri: arg 1: expected string") + return env.NewError("repository-file-uri: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } res0 := repository.NewFileURI(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URI)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URI)") return res0Obj }, }, @@ -162309,32 +158168,15 @@ var Builtins = map[string]*env.Builtin{ Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("repository-parse-uri: arg 1: expected string") + return env.NewError("repository-parse-uri: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } res0, resErr := repository.ParseURI(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URI)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URI)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -162351,11 +158193,11 @@ var Builtins = map[string]*env.Builtin{ Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("repository-register: arg 1: expected string") + return env.NewError("repository-register: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val repository.Repository switch v := arg1.(type) { @@ -162364,24 +158206,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_repository_Repository(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("repository-register: arg 2: " + err.Error() + "") + return env.NewError("repository-register: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(repository.Repository) - if !ok { + if vc, ok := v.Value.(repository.Repository); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("repository-register: arg 2: expected native of type repository.Repository") + return env.NewError("repository-register: arg 2: " + "expected native of type repository.Repository, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("repository-register: arg 2: expected integer to be 0 or nil") + return env.NewError("repository-register: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("repository-register: arg 2: expected native") + return env.NewError("repository-register: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } repository.Register(arg0Val, arg1Val) return nil @@ -162393,24 +158235,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := software.NewCanvas() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(test.WindowlessCanvas)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(test.WindowlessCanvas)") return res0Obj }, }, @@ -162420,24 +158245,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := software.NewTransparentCanvas() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(test.WindowlessCanvas)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(test.WindowlessCanvas)") return res0Obj }, }, @@ -162452,24 +158260,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("software-render: arg 1: " + err.Error() + "") + return env.NewError("software-render: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("software-render: arg 1: expected native of type fyne.CanvasObject") + return env.NewError("software-render: arg 1: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("software-render: arg 1: expected integer to be 0 or nil") + return env.NewError("software-render: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("software-render: arg 1: expected native") + return env.NewError("software-render: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Theme switch v := arg1.(type) { @@ -162478,24 +158286,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Theme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("software-render: arg 2: " + err.Error() + "") + return env.NewError("software-render: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Theme) - if !ok { + if vc, ok := v.Value.(fyne.Theme); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("software-render: arg 2: expected native of type fyne.Theme") + return env.NewError("software-render: arg 2: " + "expected native of type fyne.Theme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("software-render: arg 2: expected integer to be 0 or nil") + return env.NewError("software-render: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("software-render: arg 2: expected native") + return env.NewError("software-render: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := software.Render(arg0Val, arg1Val) var res0Obj env.Object @@ -162514,24 +158322,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("software-render-canvas: arg 1: " + err.Error() + "") + return env.NewError("software-render-canvas: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("software-render-canvas: arg 1: expected native of type fyne.Canvas") + return env.NewError("software-render-canvas: arg 1: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("software-render-canvas: arg 1: expected integer to be 0 or nil") + return env.NewError("software-render-canvas: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("software-render-canvas: arg 1: expected native") + return env.NewError("software-render-canvas: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Theme switch v := arg1.(type) { @@ -162540,24 +158348,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Theme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("software-render-canvas: arg 2: " + err.Error() + "") + return env.NewError("software-render-canvas: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Theme) - if !ok { + if vc, ok := v.Value.(fyne.Theme); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("software-render-canvas: arg 2: expected native of type fyne.Theme") + return env.NewError("software-render-canvas: arg 2: " + "expected native of type fyne.Theme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("software-render-canvas: arg 2: expected integer to be 0 or nil") + return env.NewError("software-render-canvas: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("software-render-canvas: arg 2: expected native") + return env.NewError("software-render-canvas: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := software.RenderCanvas(arg0Val, arg1Val) var res0Obj env.Object @@ -162576,24 +158384,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("storage-can-list: arg 1: " + err.Error() + "") + return env.NewError("storage-can-list: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("storage-can-list: arg 1: expected native of type fyne.URI") + return env.NewError("storage-can-list: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("storage-can-list: arg 1: expected integer to be 0 or nil") + return env.NewError("storage-can-list: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("storage-can-list: arg 1: expected native") + return env.NewError("storage-can-list: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := storage.CanList(arg0Val) var res0Obj env.Object @@ -162620,24 +158428,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("storage-can-read: arg 1: " + err.Error() + "") + return env.NewError("storage-can-read: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("storage-can-read: arg 1: expected native of type fyne.URI") + return env.NewError("storage-can-read: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("storage-can-read: arg 1: expected integer to be 0 or nil") + return env.NewError("storage-can-read: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("storage-can-read: arg 1: expected native") + return env.NewError("storage-can-read: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := storage.CanRead(arg0Val) var res0Obj env.Object @@ -162664,24 +158472,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("storage-can-write: arg 1: " + err.Error() + "") + return env.NewError("storage-can-write: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("storage-can-write: arg 1: expected native of type fyne.URI") + return env.NewError("storage-can-write: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("storage-can-write: arg 1: expected integer to be 0 or nil") + return env.NewError("storage-can-write: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("storage-can-write: arg 1: expected native") + return env.NewError("storage-can-write: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := storage.CanWrite(arg0Val) var res0Obj env.Object @@ -162708,52 +158516,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("storage-child: arg 1: " + err.Error() + "") + return env.NewError("storage-child: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("storage-child: arg 1: expected native of type fyne.URI") + return env.NewError("storage-child: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("storage-child: arg 1: expected integer to be 0 or nil") + return env.NewError("storage-child: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("storage-child: arg 1: expected native") + return env.NewError("storage-child: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("storage-child: arg 2: expected string") + return env.NewError("storage-child: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0, resErr := storage.Child(arg0Val, arg1Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URI)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URI)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -162776,24 +158567,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("storage-copy: arg 1: " + err.Error() + "") + return env.NewError("storage-copy: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("storage-copy: arg 1: expected native of type fyne.URI") + return env.NewError("storage-copy: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("storage-copy: arg 1: expected integer to be 0 or nil") + return env.NewError("storage-copy: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("storage-copy: arg 1: expected native") + return env.NewError("storage-copy: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -162802,24 +158593,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("storage-copy: arg 2: " + err.Error() + "") + return env.NewError("storage-copy: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("storage-copy: arg 2: expected native of type fyne.URI") + return env.NewError("storage-copy: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("storage-copy: arg 2: expected integer to be 0 or nil") + return env.NewError("storage-copy: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("storage-copy: arg 2: expected native") + return env.NewError("storage-copy: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := storage.Copy(arg0Val, arg1Val) var resErrObj env.Object @@ -162844,24 +158635,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("storage-create-listable: arg 1: " + err.Error() + "") + return env.NewError("storage-create-listable: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("storage-create-listable: arg 1: expected native of type fyne.URI") + return env.NewError("storage-create-listable: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("storage-create-listable: arg 1: expected integer to be 0 or nil") + return env.NewError("storage-create-listable: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("storage-create-listable: arg 1: expected native") + return env.NewError("storage-create-listable: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := storage.CreateListable(arg0Val) var resErrObj env.Object @@ -162886,24 +158677,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("storage-delete: arg 1: " + err.Error() + "") + return env.NewError("storage-delete: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("storage-delete: arg 1: expected native of type fyne.URI") + return env.NewError("storage-delete: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("storage-delete: arg 1: expected integer to be 0 or nil") + return env.NewError("storage-delete: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("storage-delete: arg 1: expected native") + return env.NewError("storage-delete: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := storage.Delete(arg0Val) var resErrObj env.Object @@ -162928,24 +158719,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("storage-exists: arg 1: " + err.Error() + "") + return env.NewError("storage-exists: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("storage-exists: arg 1: expected native of type fyne.URI") + return env.NewError("storage-exists: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("storage-exists: arg 1: expected integer to be 0 or nil") + return env.NewError("storage-exists: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("storage-exists: arg 1: expected native") + return env.NewError("storage-exists: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := storage.Exists(arg0Val) var res0Obj env.Object @@ -162972,48 +158763,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("storage-list: arg 1: " + err.Error() + "") + return env.NewError("storage-list: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("storage-list: arg 1: expected native of type fyne.URI") + return env.NewError("storage-list: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("storage-list: arg 1: expected integer to be 0 or nil") + return env.NewError("storage-list: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("storage-list: arg 1: expected native") + return env.NewError("storage-list: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := storage.List(arg0Val) var res0Obj env.Object { items := make([]env.Object, len(res0)) for i, it := range res0 { - { - typ := reflect.TypeOf(it) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - items[i] = *env.NewNative(ps.Idx, it, typRyeName) - } else { - items[i] = *env.NewNative(ps.Idx, it, "Go(fyne.URI)") - } - } + items[i] = ifaceToNative(ps.Idx, it, "Go(fyne.URI)") } res0Obj = *env.NewBlock(*env.NewTSeries(items)) } @@ -163039,45 +158813,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("storage-lister-for-uri: arg 1: " + err.Error() + "") + return env.NewError("storage-lister-for-uri: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("storage-lister-for-uri: arg 1: expected native of type fyne.URI") + return env.NewError("storage-lister-for-uri: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("storage-lister-for-uri: arg 1: expected integer to be 0 or nil") + return env.NewError("storage-lister-for-uri: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("storage-lister-for-uri: arg 1: expected native") + return env.NewError("storage-lister-for-uri: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := storage.ListerForURI(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.ListableURI)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.ListableURI)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -163100,45 +158857,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("storage-load-resource-from-uri: arg 1: " + err.Error() + "") + return env.NewError("storage-load-resource-from-uri: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("storage-load-resource-from-uri: arg 1: expected native of type fyne.URI") + return env.NewError("storage-load-resource-from-uri: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("storage-load-resource-from-uri: arg 1: expected integer to be 0 or nil") + return env.NewError("storage-load-resource-from-uri: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("storage-load-resource-from-uri: arg 1: expected native") + return env.NewError("storage-load-resource-from-uri: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := storage.LoadResourceFromURI(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -163161,24 +158901,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("storage-move: arg 1: " + err.Error() + "") + return env.NewError("storage-move: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("storage-move: arg 1: expected native of type fyne.URI") + return env.NewError("storage-move: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("storage-move: arg 1: expected integer to be 0 or nil") + return env.NewError("storage-move: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("storage-move: arg 1: expected native") + return env.NewError("storage-move: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.URI switch v := arg1.(type) { @@ -163187,24 +158927,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("storage-move: arg 2: " + err.Error() + "") + return env.NewError("storage-move: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("storage-move: arg 2: expected native of type fyne.URI") + return env.NewError("storage-move: arg 2: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("storage-move: arg 2: expected integer to be 0 or nil") + return env.NewError("storage-move: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("storage-move: arg 2: expected native") + return env.NewError("storage-move: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } resErr := storage.Move(arg0Val, arg1Val) var resErrObj env.Object @@ -163227,50 +158967,26 @@ var Builtins = map[string]*env.Builtin{ case env.Block: arg0Val = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - arg0Val[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + arg0Val[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("storage-extension-file-filter: arg 1: block item: expected string") + return env.NewError("storage-extension-file-filter: arg 1: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - arg0Val, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("storage-extension-file-filter: arg 1: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("storage-extension-file-filter: arg 1: expected integer to be 0 or nil") + return env.NewError("storage-extension-file-filter: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("storage-extension-file-filter: arg 1: expected block, native or nil") + return env.NewError("storage-extension-file-filter: arg 1: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := storage.NewExtensionFileFilter(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(storage.FileFilter)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(storage.FileFilter)") return res0Obj }, }, @@ -163279,32 +158995,15 @@ var Builtins = map[string]*env.Builtin{ Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("storage-file-uri: arg 1: expected string") + return env.NewError("storage-file-uri: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } res0 := storage.NewFileURI(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URI)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URI)") return res0Obj }, }, @@ -163317,50 +159016,26 @@ var Builtins = map[string]*env.Builtin{ case env.Block: arg0Val = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - arg0Val[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + arg0Val[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("storage-mime-type-file-filter: arg 1: block item: expected string") + return env.NewError("storage-mime-type-file-filter: arg 1: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - arg0Val, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("storage-mime-type-file-filter: arg 1: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("storage-mime-type-file-filter: arg 1: expected integer to be 0 or nil") + return env.NewError("storage-mime-type-file-filter: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("storage-mime-type-file-filter: arg 1: expected block, native or nil") + return env.NewError("storage-mime-type-file-filter: arg 1: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := storage.NewMimeTypeFileFilter(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(storage.FileFilter)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(storage.FileFilter)") return res0Obj }, }, @@ -163369,32 +159044,15 @@ var Builtins = map[string]*env.Builtin{ Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("storage-uri: arg 1: expected string") + return env.NewError("storage-uri: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } res0 := storage.NewURI(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URI)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URI)") return res0Obj }, }, @@ -163409,45 +159067,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("storage-open-file-from-uri: arg 1: " + err.Error() + "") + return env.NewError("storage-open-file-from-uri: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("storage-open-file-from-uri: arg 1: expected native of type fyne.URI") + return env.NewError("storage-open-file-from-uri: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("storage-open-file-from-uri: arg 1: expected integer to be 0 or nil") + return env.NewError("storage-open-file-from-uri: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("storage-open-file-from-uri: arg 1: expected native") + return env.NewError("storage-open-file-from-uri: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := storage.OpenFileFromURI(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URIReadCloser)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URIReadCloser)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -163470,45 +159111,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("storage-parent: arg 1: " + err.Error() + "") + return env.NewError("storage-parent: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("storage-parent: arg 1: expected native of type fyne.URI") + return env.NewError("storage-parent: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("storage-parent: arg 1: expected integer to be 0 or nil") + return env.NewError("storage-parent: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("storage-parent: arg 1: expected native") + return env.NewError("storage-parent: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := storage.Parent(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URI)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URI)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -163525,32 +159149,15 @@ var Builtins = map[string]*env.Builtin{ Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("storage-parse-uri: arg 1: expected string") + return env.NewError("storage-parse-uri: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } res0, resErr := storage.ParseURI(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URI)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URI)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -163573,45 +159180,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("storage-reader: arg 1: " + err.Error() + "") + return env.NewError("storage-reader: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("storage-reader: arg 1: expected native of type fyne.URI") + return env.NewError("storage-reader: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("storage-reader: arg 1: expected integer to be 0 or nil") + return env.NewError("storage-reader: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("storage-reader: arg 1: expected native") + return env.NewError("storage-reader: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := storage.Reader(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URIReadCloser)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URIReadCloser)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -163634,45 +159224,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("storage-save-file-to-uri: arg 1: " + err.Error() + "") + return env.NewError("storage-save-file-to-uri: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("storage-save-file-to-uri: arg 1: expected native of type fyne.URI") + return env.NewError("storage-save-file-to-uri: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("storage-save-file-to-uri: arg 1: expected integer to be 0 or nil") + return env.NewError("storage-save-file-to-uri: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("storage-save-file-to-uri: arg 1: expected native") + return env.NewError("storage-save-file-to-uri: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := storage.SaveFileToURI(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URIWriteCloser)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URIWriteCloser)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -163695,45 +159268,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("storage-writer: arg 1: " + err.Error() + "") + return env.NewError("storage-writer: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("storage-writer: arg 1: expected native of type fyne.URI") + return env.NewError("storage-writer: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("storage-writer: arg 1: expected integer to be 0 or nil") + return env.NewError("storage-writer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("storage-writer: arg 1: expected native") + return env.NewError("storage-writer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := storage.Writer(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.URIWriteCloser)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.URIWriteCloser)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -163752,21 +159308,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *testing.T switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*testing.T) - if !ok { + if vc, ok := v.Value.(*testing.T); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-apply-theme: arg 1: expected native of type *testing.T") + return env.NewError("test-apply-theme: arg 1: " + "expected native of type *testing.T, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-apply-theme: arg 1: expected integer to be 0 or nil") + return env.NewError("test-apply-theme: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("test-apply-theme: arg 1: expected native") + return env.NewError("test-apply-theme: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Theme switch v := arg1.(type) { @@ -163775,24 +159331,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Theme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("test-apply-theme: arg 2: " + err.Error() + "") + return env.NewError("test-apply-theme: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Theme) - if !ok { + if vc, ok := v.Value.(fyne.Theme); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-apply-theme: arg 2: expected native of type fyne.Theme") + return env.NewError("test-apply-theme: arg 2: " + "expected native of type fyne.Theme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-apply-theme: arg 2: expected integer to be 0 or nil") + return env.NewError("test-apply-theme: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("test-apply-theme: arg 2: expected native") + return env.NewError("test-apply-theme: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } test.ApplyTheme(arg0Val, arg1Val) return nil @@ -163805,21 +159361,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *testing.T switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*testing.T) - if !ok { + if vc, ok := v.Value.(*testing.T); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-assert-canvas-tappable-at: arg 1: expected native of type *testing.T") + return env.NewError("test-assert-canvas-tappable-at: arg 1: " + "expected native of type *testing.T, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-assert-canvas-tappable-at: arg 1: expected integer to be 0 or nil") + return env.NewError("test-assert-canvas-tappable-at: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("test-assert-canvas-tappable-at: arg 1: expected native") + return env.NewError("test-assert-canvas-tappable-at: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Canvas switch v := arg1.(type) { @@ -163828,45 +159384,39 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("test-assert-canvas-tappable-at: arg 2: " + err.Error() + "") + return env.NewError("test-assert-canvas-tappable-at: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-assert-canvas-tappable-at: arg 2: expected native of type fyne.Canvas") + return env.NewError("test-assert-canvas-tappable-at: arg 2: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-assert-canvas-tappable-at: arg 2: expected integer to be 0 or nil") + return env.NewError("test-assert-canvas-tappable-at: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("test-assert-canvas-tappable-at: arg 2: expected native") + return env.NewError("test-assert-canvas-tappable-at: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg2Val *fyne.Position + var arg2Val fyne.Position switch v := arg2.(type) { case env.Native: - var ok bool - arg2Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("test-assert-canvas-tappable-at: arg 3: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg2Val = *vc + } else { ps.FailureFlag = true - return env.NewError("test-assert-canvas-tappable-at: arg 3: expected integer to be 0 or nil") + return env.NewError("test-assert-canvas-tappable-at: arg 3: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg2Val = nil default: ps.FailureFlag = true - return env.NewError("test-assert-canvas-tappable-at: arg 3: expected native") + return env.NewError("test-assert-canvas-tappable-at: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - res0 := test.AssertCanvasTappableAt(arg0Val, arg1Val, *arg2Val) + res0 := test.AssertCanvasTappableAt(arg0Val, arg1Val, arg2Val) var res0Obj env.Object res0Obj = *env.NewInteger(boolToInt64(res0)) return res0Obj @@ -163879,76 +159429,69 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *testing.T switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*testing.T) - if !ok { + if vc, ok := v.Value.(*testing.T); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-assert-image-matches: arg 1: expected native of type *testing.T") + return env.NewError("test-assert-image-matches: arg 1: " + "expected native of type *testing.T, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-assert-image-matches: arg 1: expected integer to be 0 or nil") + return env.NewError("test-assert-image-matches: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("test-assert-image-matches: arg 1: expected native") + return env.NewError("test-assert-image-matches: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("test-assert-image-matches: arg 2: expected string") + return env.NewError("test-assert-image-matches: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val image.Image switch v := arg2.(type) { case env.Native: - var ok bool - arg2Val, ok = v.Value.(image.Image) - if !ok { + if vc, ok := v.Value.(image.Image); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-assert-image-matches: arg 3: expected native of type image.Image") + return env.NewError("test-assert-image-matches: arg 3: " + "expected native of type image.Image, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("test-assert-image-matches: arg 3: expected native") + return env.NewError("test-assert-image-matches: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg3Val []any + var arg3Val []interface{} switch v := arg3.(type) { case env.Block: - arg3Val = make([]any, len(v.Series.S)) + arg3Val = make([]interface{}, len(v.Series.S)) for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg3Val[i], ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + arg3Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("test-assert-image-matches: arg 4: block item: expected native of type any") + return env.NewError("test-assert-image-matches: arg 4: " + "block item: " + "expected native of type interface{}, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("test-assert-image-matches: arg 4: block item: expected native") + return env.NewError("test-assert-image-matches: arg 4: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg3Val, ok = v.Value.([]any) - if !ok { - ps.FailureFlag = true - return env.NewError("test-assert-image-matches: arg 4: expected native of type []any") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-assert-image-matches: arg 4: expected integer to be 0 or nil") + return env.NewError("test-assert-image-matches: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("test-assert-image-matches: arg 4: expected block, native or nil") + return env.NewError("test-assert-image-matches: arg 4: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := test.AssertImageMatches(arg0Val, arg1Val, arg2Val, arg3Val...) var res0Obj env.Object @@ -163963,47 +159506,47 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *testing.T switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*testing.T) - if !ok { + if vc, ok := v.Value.(*testing.T); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-assert-notification-sent: arg 1: expected native of type *testing.T") + return env.NewError("test-assert-notification-sent: arg 1: " + "expected native of type *testing.T, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-assert-notification-sent: arg 1: expected integer to be 0 or nil") + return env.NewError("test-assert-notification-sent: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("test-assert-notification-sent: arg 1: expected native") + return env.NewError("test-assert-notification-sent: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val *fyne.Notification switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Notification) - if !ok { + if vc, ok := v.Value.(*fyne.Notification); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-assert-notification-sent: arg 2: expected native of type *fyne.Notification") + return env.NewError("test-assert-notification-sent: arg 2: " + "expected native of type *fyne.Notification, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-assert-notification-sent: arg 2: expected integer to be 0 or nil") + return env.NewError("test-assert-notification-sent: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("test-assert-notification-sent: arg 2: expected native") + return env.NewError("test-assert-notification-sent: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg2Val func() switch fn := arg2.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("test-assert-notification-sent: arg 3: function has invalid number of arguments (expected 0)") + return env.NewError("test-assert-notification-sent: arg 3: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } arg2Val = func() { actualFn := fn @@ -164013,12 +159556,12 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("test-assert-notification-sent: arg 3: expected integer to be 0 or nil") + return env.NewError("test-assert-notification-sent: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("test-assert-notification-sent: arg 3: expected function or nil") + return env.NewError("test-assert-notification-sent: arg 3: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } test.AssertNotificationSent(arg0Val, arg1Val, arg2Val) return nil @@ -164031,28 +159574,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *testing.T switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*testing.T) - if !ok { + if vc, ok := v.Value.(*testing.T); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-assert-object-renders-to-image: arg 1: expected native of type *testing.T") + return env.NewError("test-assert-object-renders-to-image: arg 1: " + "expected native of type *testing.T, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-assert-object-renders-to-image: arg 1: expected integer to be 0 or nil") + return env.NewError("test-assert-object-renders-to-image: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("test-assert-object-renders-to-image: arg 1: expected native") + return env.NewError("test-assert-object-renders-to-image: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("test-assert-object-renders-to-image: arg 2: expected string") + return env.NewError("test-assert-object-renders-to-image: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val fyne.CanvasObject switch v := arg2.(type) { @@ -164061,59 +159604,52 @@ var Builtins = map[string]*env.Builtin{ arg2Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("test-assert-object-renders-to-image: arg 3: " + err.Error() + "") + return env.NewError("test-assert-object-renders-to-image: arg 3: " + err.Error()) } case env.Native: - var ok bool - arg2Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-assert-object-renders-to-image: arg 3: expected native of type fyne.CanvasObject") + return env.NewError("test-assert-object-renders-to-image: arg 3: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-assert-object-renders-to-image: arg 3: expected integer to be 0 or nil") + return env.NewError("test-assert-object-renders-to-image: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("test-assert-object-renders-to-image: arg 3: expected native") + return env.NewError("test-assert-object-renders-to-image: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg3Val []any + var arg3Val []interface{} switch v := arg3.(type) { case env.Block: - arg3Val = make([]any, len(v.Series.S)) + arg3Val = make([]interface{}, len(v.Series.S)) for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg3Val[i], ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + arg3Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("test-assert-object-renders-to-image: arg 4: block item: expected native of type any") + return env.NewError("test-assert-object-renders-to-image: arg 4: " + "block item: " + "expected native of type interface{}, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("test-assert-object-renders-to-image: arg 4: block item: expected native") + return env.NewError("test-assert-object-renders-to-image: arg 4: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg3Val, ok = v.Value.([]any) - if !ok { - ps.FailureFlag = true - return env.NewError("test-assert-object-renders-to-image: arg 4: expected native of type []any") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-assert-object-renders-to-image: arg 4: expected integer to be 0 or nil") + return env.NewError("test-assert-object-renders-to-image: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("test-assert-object-renders-to-image: arg 4: expected block, native or nil") + return env.NewError("test-assert-object-renders-to-image: arg 4: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := test.AssertObjectRendersToImage(arg0Val, arg1Val, arg2Val, arg3Val...) var res0Obj env.Object @@ -164128,28 +159664,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *testing.T switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*testing.T) - if !ok { + if vc, ok := v.Value.(*testing.T); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-assert-object-renders-to-markup: arg 1: expected native of type *testing.T") + return env.NewError("test-assert-object-renders-to-markup: arg 1: " + "expected native of type *testing.T, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-assert-object-renders-to-markup: arg 1: expected integer to be 0 or nil") + return env.NewError("test-assert-object-renders-to-markup: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("test-assert-object-renders-to-markup: arg 1: expected native") + return env.NewError("test-assert-object-renders-to-markup: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("test-assert-object-renders-to-markup: arg 2: expected string") + return env.NewError("test-assert-object-renders-to-markup: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val fyne.CanvasObject switch v := arg2.(type) { @@ -164158,59 +159694,52 @@ var Builtins = map[string]*env.Builtin{ arg2Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("test-assert-object-renders-to-markup: arg 3: " + err.Error() + "") + return env.NewError("test-assert-object-renders-to-markup: arg 3: " + err.Error()) } case env.Native: - var ok bool - arg2Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-assert-object-renders-to-markup: arg 3: expected native of type fyne.CanvasObject") + return env.NewError("test-assert-object-renders-to-markup: arg 3: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-assert-object-renders-to-markup: arg 3: expected integer to be 0 or nil") + return env.NewError("test-assert-object-renders-to-markup: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("test-assert-object-renders-to-markup: arg 3: expected native") + return env.NewError("test-assert-object-renders-to-markup: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg3Val []any + var arg3Val []interface{} switch v := arg3.(type) { case env.Block: - arg3Val = make([]any, len(v.Series.S)) + arg3Val = make([]interface{}, len(v.Series.S)) for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg3Val[i], ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + arg3Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("test-assert-object-renders-to-markup: arg 4: block item: expected native of type any") + return env.NewError("test-assert-object-renders-to-markup: arg 4: " + "block item: " + "expected native of type interface{}, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("test-assert-object-renders-to-markup: arg 4: block item: expected native") + return env.NewError("test-assert-object-renders-to-markup: arg 4: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg3Val, ok = v.Value.([]any) - if !ok { - ps.FailureFlag = true - return env.NewError("test-assert-object-renders-to-markup: arg 4: expected native of type []any") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-assert-object-renders-to-markup: arg 4: expected integer to be 0 or nil") + return env.NewError("test-assert-object-renders-to-markup: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("test-assert-object-renders-to-markup: arg 4: expected block, native or nil") + return env.NewError("test-assert-object-renders-to-markup: arg 4: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := test.AssertObjectRendersToMarkup(arg0Val, arg1Val, arg2Val, arg3Val...) var res0Obj env.Object @@ -164225,28 +159754,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *testing.T switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*testing.T) - if !ok { + if vc, ok := v.Value.(*testing.T); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-assert-renders-to-image: arg 1: expected native of type *testing.T") + return env.NewError("test-assert-renders-to-image: arg 1: " + "expected native of type *testing.T, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-assert-renders-to-image: arg 1: expected integer to be 0 or nil") + return env.NewError("test-assert-renders-to-image: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("test-assert-renders-to-image: arg 1: expected native") + return env.NewError("test-assert-renders-to-image: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("test-assert-renders-to-image: arg 2: expected string") + return env.NewError("test-assert-renders-to-image: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val fyne.Canvas switch v := arg2.(type) { @@ -164255,59 +159784,52 @@ var Builtins = map[string]*env.Builtin{ arg2Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("test-assert-renders-to-image: arg 3: " + err.Error() + "") + return env.NewError("test-assert-renders-to-image: arg 3: " + err.Error()) } case env.Native: - var ok bool - arg2Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-assert-renders-to-image: arg 3: expected native of type fyne.Canvas") + return env.NewError("test-assert-renders-to-image: arg 3: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-assert-renders-to-image: arg 3: expected integer to be 0 or nil") + return env.NewError("test-assert-renders-to-image: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("test-assert-renders-to-image: arg 3: expected native") + return env.NewError("test-assert-renders-to-image: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg3Val []any + var arg3Val []interface{} switch v := arg3.(type) { case env.Block: - arg3Val = make([]any, len(v.Series.S)) + arg3Val = make([]interface{}, len(v.Series.S)) for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg3Val[i], ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + arg3Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("test-assert-renders-to-image: arg 4: block item: expected native of type any") + return env.NewError("test-assert-renders-to-image: arg 4: " + "block item: " + "expected native of type interface{}, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("test-assert-renders-to-image: arg 4: block item: expected native") + return env.NewError("test-assert-renders-to-image: arg 4: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg3Val, ok = v.Value.([]any) - if !ok { - ps.FailureFlag = true - return env.NewError("test-assert-renders-to-image: arg 4: expected native of type []any") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-assert-renders-to-image: arg 4: expected integer to be 0 or nil") + return env.NewError("test-assert-renders-to-image: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("test-assert-renders-to-image: arg 4: expected block, native or nil") + return env.NewError("test-assert-renders-to-image: arg 4: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := test.AssertRendersToImage(arg0Val, arg1Val, arg2Val, arg3Val...) var res0Obj env.Object @@ -164322,28 +159844,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *testing.T switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*testing.T) - if !ok { + if vc, ok := v.Value.(*testing.T); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-assert-renders-to-markup: arg 1: expected native of type *testing.T") + return env.NewError("test-assert-renders-to-markup: arg 1: " + "expected native of type *testing.T, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-assert-renders-to-markup: arg 1: expected integer to be 0 or nil") + return env.NewError("test-assert-renders-to-markup: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("test-assert-renders-to-markup: arg 1: expected native") + return env.NewError("test-assert-renders-to-markup: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("test-assert-renders-to-markup: arg 2: expected string") + return env.NewError("test-assert-renders-to-markup: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val fyne.Canvas switch v := arg2.(type) { @@ -164352,59 +159874,52 @@ var Builtins = map[string]*env.Builtin{ arg2Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("test-assert-renders-to-markup: arg 3: " + err.Error() + "") + return env.NewError("test-assert-renders-to-markup: arg 3: " + err.Error()) } case env.Native: - var ok bool - arg2Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-assert-renders-to-markup: arg 3: expected native of type fyne.Canvas") + return env.NewError("test-assert-renders-to-markup: arg 3: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-assert-renders-to-markup: arg 3: expected integer to be 0 or nil") + return env.NewError("test-assert-renders-to-markup: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("test-assert-renders-to-markup: arg 3: expected native") + return env.NewError("test-assert-renders-to-markup: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg3Val []any + var arg3Val []interface{} switch v := arg3.(type) { case env.Block: - arg3Val = make([]any, len(v.Series.S)) + arg3Val = make([]interface{}, len(v.Series.S)) for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg3Val[i], ok = v.Value.(any) - if !ok { + if vc, ok := v.Value.(interface{}); ok { + arg3Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("test-assert-renders-to-markup: arg 4: block item: expected native of type any") + return env.NewError("test-assert-renders-to-markup: arg 4: " + "block item: " + "expected native of type interface{}, but got " + objectDebugString(ps.Idx, v)) } default: ps.FailureFlag = true - return env.NewError("test-assert-renders-to-markup: arg 4: block item: expected native") + return env.NewError("test-assert-renders-to-markup: arg 4: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg3Val, ok = v.Value.([]any) - if !ok { - ps.FailureFlag = true - return env.NewError("test-assert-renders-to-markup: arg 4: expected native of type []any") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-assert-renders-to-markup: arg 4: expected integer to be 0 or nil") + return env.NewError("test-assert-renders-to-markup: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("test-assert-renders-to-markup: arg 4: expected block, native or nil") + return env.NewError("test-assert-renders-to-markup: arg 4: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := test.AssertRendersToMarkup(arg0Val, arg1Val, arg2Val, arg3Val...) var res0Obj env.Object @@ -164418,24 +159933,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := test.Canvas() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Canvas)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Canvas)") return res0Obj }, }, @@ -164450,24 +159948,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_DoubleTappable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("test-double-tap: arg 1: " + err.Error() + "") + return env.NewError("test-double-tap: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.DoubleTappable) - if !ok { + if vc, ok := v.Value.(fyne.DoubleTappable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-double-tap: arg 1: expected native of type fyne.DoubleTappable") + return env.NewError("test-double-tap: arg 1: " + "expected native of type fyne.DoubleTappable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-double-tap: arg 1: expected integer to be 0 or nil") + return env.NewError("test-double-tap: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("test-double-tap: arg 1: expected native") + return env.NewError("test-double-tap: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } test.DoubleTap(arg0Val) return nil @@ -164484,59 +159982,53 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("test-drag: arg 1: " + err.Error() + "") + return env.NewError("test-drag: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-drag: arg 1: expected native of type fyne.Canvas") + return env.NewError("test-drag: arg 1: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-drag: arg 1: expected integer to be 0 or nil") + return env.NewError("test-drag: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("test-drag: arg 1: expected native") + return env.NewError("test-drag: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("test-drag: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("test-drag: arg 2: expected integer to be 0 or nil") + return env.NewError("test-drag: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("test-drag: arg 2: expected native") + return env.NewError("test-drag: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg2Val float32 - if v, ok := arg2.(env.Decimal); ok { - arg2Val = float32(v.Value) + if vc, ok := arg2.(env.Decimal); ok { + arg2Val = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("test-drag: arg 3: expected decimal") + return env.NewError("test-drag: arg 3: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val float32 - if v, ok := arg3.(env.Decimal); ok { - arg3Val = float32(v.Value) + if vc, ok := arg3.(env.Decimal); ok { + arg3Val = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("test-drag: arg 4: expected decimal") + return env.NewError("test-drag: arg 4: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg3)) } - test.Drag(arg0Val, *arg1Val, arg2Val, arg3Val) + test.Drag(arg0Val, arg1Val, arg2Val, arg3Val) return nil }, }, @@ -164551,24 +160043,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("test-focus-next: arg 1: " + err.Error() + "") + return env.NewError("test-focus-next: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-focus-next: arg 1: expected native of type fyne.Canvas") + return env.NewError("test-focus-next: arg 1: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-focus-next: arg 1: expected integer to be 0 or nil") + return env.NewError("test-focus-next: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("test-focus-next: arg 1: expected native") + return env.NewError("test-focus-next: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } test.FocusNext(arg0Val) return nil @@ -164585,24 +160077,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("test-focus-previous: arg 1: " + err.Error() + "") + return env.NewError("test-focus-previous: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-focus-previous: arg 1: expected native of type fyne.Canvas") + return env.NewError("test-focus-previous: arg 1: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-focus-previous: arg 1: expected integer to be 0 or nil") + return env.NewError("test-focus-previous: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("test-focus-previous: arg 1: expected native") + return env.NewError("test-focus-previous: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } test.FocusPrevious(arg0Val) return nil @@ -164619,48 +160111,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("test-laid-out-objects: arg 1: " + err.Error() + "") + return env.NewError("test-laid-out-objects: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-laid-out-objects: arg 1: expected native of type fyne.CanvasObject") + return env.NewError("test-laid-out-objects: arg 1: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-laid-out-objects: arg 1: expected integer to be 0 or nil") + return env.NewError("test-laid-out-objects: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("test-laid-out-objects: arg 1: expected native") + return env.NewError("test-laid-out-objects: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := test.LaidOutObjects(arg0Val) var res0Obj env.Object { items := make([]env.Object, len(res0)) for i, it := range res0 { - { - typ := reflect.TypeOf(it) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - items[i] = *env.NewNative(ps.Idx, it, typRyeName) - } else { - items[i] = *env.NewNative(ps.Idx, it, "Go(fyne.CanvasObject)") - } - } + items[i] = ifaceToNative(ps.Idx, it, "Go(fyne.CanvasObject)") } res0Obj = *env.NewBlock(*env.NewTSeries(items)) } @@ -164678,45 +160153,39 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("test-move-mouse: arg 1: " + err.Error() + "") + return env.NewError("test-move-mouse: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-move-mouse: arg 1: expected native of type fyne.Canvas") + return env.NewError("test-move-mouse: arg 1: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-move-mouse: arg 1: expected integer to be 0 or nil") + return env.NewError("test-move-mouse: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("test-move-mouse: arg 1: expected native") + return env.NewError("test-move-mouse: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("test-move-mouse: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("test-move-mouse: arg 2: expected integer to be 0 or nil") + return env.NewError("test-move-mouse: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("test-move-mouse: arg 2: expected native") + return env.NewError("test-move-mouse: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - test.MoveMouse(arg0Val, *arg1Val) + test.MoveMouse(arg0Val, arg1Val) return nil }, }, @@ -164726,24 +160195,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := test.NewApp() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.App)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.App)") return res0Obj }, }, @@ -164753,24 +160205,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := test.NewCanvas() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(test.WindowlessCanvas)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(test.WindowlessCanvas)") return res0Obj }, }, @@ -164785,45 +160220,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_test_SoftwarePainter(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("test-canvas-with-painter: arg 1: " + err.Error() + "") + return env.NewError("test-canvas-with-painter: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(test.SoftwarePainter) - if !ok { + if vc, ok := v.Value.(test.SoftwarePainter); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-canvas-with-painter: arg 1: expected native of type test.SoftwarePainter") + return env.NewError("test-canvas-with-painter: arg 1: " + "expected native of type test.SoftwarePainter, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-canvas-with-painter: arg 1: expected integer to be 0 or nil") + return env.NewError("test-canvas-with-painter: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("test-canvas-with-painter: arg 1: expected native") + return env.NewError("test-canvas-with-painter: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := test.NewCanvasWithPainter(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(test.WindowlessCanvas)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(test.WindowlessCanvas)") return res0Obj }, }, @@ -164833,24 +160251,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := test.NewClipboard() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Clipboard)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Clipboard)") return res0Obj }, }, @@ -164860,24 +160261,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := test.NewDriver() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Driver)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Driver)") return res0Obj }, }, @@ -164892,45 +160276,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_test_SoftwarePainter(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("test-driver-with-painter: arg 1: " + err.Error() + "") + return env.NewError("test-driver-with-painter: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(test.SoftwarePainter) - if !ok { + if vc, ok := v.Value.(test.SoftwarePainter); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-driver-with-painter: arg 1: expected native of type test.SoftwarePainter") + return env.NewError("test-driver-with-painter: arg 1: " + "expected native of type test.SoftwarePainter, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-driver-with-painter: arg 1: expected integer to be 0 or nil") + return env.NewError("test-driver-with-painter: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("test-driver-with-painter: arg 1: expected native") + return env.NewError("test-driver-with-painter: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := test.NewDriverWithPainter(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Driver)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Driver)") return res0Obj }, }, @@ -164940,24 +160307,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := test.NewTheme() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Theme)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Theme)") return res0Obj }, }, @@ -164972,45 +160322,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_test_SoftwarePainter(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("test-transparent-canvas-with-painter: arg 1: " + err.Error() + "") + return env.NewError("test-transparent-canvas-with-painter: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(test.SoftwarePainter) - if !ok { + if vc, ok := v.Value.(test.SoftwarePainter); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-transparent-canvas-with-painter: arg 1: expected native of type test.SoftwarePainter") + return env.NewError("test-transparent-canvas-with-painter: arg 1: " + "expected native of type test.SoftwarePainter, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-transparent-canvas-with-painter: arg 1: expected integer to be 0 or nil") + return env.NewError("test-transparent-canvas-with-painter: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("test-transparent-canvas-with-painter: arg 1: expected native") + return env.NewError("test-transparent-canvas-with-painter: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := test.NewTransparentCanvasWithPainter(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(test.WindowlessCanvas)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(test.WindowlessCanvas)") return res0Obj }, }, @@ -165025,45 +160358,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("test-window: arg 1: " + err.Error() + "") + return env.NewError("test-window: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-window: arg 1: expected native of type fyne.CanvasObject") + return env.NewError("test-window: arg 1: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-window: arg 1: expected integer to be 0 or nil") + return env.NewError("test-window: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("test-window: arg 1: expected native") + return env.NewError("test-window: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := test.NewWindow(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Window)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Window)") return res0Obj }, }, @@ -165078,59 +160394,53 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("test-scroll: arg 1: " + err.Error() + "") + return env.NewError("test-scroll: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-scroll: arg 1: expected native of type fyne.Canvas") + return env.NewError("test-scroll: arg 1: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-scroll: arg 1: expected integer to be 0 or nil") + return env.NewError("test-scroll: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("test-scroll: arg 1: expected native") + return env.NewError("test-scroll: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("test-scroll: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("test-scroll: arg 2: expected integer to be 0 or nil") + return env.NewError("test-scroll: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("test-scroll: arg 2: expected native") + return env.NewError("test-scroll: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg2Val float32 - if v, ok := arg2.(env.Decimal); ok { - arg2Val = float32(v.Value) + if vc, ok := arg2.(env.Decimal); ok { + arg2Val = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("test-scroll: arg 3: expected decimal") + return env.NewError("test-scroll: arg 3: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg2)) } var arg3Val float32 - if v, ok := arg3.(env.Decimal); ok { - arg3Val = float32(v.Value) + if vc, ok := arg3.(env.Decimal); ok { + arg3Val = float32(vc.Value) } else { ps.FailureFlag = true - return env.NewError("test-scroll: arg 4: expected decimal") + return env.NewError("test-scroll: arg 4: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg3)) } - test.Scroll(arg0Val, *arg1Val, arg2Val, arg3Val) + test.Scroll(arg0Val, arg1Val, arg2Val, arg3Val) return nil }, }, @@ -165145,24 +160455,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Tappable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("test-tap: arg 1: " + err.Error() + "") + return env.NewError("test-tap: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Tappable) - if !ok { + if vc, ok := v.Value.(fyne.Tappable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-tap: arg 1: expected native of type fyne.Tappable") + return env.NewError("test-tap: arg 1: " + "expected native of type fyne.Tappable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-tap: arg 1: expected integer to be 0 or nil") + return env.NewError("test-tap: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("test-tap: arg 1: expected native") + return env.NewError("test-tap: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } test.Tap(arg0Val) return nil @@ -165179,45 +160489,39 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Tappable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("test-tap-at: arg 1: " + err.Error() + "") + return env.NewError("test-tap-at: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Tappable) - if !ok { + if vc, ok := v.Value.(fyne.Tappable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-tap-at: arg 1: expected native of type fyne.Tappable") + return env.NewError("test-tap-at: arg 1: " + "expected native of type fyne.Tappable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-tap-at: arg 1: expected integer to be 0 or nil") + return env.NewError("test-tap-at: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("test-tap-at: arg 1: expected native") + return env.NewError("test-tap-at: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("test-tap-at: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("test-tap-at: arg 2: expected integer to be 0 or nil") + return env.NewError("test-tap-at: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("test-tap-at: arg 2: expected native") + return env.NewError("test-tap-at: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - test.TapAt(arg0Val, *arg1Val) + test.TapAt(arg0Val, arg1Val) return nil }, }, @@ -165232,45 +160536,39 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("test-tap-canvas: arg 1: " + err.Error() + "") + return env.NewError("test-tap-canvas: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-tap-canvas: arg 1: expected native of type fyne.Canvas") + return env.NewError("test-tap-canvas: arg 1: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-tap-canvas: arg 1: expected integer to be 0 or nil") + return env.NewError("test-tap-canvas: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("test-tap-canvas: arg 1: expected native") + return env.NewError("test-tap-canvas: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("test-tap-canvas: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("test-tap-canvas: arg 2: expected integer to be 0 or nil") + return env.NewError("test-tap-canvas: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("test-tap-canvas: arg 2: expected native") + return env.NewError("test-tap-canvas: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - test.TapCanvas(arg0Val, *arg1Val) + test.TapCanvas(arg0Val, arg1Val) return nil }, }, @@ -165285,24 +160583,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_SecondaryTappable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("test-tap-secondary: arg 1: " + err.Error() + "") + return env.NewError("test-tap-secondary: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.SecondaryTappable) - if !ok { + if vc, ok := v.Value.(fyne.SecondaryTappable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-tap-secondary: arg 1: expected native of type fyne.SecondaryTappable") + return env.NewError("test-tap-secondary: arg 1: " + "expected native of type fyne.SecondaryTappable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-tap-secondary: arg 1: expected integer to be 0 or nil") + return env.NewError("test-tap-secondary: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("test-tap-secondary: arg 1: expected native") + return env.NewError("test-tap-secondary: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } test.TapSecondary(arg0Val) return nil @@ -165319,45 +160617,39 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_SecondaryTappable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("test-tap-secondary-at: arg 1: " + err.Error() + "") + return env.NewError("test-tap-secondary-at: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.SecondaryTappable) - if !ok { + if vc, ok := v.Value.(fyne.SecondaryTappable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-tap-secondary-at: arg 1: expected native of type fyne.SecondaryTappable") + return env.NewError("test-tap-secondary-at: arg 1: " + "expected native of type fyne.SecondaryTappable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-tap-secondary-at: arg 1: expected integer to be 0 or nil") + return env.NewError("test-tap-secondary-at: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("test-tap-secondary-at: arg 1: expected native") + return env.NewError("test-tap-secondary-at: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg1Val *fyne.Position + var arg1Val fyne.Position switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("test-tap-secondary-at: arg 2: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg1Val = *vc + } else { ps.FailureFlag = true - return env.NewError("test-tap-secondary-at: arg 2: expected integer to be 0 or nil") + return env.NewError("test-tap-secondary-at: arg 2: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg1Val = nil default: ps.FailureFlag = true - return env.NewError("test-tap-secondary-at: arg 2: expected native") + return env.NewError("test-tap-secondary-at: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - test.TapSecondaryAt(arg0Val, *arg1Val) + test.TapSecondaryAt(arg0Val, arg1Val) return nil }, }, @@ -165367,24 +160659,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := test.Theme() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Theme)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Theme)") return res0Obj }, }, @@ -165399,31 +160674,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Focusable(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("test-type: arg 1: " + err.Error() + "") + return env.NewError("test-type: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Focusable) - if !ok { + if vc, ok := v.Value.(fyne.Focusable); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-type: arg 1: expected native of type fyne.Focusable") + return env.NewError("test-type: arg 1: " + "expected native of type fyne.Focusable, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-type: arg 1: expected integer to be 0 or nil") + return env.NewError("test-type: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("test-type: arg 1: expected native") + return env.NewError("test-type: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("test-type: arg 2: expected string") + return env.NewError("test-type: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } test.Type(arg0Val, arg1Val) return nil @@ -165440,31 +160715,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("test-type-on-canvas: arg 1: " + err.Error() + "") + return env.NewError("test-type-on-canvas: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-type-on-canvas: arg 1: expected native of type fyne.Canvas") + return env.NewError("test-type-on-canvas: arg 1: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-type-on-canvas: arg 1: expected integer to be 0 or nil") + return env.NewError("test-type-on-canvas: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("test-type-on-canvas: arg 1: expected native") + return env.NewError("test-type-on-canvas: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("test-type-on-canvas: arg 2: expected string") + return env.NewError("test-type-on-canvas: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } test.TypeOnCanvas(arg0Val, arg1Val) return nil @@ -165481,45 +160756,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Widget(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("test-widget-renderer: arg 1: " + err.Error() + "") + return env.NewError("test-widget-renderer: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Widget) - if !ok { + if vc, ok := v.Value.(fyne.Widget); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-widget-renderer: arg 1: expected native of type fyne.Widget") + return env.NewError("test-widget-renderer: arg 1: " + "expected native of type fyne.Widget, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-widget-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("test-widget-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("test-widget-renderer: arg 1: expected native") + return env.NewError("test-widget-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := test.WidgetRenderer(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -165530,28 +160788,28 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *testing.T switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*testing.T) - if !ok { + if vc, ok := v.Value.(*testing.T); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("test-with-test-theme: arg 1: expected native of type *testing.T") + return env.NewError("test-with-test-theme: arg 1: " + "expected native of type *testing.T, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("test-with-test-theme: arg 1: expected integer to be 0 or nil") + return env.NewError("test-with-test-theme: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("test-with-test-theme: arg 1: expected native") + return env.NewError("test-with-test-theme: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func() switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("test-with-test-theme: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("test-with-test-theme: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } arg1Val = func() { actualFn := fn @@ -165561,12 +160819,12 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("test-with-test-theme: arg 2: expected integer to be 0 or nil") + return env.NewError("test-with-test-theme: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("test-with-test-theme: arg 2: expected function or nil") + return env.NewError("test-with-test-theme: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } test.WithTestTheme(arg0Val, arg1Val) return nil @@ -165578,24 +160836,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.AccountIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -165615,24 +160856,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.BrokenImageIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -165652,24 +160876,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.CancelIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -165689,24 +160896,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.CheckButtonCheckedIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -165716,24 +160906,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.CheckButtonIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -165743,24 +160916,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.ColorAchromaticIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -165770,24 +160926,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.ColorChromaticIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166004,24 +161143,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.ColorPaletteIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166031,24 +161153,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.ComputerIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166058,24 +161163,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.ConfirmIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166085,24 +161173,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.ContentAddIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166112,24 +161183,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.ContentClearIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166139,24 +161193,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.ContentCopyIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166166,24 +161203,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.ContentCutIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166193,24 +161213,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.ContentPasteIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166220,24 +161223,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.ContentRedoIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166247,24 +161233,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.ContentRemoveIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166274,24 +161243,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.ContentUndoIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166301,24 +161253,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.DarkTheme() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Theme)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Theme)") return res0Obj }, }, @@ -166328,24 +161263,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.DefaultEmojiFont() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166355,24 +161273,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.DefaultSymbolFont() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166382,24 +161283,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.DefaultTextBoldFont() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166409,24 +161293,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.DefaultTextBoldItalicFont() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166436,24 +161303,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.DefaultTextFont() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166463,24 +161313,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.DefaultTextItalicFont() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166490,24 +161323,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.DefaultTextMonospaceFont() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166517,24 +161333,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.DefaultTheme() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Theme)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Theme)") return res0Obj }, }, @@ -166544,24 +161343,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.DeleteIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166601,24 +161383,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.DocumentCreateIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166628,24 +161393,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.DocumentIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166655,24 +161403,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.DocumentPrintIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166682,24 +161413,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.DocumentSaveIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166709,24 +161423,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.DownloadIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166746,24 +161443,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.ErrorIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166773,24 +161453,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.FileApplicationIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166800,24 +161463,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.FileAudioIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166827,24 +161473,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.FileIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166854,24 +161483,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.FileImageIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166881,24 +161493,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.FileTextIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166908,24 +161503,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.FileVideoIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166945,24 +161523,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.FolderIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166972,24 +161533,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.FolderNewIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -166999,24 +161543,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.FolderOpenIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -167035,32 +161562,15 @@ var Builtins = map[string]*env.Builtin{ Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("from-json: arg 1: expected string") + return env.NewError("from-json: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } res0, resErr := theme.FromJSON(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Theme)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Theme)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -167083,45 +161593,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_io_Reader(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("from-json-reader: arg 1: " + err.Error() + "") + return env.NewError("from-json-reader: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(io.Reader) - if !ok { + if vc, ok := v.Value.(io.Reader); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("from-json-reader: arg 1: expected native of type io.Reader") + return env.NewError("from-json-reader: arg 1: " + "expected native of type io.Reader, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("from-json-reader: arg 1: expected integer to be 0 or nil") + return env.NewError("from-json-reader: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("from-json-reader: arg 1: expected native") + return env.NewError("from-json-reader: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0, resErr := theme.FromJSONReader(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Theme)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Theme)") var resErrObj env.Object if resErr != nil { resErrObj = env.NewError(resErr.Error()) @@ -167144,45 +161637,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_LegacyTheme(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("from-legacy: arg 1: " + err.Error() + "") + return env.NewError("from-legacy: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.LegacyTheme) - if !ok { + if vc, ok := v.Value.(fyne.LegacyTheme); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("from-legacy: arg 1: expected native of type fyne.LegacyTheme") + return env.NewError("from-legacy: arg 1: " + "expected native of type fyne.LegacyTheme, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("from-legacy: arg 1: expected integer to be 0 or nil") + return env.NewError("from-legacy: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("from-legacy: arg 1: expected native") + return env.NewError("from-legacy: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := theme.FromLegacy(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Theme)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Theme)") return res0Obj }, }, @@ -167192,24 +161668,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.FyneLogo() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -167219,24 +161678,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.GridIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -167256,24 +161698,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.HelpIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -167283,24 +161708,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.HistoryIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -167310,24 +161718,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.HomeIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -168177,24 +162568,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.InfoIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -168254,24 +162628,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.LightTheme() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Theme)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Theme)") return res0Obj }, }, @@ -168291,24 +162648,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.ListIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -168318,24 +162658,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.LoginIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -168345,24 +162668,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.LogoutIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -168372,24 +162678,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.MailAttachmentIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -168399,24 +162688,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.MailComposeIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -168426,24 +162698,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.MailForwardIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -168453,24 +162708,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.MailReplyAllIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -168480,24 +162718,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.MailReplyIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -168507,24 +162728,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.MailSendIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -168534,24 +162738,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.MediaFastForwardIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -168561,24 +162748,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.MediaFastRewindIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -168588,24 +162758,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.MediaMusicIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -168615,24 +162768,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.MediaPauseIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -168642,24 +162778,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.MediaPhotoIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -168669,24 +162788,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.MediaPlayIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -168696,24 +162798,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.MediaRecordIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -168723,24 +162808,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.MediaReplayIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -168750,24 +162818,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.MediaSkipNextIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -168777,24 +162828,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.MediaSkipPreviousIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -168804,24 +162838,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.MediaStopIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -168831,24 +162848,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.MediaVideoIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -168868,24 +162868,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.MenuDropDownIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -168895,24 +162878,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.MenuDropUpIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -168922,24 +162888,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.MenuExpandIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -168949,24 +162898,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.MenuIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -168976,24 +162908,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.MoreHorizontalIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -169003,24 +162918,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.MoreVerticalIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -169030,24 +162928,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.MoveDownIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -169057,24 +162938,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.MoveUpIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -169084,24 +162948,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.NavigateBackIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -169111,24 +162958,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.NavigateNextIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -169143,24 +162973,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Resource(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("colored-resource: arg 1: " + err.Error() + "") + return env.NewError("colored-resource: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("colored-resource: arg 1: expected native of type fyne.Resource") + return env.NewError("colored-resource: arg 1: " + "expected native of type fyne.Resource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("colored-resource: arg 1: expected integer to be 0 or nil") + return env.NewError("colored-resource: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("colored-resource: arg 1: expected native") + return env.NewError("colored-resource: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.ThemeColorName { @@ -169174,11 +163004,11 @@ var Builtins = map[string]*env.Builtin{ arg1Val = natVal } else { var u string - if v, ok := arg1.(env.String); ok { - u = string(v.Value) + if vc, ok := arg1.(env.String); ok { + u = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("colored-resource: arg 2: expected string") + return env.NewError("colored-resource: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } arg1Val = fyne.ThemeColorName(u) } @@ -169200,24 +163030,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Resource(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("disabled-resource: arg 1: " + err.Error() + "") + return env.NewError("disabled-resource: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("disabled-resource: arg 1: expected native of type fyne.Resource") + return env.NewError("disabled-resource: arg 1: " + "expected native of type fyne.Resource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("disabled-resource: arg 1: expected integer to be 0 or nil") + return env.NewError("disabled-resource: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("disabled-resource: arg 1: expected native") + return env.NewError("disabled-resource: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := theme.NewDisabledResource(arg0Val) var res0Obj env.Object @@ -169236,24 +163066,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Resource(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("error-themed-resource: arg 1: " + err.Error() + "") + return env.NewError("error-themed-resource: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("error-themed-resource: arg 1: expected native of type fyne.Resource") + return env.NewError("error-themed-resource: arg 1: " + "expected native of type fyne.Resource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("error-themed-resource: arg 1: expected integer to be 0 or nil") + return env.NewError("error-themed-resource: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("error-themed-resource: arg 1: expected native") + return env.NewError("error-themed-resource: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := theme.NewErrorThemedResource(arg0Val) var res0Obj env.Object @@ -169272,24 +163102,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Resource(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("inverted-themed-resource: arg 1: " + err.Error() + "") + return env.NewError("inverted-themed-resource: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("inverted-themed-resource: arg 1: expected native of type fyne.Resource") + return env.NewError("inverted-themed-resource: arg 1: " + "expected native of type fyne.Resource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("inverted-themed-resource: arg 1: expected integer to be 0 or nil") + return env.NewError("inverted-themed-resource: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("inverted-themed-resource: arg 1: expected native") + return env.NewError("inverted-themed-resource: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := theme.NewInvertedThemedResource(arg0Val) var res0Obj env.Object @@ -169308,24 +163138,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Resource(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("primary-themed-resource: arg 1: " + err.Error() + "") + return env.NewError("primary-themed-resource: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("primary-themed-resource: arg 1: expected native of type fyne.Resource") + return env.NewError("primary-themed-resource: arg 1: " + "expected native of type fyne.Resource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("primary-themed-resource: arg 1: expected integer to be 0 or nil") + return env.NewError("primary-themed-resource: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("primary-themed-resource: arg 1: expected native") + return env.NewError("primary-themed-resource: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := theme.NewPrimaryThemedResource(arg0Val) var res0Obj env.Object @@ -169344,24 +163174,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Resource(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("success-themed-resource: arg 1: " + err.Error() + "") + return env.NewError("success-themed-resource: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("success-themed-resource: arg 1: expected native of type fyne.Resource") + return env.NewError("success-themed-resource: arg 1: " + "expected native of type fyne.Resource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("success-themed-resource: arg 1: expected integer to be 0 or nil") + return env.NewError("success-themed-resource: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("success-themed-resource: arg 1: expected native") + return env.NewError("success-themed-resource: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := theme.NewSuccessThemedResource(arg0Val) var res0Obj env.Object @@ -169380,24 +163210,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Resource(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("themed-resource: arg 1: " + err.Error() + "") + return env.NewError("themed-resource: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("themed-resource: arg 1: expected native of type fyne.Resource") + return env.NewError("themed-resource: arg 1: " + "expected native of type fyne.Resource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("themed-resource: arg 1: expected integer to be 0 or nil") + return env.NewError("themed-resource: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("themed-resource: arg 1: expected native") + return env.NewError("themed-resource: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := theme.NewThemedResource(arg0Val) var res0Obj env.Object @@ -169416,24 +163246,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Resource(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("warning-themed-resource: arg 1: " + err.Error() + "") + return env.NewError("warning-themed-resource: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("warning-themed-resource: arg 1: expected native of type fyne.Resource") + return env.NewError("warning-themed-resource: arg 1: " + "expected native of type fyne.Resource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("warning-themed-resource: arg 1: expected integer to be 0 or nil") + return env.NewError("warning-themed-resource: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("warning-themed-resource: arg 1: expected native") + return env.NewError("warning-themed-resource: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := theme.NewWarningThemedResource(arg0Val) var res0Obj env.Object @@ -169496,11 +163326,11 @@ var Builtins = map[string]*env.Builtin{ Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("primary-color-named: arg 1: expected string") + return env.NewError("primary-color-named: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } res0 := theme.PrimaryColorNamed(arg0Val) var res0Obj env.Object @@ -169530,24 +163360,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.QuestionIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -169557,24 +163370,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.RadioButtonCheckedIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -169584,24 +163380,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.RadioButtonIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -169641,24 +163420,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.SearchIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -169668,24 +163430,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.SearchReplaceIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -169735,24 +163480,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.SettingsIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -169898,24 +163626,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.StorageIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -169935,24 +163646,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.SymbolFont() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -169962,24 +163656,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.TextBoldFont() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -169989,24 +163666,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.TextBoldItalicFont() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -170026,24 +163686,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.TextFont() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -170063,24 +163706,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.TextItalicFont() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -170090,24 +163716,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.TextMonospaceFont() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -170137,24 +163746,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.UploadIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -170182,24 +163774,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.ViewFullScreenIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -170209,24 +163784,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.ViewRefreshIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -170236,24 +163794,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.ViewRestoreIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -170263,24 +163804,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.VisibilityIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -170290,24 +163814,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.VisibilityOffIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -170317,24 +163824,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.VolumeDownIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -170344,24 +163834,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.VolumeMuteIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -170371,24 +163844,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.VolumeUpIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -170408,24 +163864,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.WarningIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -170435,24 +163874,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.ZoomFitIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -170462,24 +163884,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.ZoomInIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -170489,24 +163894,7 @@ var Builtins = map[string]*env.Builtin{ Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { res0 := theme.ZoomOutIcon() var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.Resource)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.Resource)") return res0Obj }, }, @@ -170534,14 +163922,14 @@ var Builtins = map[string]*env.Builtin{ case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("validation-all-strings: arg 1: block item: function has invalid number of arguments (expected 1)") + return env.NewError("validation-all-strings: arg 1: " + "block item: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - u = func(arg0 string) error { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + u = func(farg0 string) error { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) var res error switch v := ps.Res.(type) { case env.String: @@ -170550,8 +163938,9 @@ var Builtins = map[string]*env.Builtin{ res = errors.New(v.Print(*ps.Idx)) case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "validation-all-strings: arg 1: callback result: expected integer to be 0 or nil", + "validation-all-strings: arg 1: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -170559,8 +163948,9 @@ var Builtins = map[string]*env.Builtin{ } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "validation-all-strings: arg 1: callback result: expected error, string or nil", + "validation-all-strings: arg 1: callback result: "+"expected error, string or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -170571,37 +163961,48 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("validation-all-strings: arg 1: block item: expected integer to be 0 or nil") + return env.NewError("validation-all-strings: arg 1: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } u = nil default: ps.FailureFlag = true - return env.NewError("validation-all-strings: arg 1: block item: expected function or nil") + return env.NewError("validation-all-strings: arg 1: " + "block item: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } arg0Val[i] = fyne.StringValidator(u) } } } - case env.Native: - var ok bool - arg0Val, ok = v.Value.([]fyne.StringValidator) - if !ok { - ps.FailureFlag = true - return env.NewError("validation-all-strings: arg 1: expected native of type []fyne.StringValidator") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("validation-all-strings: arg 1: expected integer to be 0 or nil") + return env.NewError("validation-all-strings: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("validation-all-strings: arg 1: expected block, native or nil") + return env.NewError("validation-all-strings: arg 1: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := validation.NewAllStrings(arg0Val...) var res0Obj env.Object - res0Obj = *env.NewNative(ps.Idx, (func(string) error)(res0), "Go(func(string) (error))") + res0Obj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val string + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("validation-all-strings: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) + } + resErr := (func(string) error)(res0)(arg0Val) + var resErrObj env.Object + if resErr != nil { + resErrObj = env.NewError(resErr.Error()) + } + if resErrObj != nil { + ps.FailureFlag = true + return resErrObj + } + return nil + }, 1, false, false, "Returned func") return res0Obj }, }, @@ -170610,22 +164011,40 @@ var Builtins = map[string]*env.Builtin{ Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("validation-regexp: arg 1: expected string") + return env.NewError("validation-regexp: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("validation-regexp: arg 2: expected string") + return env.NewError("validation-regexp: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } res0 := validation.NewRegexp(arg0Val, arg1Val) var res0Obj env.Object - res0Obj = *env.NewNative(ps.Idx, (func(string) error)(res0), "Go(func(string) (error))") + res0Obj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val string + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("validation-regexp: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) + } + resErr := (func(string) error)(res0)(arg0Val) + var resErrObj env.Object + if resErr != nil { + resErrObj = env.NewError(resErr.Error()) + } + if resErrObj != nil { + ps.FailureFlag = true + return resErrObj + } + return nil + }, 1, false, false, "Returned func") return res0Obj }, }, @@ -170634,15 +164053,33 @@ var Builtins = map[string]*env.Builtin{ Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("validation-time: arg 1: expected string") + return env.NewError("validation-time: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } res0 := validation.NewTime(arg0Val) var res0Obj env.Object - res0Obj = *env.NewNative(ps.Idx, (func(string) error)(res0), "Go(func(string) (error))") + res0Obj = *env.NewBuiltin(func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val string + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) + } else { + ps.FailureFlag = true + return env.NewError("validation-time: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) + } + resErr := (func(string) error)(res0)(arg0Val) + var resErrObj env.Object + if resErr != nil { + resErrObj = env.NewError(resErr.Error()) + } + if resErrObj != nil { + ps.FailureFlag = true + return resErrObj + } + return nil + }, 1, false, false, "Returned func") return res0Obj }, }, @@ -170747,39 +164184,32 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg0Val[i], ok = v.Value.(*widget.AccordionItem) - if !ok { + if vc, ok := v.Value.(*widget.AccordionItem); ok { + arg0Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("accordion: arg 1: block item: expected native of type *widget.AccordionItem") + return env.NewError("accordion: arg 1: " + "block item: " + "expected native of type *widget.AccordionItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("accordion: arg 1: block item: expected integer to be 0 or nil") + return env.NewError("accordion: arg 1: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val[i] = nil default: ps.FailureFlag = true - return env.NewError("accordion: arg 1: block item: expected native") + return env.NewError("accordion: arg 1: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg0Val, ok = v.Value.([]*widget.AccordionItem) - if !ok { - ps.FailureFlag = true - return env.NewError("accordion: arg 1: expected native of type []*widget.AccordionItem") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("accordion: arg 1: expected integer to be 0 or nil") + return env.NewError("accordion: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("accordion: arg 1: expected block, native or nil") + return env.NewError("accordion: arg 1: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := widget.NewAccordion(arg0Val...) var res0Obj env.Object @@ -170792,11 +164222,11 @@ var Builtins = map[string]*env.Builtin{ Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("accordion-item: arg 1: expected string") + return env.NewError("accordion-item: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val fyne.CanvasObject switch v := arg1.(type) { @@ -170805,24 +164235,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("accordion-item: arg 2: " + err.Error() + "") + return env.NewError("accordion-item: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("accordion-item: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("accordion-item: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("accordion-item: arg 2: expected integer to be 0 or nil") + return env.NewError("accordion-item: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("accordion-item: arg 2: expected native") + return env.NewError("accordion-item: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := widget.NewAccordionItem(arg0Val, arg1Val) var res0Obj env.Object @@ -170845,18 +164275,18 @@ var Builtins = map[string]*env.Builtin{ Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("button: arg 1: expected string") + return env.NewError("button: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val func() switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("button: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("button: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } arg1Val = func() { actualFn := fn @@ -170866,12 +164296,12 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("button: arg 2: expected integer to be 0 or nil") + return env.NewError("button: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("button: arg 2: expected function or nil") + return env.NewError("button: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } res0 := widget.NewButton(arg0Val, arg1Val) var res0Obj env.Object @@ -170884,11 +164314,11 @@ var Builtins = map[string]*env.Builtin{ Argsn: 3, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("button-with-icon: arg 1: expected string") + return env.NewError("button-with-icon: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val fyne.Resource switch v := arg1.(type) { @@ -170897,31 +164327,31 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Resource(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("button-with-icon: arg 2: " + err.Error() + "") + return env.NewError("button-with-icon: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("button-with-icon: arg 2: expected native of type fyne.Resource") + return env.NewError("button-with-icon: arg 2: " + "expected native of type fyne.Resource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("button-with-icon: arg 2: expected integer to be 0 or nil") + return env.NewError("button-with-icon: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("button-with-icon: arg 2: expected native") + return env.NewError("button-with-icon: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg2Val func() switch fn := arg2.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("button-with-icon: arg 3: function has invalid number of arguments (expected 0)") + return env.NewError("button-with-icon: arg 3: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } arg2Val = func() { actualFn := fn @@ -170931,12 +164361,12 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("button-with-icon: arg 3: expected integer to be 0 or nil") + return env.NewError("button-with-icon: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("button-with-icon: arg 3: expected function or nil") + return env.NewError("button-with-icon: arg 3: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } res0 := widget.NewButtonWithIcon(arg0Val, arg1Val, arg2Val) var res0Obj env.Object @@ -170949,18 +164379,18 @@ var Builtins = map[string]*env.Builtin{ Argsn: 3, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("card: arg 1: expected string") + return env.NewError("card: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val string - if v, ok := arg1.(env.String); ok { - arg1Val = string(v.Value) + if vc, ok := arg1.(env.String); ok { + arg1Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("card: arg 2: expected string") + return env.NewError("card: arg 2: " + "expected string, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val fyne.CanvasObject switch v := arg2.(type) { @@ -170969,24 +164399,24 @@ var Builtins = map[string]*env.Builtin{ arg2Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("card: arg 3: " + err.Error() + "") + return env.NewError("card: arg 3: " + err.Error()) } case env.Native: - var ok bool - arg2Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("card: arg 3: expected native of type fyne.CanvasObject") + return env.NewError("card: arg 3: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("card: arg 3: expected integer to be 0 or nil") + return env.NewError("card: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("card: arg 3: expected native") + return env.NewError("card: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := widget.NewCard(arg0Val, arg1Val, arg2Val) var res0Obj env.Object @@ -170999,35 +164429,35 @@ var Builtins = map[string]*env.Builtin{ Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("check: arg 1: expected string") + return env.NewError("check: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val func(bool) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("check: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("check: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg1Val = func(arg0 bool) { - var arg0Val env.Object - arg0Val = *env.NewInteger(boolToInt64(arg0)) + arg1Val = func(farg0 bool) { + var farg0Val env.Object + farg0Val = *env.NewInteger(boolToInt64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("check: arg 2: expected integer to be 0 or nil") + return env.NewError("check: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("check: arg 2: expected function or nil") + return env.NewError("check: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } res0 := widget.NewCheck(arg0Val, arg1Val) var res0Obj env.Object @@ -171044,59 +164474,52 @@ var Builtins = map[string]*env.Builtin{ case env.Block: arg0Val = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - arg0Val[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + arg0Val[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("check-group: arg 1: block item: expected string") + return env.NewError("check-group: arg 1: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - arg0Val, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("check-group: arg 1: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("check-group: arg 1: expected integer to be 0 or nil") + return env.NewError("check-group: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("check-group: arg 1: expected block, native or nil") + return env.NewError("check-group: arg 1: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func([]string) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("check-group: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("check-group: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg1Val = func(arg0 []string) { - var arg0Val env.Object + arg1Val = func(farg0 []string) { + var farg0Val env.Object { - items := make([]env.Object, len(arg0)) - for i, it := range arg0 { + items := make([]env.Object, len(farg0)) + for i, it := range farg0 { items[i] = *env.NewString(it) } - arg0Val = *env.NewBlock(*env.NewTSeries(items)) + farg0Val = *env.NewBlock(*env.NewTSeries(items)) } actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("check-group: arg 2: expected integer to be 0 or nil") + return env.NewError("check-group: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("check-group: arg 2: expected function or nil") + return env.NewError("check-group: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } res0 := widget.NewCheckGroup(arg0Val, arg1Val) var res0Obj env.Object @@ -171109,11 +164532,11 @@ var Builtins = map[string]*env.Builtin{ Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("check-with-data: arg 1: expected string") + return env.NewError("check-with-data: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val binding.Bool switch v := arg1.(type) { @@ -171122,24 +164545,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_binding_Bool(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("check-with-data: arg 2: " + err.Error() + "") + return env.NewError("check-with-data: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(binding.Bool) - if !ok { + if vc, ok := v.Value.(binding.Bool); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("check-with-data: arg 2: expected native of type binding.Bool") + return env.NewError("check-with-data: arg 2: " + "expected native of type binding.Bool, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("check-with-data: arg 2: expected integer to be 0 or nil") + return env.NewError("check-with-data: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("check-with-data: arg 2: expected native") + return env.NewError("check-with-data: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := widget.NewCheckWithData(arg0Val, arg1Val) var res0Obj env.Object @@ -171188,24 +164611,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_String(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("entry-with-data: arg 1: " + err.Error() + "") + return env.NewError("entry-with-data: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.String) - if !ok { + if vc, ok := v.Value.(binding.String); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("entry-with-data: arg 1: expected native of type binding.String") + return env.NewError("entry-with-data: arg 1: " + "expected native of type binding.String, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("entry-with-data: arg 1: expected integer to be 0 or nil") + return env.NewError("entry-with-data: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("entry-with-data: arg 1: expected native") + return env.NewError("entry-with-data: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := widget.NewEntryWithData(arg0Val) var res0Obj env.Object @@ -171224,24 +164647,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_URI(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("widget-file-icon: arg 1: " + err.Error() + "") + return env.NewError("widget-file-icon: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.URI) - if !ok { + if vc, ok := v.Value.(fyne.URI); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("widget-file-icon: arg 1: expected native of type fyne.URI") + return env.NewError("widget-file-icon: arg 1: " + "expected native of type fyne.URI, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("widget-file-icon: arg 1: expected integer to be 0 or nil") + return env.NewError("widget-file-icon: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("widget-file-icon: arg 1: expected native") + return env.NewError("widget-file-icon: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := widget.NewFileIcon(arg0Val) var res0Obj env.Object @@ -171260,39 +164683,32 @@ var Builtins = map[string]*env.Builtin{ for i, it := range v.Series.S { switch v := it.(type) { case env.Native: - var ok bool - arg0Val[i], ok = v.Value.(*widget.FormItem) - if !ok { + if vc, ok := v.Value.(*widget.FormItem); ok { + arg0Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("form: arg 1: block item: expected native of type *widget.FormItem") + return env.NewError("form: arg 1: " + "block item: " + "expected native of type *widget.FormItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("form: arg 1: block item: expected integer to be 0 or nil") + return env.NewError("form: arg 1: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val[i] = nil default: ps.FailureFlag = true - return env.NewError("form: arg 1: block item: expected native") + return env.NewError("form: arg 1: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg0Val, ok = v.Value.([]*widget.FormItem) - if !ok { - ps.FailureFlag = true - return env.NewError("form: arg 1: expected native of type []*widget.FormItem") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("form: arg 1: expected integer to be 0 or nil") + return env.NewError("form: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("form: arg 1: expected block, native or nil") + return env.NewError("form: arg 1: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := widget.NewForm(arg0Val...) var res0Obj env.Object @@ -171305,11 +164721,11 @@ var Builtins = map[string]*env.Builtin{ Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("form-item: arg 1: expected string") + return env.NewError("form-item: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val fyne.CanvasObject switch v := arg1.(type) { @@ -171318,24 +164734,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("form-item: arg 2: " + err.Error() + "") + return env.NewError("form-item: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("form-item: arg 2: expected native of type fyne.CanvasObject") + return env.NewError("form-item: arg 2: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("form-item: arg 2: expected integer to be 0 or nil") + return env.NewError("form-item: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("form-item: arg 2: expected native") + return env.NewError("form-item: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := widget.NewFormItem(arg0Val, arg1Val) var res0Obj env.Object @@ -171352,18 +164768,19 @@ var Builtins = map[string]*env.Builtin{ case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("widget-grid-wrap: arg 1: function has invalid number of arguments (expected 0)") + return env.NewError("widget-grid-wrap: arg 1: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } arg0Val = func() int { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, ps.Ctx) var res int - if v, ok := ps.Res.(env.Integer); ok { - res = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + res = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "widget-grid-wrap: arg 1: callback result: expected integer", + "widget-grid-wrap: arg 1: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -171374,19 +164791,19 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("widget-grid-wrap: arg 1: expected integer to be 0 or nil") + return env.NewError("widget-grid-wrap: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("widget-grid-wrap: arg 1: expected function or nil") + return env.NewError("widget-grid-wrap: arg 1: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } var arg1Val func() fyne.CanvasObject switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("widget-grid-wrap: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("widget-grid-wrap: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } arg1Val = func() fyne.CanvasObject { actualFn := fn @@ -171398,19 +164815,21 @@ var Builtins = map[string]*env.Builtin{ var err error res, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "widget-grid-wrap: arg 2: callback result: "+err.Error()+"", + "widget-grid-wrap: arg 2: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "widget-grid-wrap: arg 2: callback result: expected native of type fyne.CanvasObject", + "widget-grid-wrap: arg 2: callback result: "+"expected native of type fyne.CanvasObject, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -171418,8 +164837,9 @@ var Builtins = map[string]*env.Builtin{ } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "widget-grid-wrap: arg 2: callback result: expected integer to be 0 or nil", + "widget-grid-wrap: arg 2: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -171427,8 +164847,9 @@ var Builtins = map[string]*env.Builtin{ } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "widget-grid-wrap: arg 2: callback result: expected native", + "widget-grid-wrap: arg 2: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -171439,54 +164860,37 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("widget-grid-wrap: arg 2: expected integer to be 0 or nil") + return env.NewError("widget-grid-wrap: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("widget-grid-wrap: arg 2: expected function or nil") + return env.NewError("widget-grid-wrap: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } var arg2Val func(widget.GridWrapItemID, fyne.CanvasObject) switch fn := arg2.(type) { case env.Function: if fn.Argsn != 2 { ps.FailureFlag = true - return env.NewError("widget-grid-wrap: arg 3: function has invalid number of arguments (expected 2)") + return env.NewError("widget-grid-wrap: arg 3: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg2Val = func(arg0 widget.GridWrapItemID, arg1 fyne.CanvasObject) { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewInteger(int64(int(arg0))) - { - typ := reflect.TypeOf(arg1) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg1Val = *env.NewNative(ps.Idx, arg1, typRyeName) - } else { - arg1Val = *env.NewNative(ps.Idx, arg1, "Go(fyne.CanvasObject)") - } - } + arg2Val = func(farg0 widget.GridWrapItemID, farg1 fyne.CanvasObject) { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewInteger(int64(int(farg0))) + farg1Val = ifaceToNative(ps.Idx, farg1, "Go(fyne.CanvasObject)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val, farg1Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("widget-grid-wrap: arg 3: expected integer to be 0 or nil") + return env.NewError("widget-grid-wrap: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("widget-grid-wrap: arg 3: expected function or nil") + return env.NewError("widget-grid-wrap: arg 3: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } res0 := widget.NewGridWrap(arg0Val, arg1Val, arg2Val) var res0Obj env.Object @@ -171505,31 +164909,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_DataList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("grid-wrap-with-data: arg 1: " + err.Error() + "") + return env.NewError("grid-wrap-with-data: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.DataList) - if !ok { + if vc, ok := v.Value.(binding.DataList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("grid-wrap-with-data: arg 1: expected native of type binding.DataList") + return env.NewError("grid-wrap-with-data: arg 1: " + "expected native of type binding.DataList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("grid-wrap-with-data: arg 1: expected integer to be 0 or nil") + return env.NewError("grid-wrap-with-data: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("grid-wrap-with-data: arg 1: expected native") + return env.NewError("grid-wrap-with-data: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func() fyne.CanvasObject switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("grid-wrap-with-data: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("grid-wrap-with-data: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } arg1Val = func() fyne.CanvasObject { actualFn := fn @@ -171541,19 +164945,21 @@ var Builtins = map[string]*env.Builtin{ var err error res, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "grid-wrap-with-data: arg 2: callback result: "+err.Error()+"", + "grid-wrap-with-data: arg 2: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "grid-wrap-with-data: arg 2: callback result: expected native of type fyne.CanvasObject", + "grid-wrap-with-data: arg 2: callback result: "+"expected native of type fyne.CanvasObject, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -171561,8 +164967,9 @@ var Builtins = map[string]*env.Builtin{ } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "grid-wrap-with-data: arg 2: callback result: expected integer to be 0 or nil", + "grid-wrap-with-data: arg 2: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -171570,8 +164977,9 @@ var Builtins = map[string]*env.Builtin{ } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "grid-wrap-with-data: arg 2: callback result: expected native", + "grid-wrap-with-data: arg 2: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -171582,71 +164990,37 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("grid-wrap-with-data: arg 2: expected integer to be 0 or nil") + return env.NewError("grid-wrap-with-data: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("grid-wrap-with-data: arg 2: expected function or nil") + return env.NewError("grid-wrap-with-data: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } var arg2Val func(binding.DataItem, fyne.CanvasObject) switch fn := arg2.(type) { case env.Function: if fn.Argsn != 2 { ps.FailureFlag = true - return env.NewError("grid-wrap-with-data: arg 3: function has invalid number of arguments (expected 2)") + return env.NewError("grid-wrap-with-data: arg 3: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg2Val = func(arg0 binding.DataItem, arg1 fyne.CanvasObject) { - var arg0Val, arg1Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataItem)") - } - } - { - typ := reflect.TypeOf(arg1) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg1Val = *env.NewNative(ps.Idx, arg1, typRyeName) - } else { - arg1Val = *env.NewNative(ps.Idx, arg1, "Go(fyne.CanvasObject)") - } - } + arg2Val = func(farg0 binding.DataItem, farg1 fyne.CanvasObject) { + var farg0Val, farg1Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataItem)") + farg1Val = ifaceToNative(ps.Idx, farg1, "Go(fyne.CanvasObject)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val, farg1Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("grid-wrap-with-data: arg 3: expected integer to be 0 or nil") + return env.NewError("grid-wrap-with-data: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("grid-wrap-with-data: arg 3: expected function or nil") + return env.NewError("grid-wrap-with-data: arg 3: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } res0 := widget.NewGridWrapWithData(arg0Val, arg1Val, arg2Val) var res0Obj env.Object @@ -171659,30 +165033,30 @@ var Builtins = map[string]*env.Builtin{ Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("hyperlink: arg 1: expected string") + return env.NewError("hyperlink: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val *url.URL switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*url.URL) - if !ok { + if vc, ok := v.Value.(*url.URL); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("hyperlink: arg 2: expected native of type *url.URL") + return env.NewError("hyperlink: arg 2: " + "expected native of type *url.URL, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("hyperlink: arg 2: expected integer to be 0 or nil") + return env.NewError("hyperlink: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("hyperlink: arg 2: expected native") + return env.NewError("hyperlink: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := widget.NewHyperlink(arg0Val, arg1Val) var res0Obj env.Object @@ -171705,30 +165079,30 @@ var Builtins = map[string]*env.Builtin{ Argsn: 4, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("hyperlink-with-style: arg 1: expected string") + return env.NewError("hyperlink-with-style: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val *url.URL switch v := arg1.(type) { case env.Native: - var ok bool - arg1Val, ok = v.Value.(*url.URL) - if !ok { + if vc, ok := v.Value.(*url.URL); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("hyperlink-with-style: arg 2: expected native of type *url.URL") + return env.NewError("hyperlink-with-style: arg 2: " + "expected native of type *url.URL, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("hyperlink-with-style: arg 2: expected integer to be 0 or nil") + return env.NewError("hyperlink-with-style: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("hyperlink-with-style: arg 2: expected native") + return env.NewError("hyperlink-with-style: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg2Val fyne.TextAlign { @@ -171742,35 +165116,29 @@ var Builtins = map[string]*env.Builtin{ arg2Val = natVal } else { var u int - if v, ok := arg2.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg2.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("hyperlink-with-style: arg 3: expected integer") + return env.NewError("hyperlink-with-style: arg 3: " + "expected integer, but got " + objectDebugString(ps.Idx, arg2)) } arg2Val = fyne.TextAlign(u) } } - var arg3Val *fyne.TextStyle + var arg3Val fyne.TextStyle switch v := arg3.(type) { case env.Native: - var ok bool - arg3Val, ok = v.Value.(*fyne.TextStyle) - if !ok { - ps.FailureFlag = true - return env.NewError("hyperlink-with-style: arg 4: expected native of type *fyne.TextStyle") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.TextStyle); ok { + arg3Val = *vc + } else { ps.FailureFlag = true - return env.NewError("hyperlink-with-style: arg 4: expected integer to be 0 or nil") + return env.NewError("hyperlink-with-style: arg 4: " + "expected native of type *fyne.TextStyle, but got " + objectDebugString(ps.Idx, v)) } - arg3Val = nil default: ps.FailureFlag = true - return env.NewError("hyperlink-with-style: arg 4: expected native") + return env.NewError("hyperlink-with-style: arg 4: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - res0 := widget.NewHyperlinkWithStyle(arg0Val, arg1Val, arg2Val, *arg3Val) + res0 := widget.NewHyperlinkWithStyle(arg0Val, arg1Val, arg2Val, arg3Val) var res0Obj env.Object res0Obj = *env.NewNative(ps.Idx, res0, "Go(*widget.Hyperlink)") return res0Obj @@ -171787,24 +165155,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Resource(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("icon: arg 1: " + err.Error() + "") + return env.NewError("icon: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("icon: arg 1: expected native of type fyne.Resource") + return env.NewError("icon: arg 1: " + "expected native of type fyne.Resource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("icon: arg 1: expected integer to be 0 or nil") + return env.NewError("icon: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("icon: arg 1: expected native") + return env.NewError("icon: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := widget.NewIcon(arg0Val) var res0Obj env.Object @@ -171827,11 +165195,11 @@ var Builtins = map[string]*env.Builtin{ Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("label: arg 1: expected string") + return env.NewError("label: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } res0 := widget.NewLabel(arg0Val) var res0Obj env.Object @@ -171850,24 +165218,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_String(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("label-with-data: arg 1: " + err.Error() + "") + return env.NewError("label-with-data: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.String) - if !ok { + if vc, ok := v.Value.(binding.String); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("label-with-data: arg 1: expected native of type binding.String") + return env.NewError("label-with-data: arg 1: " + "expected native of type binding.String, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("label-with-data: arg 1: expected integer to be 0 or nil") + return env.NewError("label-with-data: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("label-with-data: arg 1: expected native") + return env.NewError("label-with-data: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := widget.NewLabelWithData(arg0Val) var res0Obj env.Object @@ -171880,11 +165248,11 @@ var Builtins = map[string]*env.Builtin{ Argsn: 3, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("label-with-style: arg 1: expected string") + return env.NewError("label-with-style: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val fyne.TextAlign { @@ -171898,35 +165266,29 @@ var Builtins = map[string]*env.Builtin{ arg1Val = natVal } else { var u int - if v, ok := arg1.(env.Integer); ok { - u = int(v.Value) + if vc, ok := arg1.(env.Integer); ok { + u = int(vc.Value) } else { ps.FailureFlag = true - return env.NewError("label-with-style: arg 2: expected integer") + return env.NewError("label-with-style: arg 2: " + "expected integer, but got " + objectDebugString(ps.Idx, arg1)) } arg1Val = fyne.TextAlign(u) } } - var arg2Val *fyne.TextStyle + var arg2Val fyne.TextStyle switch v := arg2.(type) { case env.Native: - var ok bool - arg2Val, ok = v.Value.(*fyne.TextStyle) - if !ok { - ps.FailureFlag = true - return env.NewError("label-with-style: arg 3: expected native of type *fyne.TextStyle") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.TextStyle); ok { + arg2Val = *vc + } else { ps.FailureFlag = true - return env.NewError("label-with-style: arg 3: expected integer to be 0 or nil") + return env.NewError("label-with-style: arg 3: " + "expected native of type *fyne.TextStyle, but got " + objectDebugString(ps.Idx, v)) } - arg2Val = nil default: ps.FailureFlag = true - return env.NewError("label-with-style: arg 3: expected native") + return env.NewError("label-with-style: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - res0 := widget.NewLabelWithStyle(arg0Val, arg1Val, *arg2Val) + res0 := widget.NewLabelWithStyle(arg0Val, arg1Val, arg2Val) var res0Obj env.Object res0Obj = *env.NewNative(ps.Idx, res0, "Go(*widget.Label)") return res0Obj @@ -171941,18 +165303,19 @@ var Builtins = map[string]*env.Builtin{ case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("list: arg 1: function has invalid number of arguments (expected 0)") + return env.NewError("list: arg 1: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } arg0Val = func() int { actualFn := fn _ = actualFn evaldo.CallFunctionArgsN(fn, ps, ps.Ctx) var res int - if v, ok := ps.Res.(env.Integer); ok { - res = int(v.Value) + if vc, ok := ps.Res.(env.Integer); ok { + res = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "list: arg 1: callback result: expected integer", + "list: arg 1: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -171963,19 +165326,19 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("list: arg 1: expected integer to be 0 or nil") + return env.NewError("list: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("list: arg 1: expected function or nil") + return env.NewError("list: arg 1: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } var arg1Val func() fyne.CanvasObject switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("list: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("list: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } arg1Val = func() fyne.CanvasObject { actualFn := fn @@ -171987,19 +165350,21 @@ var Builtins = map[string]*env.Builtin{ var err error res, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "list: arg 2: callback result: "+err.Error()+"", + "list: arg 2: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "list: arg 2: callback result: expected native of type fyne.CanvasObject", + "list: arg 2: callback result: "+"expected native of type fyne.CanvasObject, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -172007,8 +165372,9 @@ var Builtins = map[string]*env.Builtin{ } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "list: arg 2: callback result: expected integer to be 0 or nil", + "list: arg 2: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -172016,8 +165382,9 @@ var Builtins = map[string]*env.Builtin{ } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "list: arg 2: callback result: expected native", + "list: arg 2: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -172028,54 +165395,37 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("list: arg 2: expected integer to be 0 or nil") + return env.NewError("list: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("list: arg 2: expected function or nil") + return env.NewError("list: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } var arg2Val func(widget.ListItemID, fyne.CanvasObject) switch fn := arg2.(type) { case env.Function: if fn.Argsn != 2 { ps.FailureFlag = true - return env.NewError("list: arg 3: function has invalid number of arguments (expected 2)") + return env.NewError("list: arg 3: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg2Val = func(arg0 widget.ListItemID, arg1 fyne.CanvasObject) { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewInteger(int64(int(arg0))) - { - typ := reflect.TypeOf(arg1) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg1Val = *env.NewNative(ps.Idx, arg1, typRyeName) - } else { - arg1Val = *env.NewNative(ps.Idx, arg1, "Go(fyne.CanvasObject)") - } - } + arg2Val = func(farg0 widget.ListItemID, farg1 fyne.CanvasObject) { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewInteger(int64(int(farg0))) + farg1Val = ifaceToNative(ps.Idx, farg1, "Go(fyne.CanvasObject)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val, farg1Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("list: arg 3: expected integer to be 0 or nil") + return env.NewError("list: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("list: arg 3: expected function or nil") + return env.NewError("list: arg 3: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } res0 := widget.NewList(arg0Val, arg1Val, arg2Val) var res0Obj env.Object @@ -172104,31 +165454,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_DataList(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("list-with-data: arg 1: " + err.Error() + "") + return env.NewError("list-with-data: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.DataList) - if !ok { + if vc, ok := v.Value.(binding.DataList); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("list-with-data: arg 1: expected native of type binding.DataList") + return env.NewError("list-with-data: arg 1: " + "expected native of type binding.DataList, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("list-with-data: arg 1: expected integer to be 0 or nil") + return env.NewError("list-with-data: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("list-with-data: arg 1: expected native") + return env.NewError("list-with-data: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func() fyne.CanvasObject switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("list-with-data: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("list-with-data: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } arg1Val = func() fyne.CanvasObject { actualFn := fn @@ -172140,19 +165490,21 @@ var Builtins = map[string]*env.Builtin{ var err error res, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "list-with-data: arg 2: callback result: "+err.Error()+"", + "list-with-data: arg 2: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "list-with-data: arg 2: callback result: expected native of type fyne.CanvasObject", + "list-with-data: arg 2: callback result: "+"expected native of type fyne.CanvasObject, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -172160,8 +165512,9 @@ var Builtins = map[string]*env.Builtin{ } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "list-with-data: arg 2: callback result: expected integer to be 0 or nil", + "list-with-data: arg 2: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -172169,8 +165522,9 @@ var Builtins = map[string]*env.Builtin{ } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "list-with-data: arg 2: callback result: expected native", + "list-with-data: arg 2: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -172181,71 +165535,37 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("list-with-data: arg 2: expected integer to be 0 or nil") + return env.NewError("list-with-data: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("list-with-data: arg 2: expected function or nil") + return env.NewError("list-with-data: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } var arg2Val func(binding.DataItem, fyne.CanvasObject) switch fn := arg2.(type) { case env.Function: if fn.Argsn != 2 { ps.FailureFlag = true - return env.NewError("list-with-data: arg 3: function has invalid number of arguments (expected 2)") + return env.NewError("list-with-data: arg 3: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg2Val = func(arg0 binding.DataItem, arg1 fyne.CanvasObject) { - var arg0Val, arg1Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataItem)") - } - } - { - typ := reflect.TypeOf(arg1) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg1Val = *env.NewNative(ps.Idx, arg1, typRyeName) - } else { - arg1Val = *env.NewNative(ps.Idx, arg1, "Go(fyne.CanvasObject)") - } - } + arg2Val = func(farg0 binding.DataItem, farg1 fyne.CanvasObject) { + var farg0Val, farg1Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataItem)") + farg1Val = ifaceToNative(ps.Idx, farg1, "Go(fyne.CanvasObject)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val, farg1Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("list-with-data: arg 3: expected integer to be 0 or nil") + return env.NewError("list-with-data: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("list-with-data: arg 3: expected function or nil") + return env.NewError("list-with-data: arg 3: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } res0 := widget.NewListWithData(arg0Val, arg1Val, arg2Val) var res0Obj env.Object @@ -172260,21 +165580,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.Menu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Menu) - if !ok { + if vc, ok := v.Value.(*fyne.Menu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("widget-menu: arg 1: expected native of type *fyne.Menu") + return env.NewError("widget-menu: arg 1: " + "expected native of type *fyne.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("widget-menu: arg 1: expected integer to be 0 or nil") + return env.NewError("widget-menu: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("widget-menu: arg 1: expected native") + return env.NewError("widget-menu: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := widget.NewMenu(arg0Val) var res0Obj env.Object @@ -172293,24 +165613,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("modal-pop-up: arg 1: " + err.Error() + "") + return env.NewError("modal-pop-up: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("modal-pop-up: arg 1: expected native of type fyne.CanvasObject") + return env.NewError("modal-pop-up: arg 1: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("modal-pop-up: arg 1: expected integer to be 0 or nil") + return env.NewError("modal-pop-up: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("modal-pop-up: arg 1: expected native") + return env.NewError("modal-pop-up: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Canvas switch v := arg1.(type) { @@ -172319,24 +165639,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("modal-pop-up: arg 2: " + err.Error() + "") + return env.NewError("modal-pop-up: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("modal-pop-up: arg 2: expected native of type fyne.Canvas") + return env.NewError("modal-pop-up: arg 2: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("modal-pop-up: arg 2: expected integer to be 0 or nil") + return env.NewError("modal-pop-up: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("modal-pop-up: arg 2: expected native") + return env.NewError("modal-pop-up: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := widget.NewModalPopUp(arg0Val, arg1Val) var res0Obj env.Object @@ -172385,24 +165705,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("pop-up: arg 1: " + err.Error() + "") + return env.NewError("pop-up: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("pop-up: arg 1: expected native of type fyne.CanvasObject") + return env.NewError("pop-up: arg 1: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("pop-up: arg 1: expected integer to be 0 or nil") + return env.NewError("pop-up: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("pop-up: arg 1: expected native") + return env.NewError("pop-up: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Canvas switch v := arg1.(type) { @@ -172411,24 +165731,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("pop-up: arg 2: " + err.Error() + "") + return env.NewError("pop-up: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("pop-up: arg 2: expected native of type fyne.Canvas") + return env.NewError("pop-up: arg 2: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("pop-up: arg 2: expected integer to be 0 or nil") + return env.NewError("pop-up: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("pop-up: arg 2: expected native") + return env.NewError("pop-up: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := widget.NewPopUp(arg0Val, arg1Val) var res0Obj env.Object @@ -172443,21 +165763,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.Menu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Menu) - if !ok { + if vc, ok := v.Value.(*fyne.Menu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("pop-up-menu: arg 1: expected native of type *fyne.Menu") + return env.NewError("pop-up-menu: arg 1: " + "expected native of type *fyne.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("pop-up-menu: arg 1: expected integer to be 0 or nil") + return env.NewError("pop-up-menu: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("pop-up-menu: arg 1: expected native") + return env.NewError("pop-up-menu: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Canvas switch v := arg1.(type) { @@ -172466,24 +165786,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("pop-up-menu: arg 2: " + err.Error() + "") + return env.NewError("pop-up-menu: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("pop-up-menu: arg 2: expected native of type fyne.Canvas") + return env.NewError("pop-up-menu: arg 2: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("pop-up-menu: arg 2: expected integer to be 0 or nil") + return env.NewError("pop-up-menu: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("pop-up-menu: arg 2: expected native") + return env.NewError("pop-up-menu: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := widget.NewPopUpMenu(arg0Val, arg1Val) var res0Obj env.Object @@ -172522,24 +165842,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_Float(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("progress-bar-with-data: arg 1: " + err.Error() + "") + return env.NewError("progress-bar-with-data: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.Float) - if !ok { + if vc, ok := v.Value.(binding.Float); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("progress-bar-with-data: arg 1: expected native of type binding.Float") + return env.NewError("progress-bar-with-data: arg 1: " + "expected native of type binding.Float, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("progress-bar-with-data: arg 1: expected integer to be 0 or nil") + return env.NewError("progress-bar-with-data: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("progress-bar-with-data: arg 1: expected native") + return env.NewError("progress-bar-with-data: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := widget.NewProgressBarWithData(arg0Val) var res0Obj env.Object @@ -172556,53 +165876,46 @@ var Builtins = map[string]*env.Builtin{ case env.Block: arg0Val = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - arg0Val[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + arg0Val[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("radio-group: arg 1: block item: expected string") + return env.NewError("radio-group: arg 1: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - arg0Val, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("radio-group: arg 1: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("radio-group: arg 1: expected integer to be 0 or nil") + return env.NewError("radio-group: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("radio-group: arg 1: expected block, native or nil") + return env.NewError("radio-group: arg 1: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func(string) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("radio-group: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("radio-group: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg1Val = func(arg0 string) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + arg1Val = func(farg0 string) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("radio-group: arg 2: expected integer to be 0 or nil") + return env.NewError("radio-group: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("radio-group: arg 2: expected function or nil") + return env.NewError("radio-group: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } res0 := widget.NewRadioGroup(arg0Val, arg1Val) var res0Obj env.Object @@ -172625,42 +165938,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val[i], err = ctxTo_widget_RichTextSegment(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("rich-text: arg 1: block item: " + err.Error() + "") + return env.NewError("rich-text: arg 1: " + "block item: " + err.Error()) } case env.Native: - var ok bool - arg0Val[i], ok = v.Value.(widget.RichTextSegment) - if !ok { + if vc, ok := v.Value.(widget.RichTextSegment); ok { + arg0Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("rich-text: arg 1: block item: expected native of type widget.RichTextSegment") + return env.NewError("rich-text: arg 1: " + "block item: " + "expected native of type widget.RichTextSegment, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("rich-text: arg 1: block item: expected integer to be 0 or nil") + return env.NewError("rich-text: arg 1: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val[i] = nil default: ps.FailureFlag = true - return env.NewError("rich-text: arg 1: block item: expected native") + return env.NewError("rich-text: arg 1: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg0Val, ok = v.Value.([]widget.RichTextSegment) - if !ok { - ps.FailureFlag = true - return env.NewError("rich-text: arg 1: expected native of type []widget.RichTextSegment") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("rich-text: arg 1: expected integer to be 0 or nil") + return env.NewError("rich-text: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("rich-text: arg 1: expected block, native or nil") + return env.NewError("rich-text: arg 1: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := widget.NewRichText(arg0Val...) var res0Obj env.Object @@ -172673,11 +165979,11 @@ var Builtins = map[string]*env.Builtin{ Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("rich-text-from-markdown: arg 1: expected string") + return env.NewError("rich-text-from-markdown: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } res0 := widget.NewRichTextFromMarkdown(arg0Val) var res0Obj env.Object @@ -172700,11 +166006,11 @@ var Builtins = map[string]*env.Builtin{ Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("rich-text-with-text: arg 1: expected string") + return env.NewError("rich-text-with-text: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } res0 := widget.NewRichTextWithText(arg0Val) var res0Obj env.Object @@ -172721,53 +166027,46 @@ var Builtins = map[string]*env.Builtin{ case env.Block: arg0Val = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - arg0Val[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + arg0Val[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("select: arg 1: block item: expected string") + return env.NewError("select: arg 1: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - arg0Val, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("select: arg 1: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("select: arg 1: expected integer to be 0 or nil") + return env.NewError("select: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("select: arg 1: expected block, native or nil") + return env.NewError("select: arg 1: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func(string) switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("select: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("select: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg1Val = func(arg0 string) { - var arg0Val env.Object - arg0Val = *env.NewString(arg0) + arg1Val = func(farg0 string) { + var farg0Val env.Object + farg0Val = *env.NewString(farg0) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("select: arg 2: expected integer to be 0 or nil") + return env.NewError("select: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("select: arg 2: expected function or nil") + return env.NewError("select: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } res0 := widget.NewSelect(arg0Val, arg1Val) var res0Obj env.Object @@ -172784,29 +166083,22 @@ var Builtins = map[string]*env.Builtin{ case env.Block: arg0Val = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - arg0Val[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + arg0Val[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("select-entry: arg 1: block item: expected string") + return env.NewError("select-entry: arg 1: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - arg0Val, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("select-entry: arg 1: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("select-entry: arg 1: expected integer to be 0 or nil") + return env.NewError("select-entry: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("select-entry: arg 1: expected block, native or nil") + return env.NewError("select-entry: arg 1: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := widget.NewSelectEntry(arg0Val) var res0Obj env.Object @@ -172845,45 +166137,28 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("simple-renderer: arg 1: " + err.Error() + "") + return env.NewError("simple-renderer: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("simple-renderer: arg 1: expected native of type fyne.CanvasObject") + return env.NewError("simple-renderer: arg 1: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("simple-renderer: arg 1: expected integer to be 0 or nil") + return env.NewError("simple-renderer: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("simple-renderer: arg 1: expected native") + return env.NewError("simple-renderer: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := widget.NewSimpleRenderer(arg0Val) var res0Obj env.Object - { - typ := reflect.TypeOf(res0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - res0Obj = *env.NewNative(ps.Idx, res0, typRyeName) - } else { - res0Obj = *env.NewNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") - } - } + res0Obj = ifaceToNative(ps.Idx, res0, "Go(fyne.WidgetRenderer)") return res0Obj }, }, @@ -172892,18 +166167,18 @@ var Builtins = map[string]*env.Builtin{ Argsn: 2, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val float64 - if v, ok := arg0.(env.Decimal); ok { - arg0Val = float64(v.Value) + if vc, ok := arg0.(env.Decimal); ok { + arg0Val = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("slider: arg 1: expected decimal") + return env.NewError("slider: arg 1: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val float64 - if v, ok := arg1.(env.Decimal); ok { - arg1Val = float64(v.Value) + if vc, ok := arg1.(env.Decimal); ok { + arg1Val = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("slider: arg 2: expected decimal") + return env.NewError("slider: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } res0 := widget.NewSlider(arg0Val, arg1Val) var res0Obj env.Object @@ -172916,18 +166191,18 @@ var Builtins = map[string]*env.Builtin{ Argsn: 3, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val float64 - if v, ok := arg0.(env.Decimal); ok { - arg0Val = float64(v.Value) + if vc, ok := arg0.(env.Decimal); ok { + arg0Val = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("slider-with-data: arg 1: expected decimal") + return env.NewError("slider-with-data: arg 1: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg0)) } var arg1Val float64 - if v, ok := arg1.(env.Decimal); ok { - arg1Val = float64(v.Value) + if vc, ok := arg1.(env.Decimal); ok { + arg1Val = float64(vc.Value) } else { ps.FailureFlag = true - return env.NewError("slider-with-data: arg 2: expected decimal") + return env.NewError("slider-with-data: arg 2: " + "expected decimal, but got " + objectDebugString(ps.Idx, arg1)) } var arg2Val binding.Float switch v := arg2.(type) { @@ -172936,24 +166211,24 @@ var Builtins = map[string]*env.Builtin{ arg2Val, err = ctxTo_binding_Float(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("slider-with-data: arg 3: " + err.Error() + "") + return env.NewError("slider-with-data: arg 3: " + err.Error()) } case env.Native: - var ok bool - arg2Val, ok = v.Value.(binding.Float) - if !ok { + if vc, ok := v.Value.(binding.Float); ok { + arg2Val = vc + } else { ps.FailureFlag = true - return env.NewError("slider-with-data: arg 3: expected native of type binding.Float") + return env.NewError("slider-with-data: arg 3: " + "expected native of type binding.Float, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("slider-with-data: arg 3: expected integer to be 0 or nil") + return env.NewError("slider-with-data: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("slider-with-data: arg 3: expected native") + return env.NewError("slider-with-data: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } res0 := widget.NewSliderWithData(arg0Val, arg1Val, arg2Val) var res0Obj env.Object @@ -172970,196 +166245,7 @@ var Builtins = map[string]*env.Builtin{ case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("table: arg 1: function has invalid number of arguments (expected 0)") - } - arg0Val = func() (int, int) { - actualFn := fn - _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx) - var res0 int - var res1 int - res, ok := ps.Res.(env.Block) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "table: arg 1: callback result: expected block for multiple return values", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } - if len(res.Series.S) != 2 { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "table: arg 1: callback result: expected block with 2 return values", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = int(v.Value) - } else { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "table: arg 1: callback result: expected integer", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } - if v, ok := res.Series.S[1].(env.Integer); ok { - res1 = int(v.Value) - } else { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "table: arg 1: callback result: expected integer", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res0, res1 - } - return res0, res1 - } - case env.Integer: - if fn.Value != 0 { - ps.FailureFlag = true - return env.NewError("table: arg 1: expected integer to be 0 or nil") - } - arg0Val = nil - default: - ps.FailureFlag = true - return env.NewError("table: arg 1: expected function or nil") - } - var arg1Val func() fyne.CanvasObject - switch fn := arg1.(type) { - case env.Function: - if fn.Argsn != 0 { - ps.FailureFlag = true - return env.NewError("table: arg 2: function has invalid number of arguments (expected 0)") - } - arg1Val = func() fyne.CanvasObject { - actualFn := fn - _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx) - var res fyne.CanvasObject - switch v := ps.Res.(type) { - case env.RyeCtx: - var err error - res, err = ctxTo_fyne_CanvasObject(ps, v) - if err != nil { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "table: arg 2: callback result: "+err.Error()+"", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } - case env.Native: - var ok bool - res, ok = v.Value.(fyne.CanvasObject) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "table: arg 2: callback result: expected native of type fyne.CanvasObject", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } - case env.Integer: - if v.Value != 0 { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "table: arg 2: callback result: expected integer to be 0 or nil", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } - res = nil - default: - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "table: arg 2: callback result: expected native", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } - return res - } - case env.Integer: - if fn.Value != 0 { - ps.FailureFlag = true - return env.NewError("table: arg 2: expected integer to be 0 or nil") - } - arg1Val = nil - default: - ps.FailureFlag = true - return env.NewError("table: arg 2: expected function or nil") - } - var arg2Val func(widget.TableCellID, fyne.CanvasObject) - switch fn := arg2.(type) { - case env.Function: - if fn.Argsn != 2 { - ps.FailureFlag = true - return env.NewError("table: arg 3: function has invalid number of arguments (expected 2)") - } - arg2Val = func(arg0 widget.TableCellID, arg1 fyne.CanvasObject) { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewNative(ps.Idx, &arg0, "Go(*widget.TableCellID)") - { - typ := reflect.TypeOf(arg1) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg1Val = *env.NewNative(ps.Idx, arg1, typRyeName) - } else { - arg1Val = *env.NewNative(ps.Idx, arg1, "Go(fyne.CanvasObject)") - } - } - actualFn := fn - _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val, arg1Val) - } - case env.Integer: - if fn.Value != 0 { - ps.FailureFlag = true - return env.NewError("table: arg 3: expected integer to be 0 or nil") - } - arg2Val = nil - default: - ps.FailureFlag = true - return env.NewError("table: arg 3: expected function or nil") - } - res0 := widget.NewTable(arg0Val, arg1Val, arg2Val) - var res0Obj env.Object - res0Obj = *env.NewNative(ps.Idx, res0, "Go(*widget.Table)") - return res0Obj - }, - }, - "table-cell-id": { - Doc: "Create a new widget.TableCellID struct", - Argsn: 0, - Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - res := &widget.TableCellID{} - var resObj env.Object - resObj = *env.NewNative(ps.Idx, res, "Go(*widget.TableCellID)") - return resObj - }, - }, - "table-with-headers": { - Doc: "widget.NewTableWithHeaders", - Argsn: 3, - Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { - var arg0Val func() (int, int) - switch fn := arg0.(type) { - case env.Function: - if fn.Argsn != 0 { - ps.FailureFlag = true - return env.NewError("table-with-headers: arg 1: function has invalid number of arguments (expected 0)") + return env.NewError("table: arg 1: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } arg0Val = func() (int, int) { actualFn := fn @@ -173169,36 +166255,40 @@ var Builtins = map[string]*env.Builtin{ var res1 int res, ok := ps.Res.(env.Block) if !ok { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "table-with-headers: arg 1: callback result: expected block for multiple return values", + "table: arg 1: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } if len(res.Series.S) != 2 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "table-with-headers: arg 1: callback result: expected block with 2 return values", + "table: arg 1: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[0].(env.Integer); ok { - res0 = int(v.Value) + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "table-with-headers: arg 1: callback result: expected integer", + "table: arg 1: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res0, res1 } - if v, ok := res.Series.S[1].(env.Integer); ok { - res1 = int(v.Value) + if vc, ok := res.Series.S[1].(env.Integer); ok { + res1 = int(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "table-with-headers: arg 1: callback result: expected integer", + "table: arg 1: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[1]), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -173209,19 +166299,19 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("table-with-headers: arg 1: expected integer to be 0 or nil") + return env.NewError("table: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("table-with-headers: arg 1: expected function or nil") + return env.NewError("table: arg 1: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } var arg1Val func() fyne.CanvasObject switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("table-with-headers: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("table: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } arg1Val = func() fyne.CanvasObject { actualFn := fn @@ -173233,19 +166323,21 @@ var Builtins = map[string]*env.Builtin{ var err error res, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "table-with-headers: arg 2: callback result: "+err.Error()+"", + "table: arg 2: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "table-with-headers: arg 2: callback result: expected native of type fyne.CanvasObject", + "table: arg 2: callback result: "+"expected native of type fyne.CanvasObject, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -173253,8 +166345,9 @@ var Builtins = map[string]*env.Builtin{ } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "table-with-headers: arg 2: callback result: expected integer to be 0 or nil", + "table: arg 2: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -173262,8 +166355,9 @@ var Builtins = map[string]*env.Builtin{ } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "table-with-headers: arg 2: callback result: expected native", + "table: arg 2: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -173274,54 +166368,217 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("table-with-headers: arg 2: expected integer to be 0 or nil") + return env.NewError("table: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("table-with-headers: arg 2: expected function or nil") + return env.NewError("table: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } var arg2Val func(widget.TableCellID, fyne.CanvasObject) switch fn := arg2.(type) { case env.Function: if fn.Argsn != 2 { ps.FailureFlag = true - return env.NewError("table-with-headers: arg 3: function has invalid number of arguments (expected 2)") + return env.NewError("table: arg 3: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg2Val = func(arg0 widget.TableCellID, arg1 fyne.CanvasObject) { - var arg0Val, arg1Val env.Object - arg0Val = *env.NewNative(ps.Idx, &arg0, "Go(*widget.TableCellID)") - { - typ := reflect.TypeOf(arg1) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] + arg2Val = func(farg0 widget.TableCellID, farg1 fyne.CanvasObject) { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewNative(ps.Idx, &farg0, "Go(*widget.TableCellID)") + farg1Val = ifaceToNative(ps.Idx, farg1, "Go(fyne.CanvasObject)") + actualFn := fn + _ = actualFn + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val, farg1Val) + } + case env.Integer: + if fn.Value != 0 { + ps.FailureFlag = true + return env.NewError("table: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) + } + arg2Val = nil + default: + ps.FailureFlag = true + return env.NewError("table: arg 3: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) + } + res0 := widget.NewTable(arg0Val, arg1Val, arg2Val) + var res0Obj env.Object + res0Obj = *env.NewNative(ps.Idx, res0, "Go(*widget.Table)") + return res0Obj + }, + }, + "table-cell-id": { + Doc: "Create a new widget.TableCellID struct", + Argsn: 0, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + res := &widget.TableCellID{} + var resObj env.Object + resObj = *env.NewNative(ps.Idx, res, "Go(*widget.TableCellID)") + return resObj + }, + }, + "table-with-headers": { + Doc: "widget.NewTableWithHeaders", + Argsn: 3, + Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { + var arg0Val func() (int, int) + switch fn := arg0.(type) { + case env.Function: + if fn.Argsn != 0 { + ps.FailureFlag = true + return env.NewError("table-with-headers: arg 1: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) + } + arg0Val = func() (int, int) { + actualFn := fn + _ = actualFn + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx) + var res0 int + var res1 int + res, ok := ps.Res.(env.Block) + if !ok { + ps.FailureFlag = true + fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", + "table-with-headers: arg 1: callback result: "+"expected block for multiple return values, but got "+objectDebugString(ps.Idx, ps.Res), + actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), + actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), + ) + return res0, res1 + } + if len(res.Series.S) != 2 { + ps.FailureFlag = true + fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", + "table-with-headers: arg 1: callback result: "+"expected block with 2 return values, but got "+strconv.Itoa(len(res.Series.S))+" return values", + actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), + actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), + ) + return res0, res1 + } + if vc, ok := res.Series.S[0].(env.Integer); ok { + res0 = int(vc.Value) + } else { + ps.FailureFlag = true + fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", + "table-with-headers: arg 1: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[0]), + actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), + actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), + ) + return res0, res1 + } + if vc, ok := res.Series.S[1].(env.Integer); ok { + res1 = int(vc.Value) + } else { + ps.FailureFlag = true + fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", + "table-with-headers: arg 1: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, res.Series.S[1]), + actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), + actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), + ) + return res0, res1 + } + return res0, res1 + } + case env.Integer: + if fn.Value != 0 { + ps.FailureFlag = true + return env.NewError("table-with-headers: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) + } + arg0Val = nil + default: + ps.FailureFlag = true + return env.NewError("table-with-headers: arg 1: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) + } + var arg1Val func() fyne.CanvasObject + switch fn := arg1.(type) { + case env.Function: + if fn.Argsn != 0 { + ps.FailureFlag = true + return env.NewError("table-with-headers: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) + } + arg1Val = func() fyne.CanvasObject { + actualFn := fn + _ = actualFn + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx) + var res fyne.CanvasObject + switch v := ps.Res.(type) { + case env.RyeCtx: + var err error + res, err = ctxTo_fyne_CanvasObject(ps, v) + if err != nil { + ps.FailureFlag = true + fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", + "table-with-headers: arg 2: callback result: "+err.Error(), + actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), + actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), + ) + return res } - if ok { - arg1Val = *env.NewNative(ps.Idx, arg1, typRyeName) + case env.Native: + if vc, ok := v.Value.(fyne.CanvasObject); ok { + res = vc } else { - arg1Val = *env.NewNative(ps.Idx, arg1, "Go(fyne.CanvasObject)") + ps.FailureFlag = true + fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", + "table-with-headers: arg 2: callback result: "+"expected native of type fyne.CanvasObject, but got "+objectDebugString(ps.Idx, v), + actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), + actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), + ) + return res + } + case env.Integer: + if v.Value != 0 { + ps.FailureFlag = true + fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", + "table-with-headers: arg 2: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), + actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), + actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), + ) + return res } + res = nil + default: + ps.FailureFlag = true + fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", + "table-with-headers: arg 2: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), + actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), + actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), + ) + return res } + return res + } + case env.Integer: + if fn.Value != 0 { + ps.FailureFlag = true + return env.NewError("table-with-headers: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) + } + arg1Val = nil + default: + ps.FailureFlag = true + return env.NewError("table-with-headers: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) + } + var arg2Val func(widget.TableCellID, fyne.CanvasObject) + switch fn := arg2.(type) { + case env.Function: + if fn.Argsn != 2 { + ps.FailureFlag = true + return env.NewError("table-with-headers: arg 3: " + "expected 2 function arguments, but got " + strconv.Itoa(fn.Argsn)) + } + arg2Val = func(farg0 widget.TableCellID, farg1 fyne.CanvasObject) { + var farg0Val, farg1Val env.Object + farg0Val = *env.NewNative(ps.Idx, &farg0, "Go(*widget.TableCellID)") + farg1Val = ifaceToNative(ps.Idx, farg1, "Go(fyne.CanvasObject)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val, arg1Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val, farg1Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("table-with-headers: arg 3: expected integer to be 0 or nil") + return env.NewError("table-with-headers: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("table-with-headers: arg 3: expected function or nil") + return env.NewError("table-with-headers: arg 3: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } res0 := widget.NewTableWithHeaders(arg0Val, arg1Val, arg2Val) var res0Obj env.Object @@ -173354,11 +166611,11 @@ var Builtins = map[string]*env.Builtin{ Argsn: 1, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var arg0Val string - if v, ok := arg0.(env.String); ok { - arg0Val = string(v.Value) + if vc, ok := arg0.(env.String); ok { + arg0Val = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("text-grid-from-string: arg 1: expected string") + return env.NewError("text-grid-from-string: arg 1: " + "expected string, but got " + objectDebugString(ps.Idx, arg0)) } res0 := widget.NewTextGridFromString(arg0Val) var res0Obj env.Object @@ -173401,42 +166658,35 @@ var Builtins = map[string]*env.Builtin{ arg0Val[i], err = ctxTo_widget_ToolbarItem(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("toolbar: arg 1: block item: " + err.Error() + "") + return env.NewError("toolbar: arg 1: " + "block item: " + err.Error()) } case env.Native: - var ok bool - arg0Val[i], ok = v.Value.(widget.ToolbarItem) - if !ok { + if vc, ok := v.Value.(widget.ToolbarItem); ok { + arg0Val[i] = vc + } else { ps.FailureFlag = true - return env.NewError("toolbar: arg 1: block item: expected native of type widget.ToolbarItem") + return env.NewError("toolbar: arg 1: " + "block item: " + "expected native of type widget.ToolbarItem, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("toolbar: arg 1: block item: expected integer to be 0 or nil") + return env.NewError("toolbar: arg 1: " + "block item: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val[i] = nil default: ps.FailureFlag = true - return env.NewError("toolbar: arg 1: block item: expected native") + return env.NewError("toolbar: arg 1: " + "block item: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } } - case env.Native: - var ok bool - arg0Val, ok = v.Value.([]widget.ToolbarItem) - if !ok { - ps.FailureFlag = true - return env.NewError("toolbar: arg 1: expected native of type []widget.ToolbarItem") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("toolbar: arg 1: expected integer to be 0 or nil") + return env.NewError("toolbar: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("toolbar: arg 1: expected block, native or nil") + return env.NewError("toolbar: arg 1: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := widget.NewToolbar(arg0Val...) var res0Obj env.Object @@ -173455,31 +166705,31 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_Resource(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("toolbar-action: arg 1: " + err.Error() + "") + return env.NewError("toolbar-action: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.Resource) - if !ok { + if vc, ok := v.Value.(fyne.Resource); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("toolbar-action: arg 1: expected native of type fyne.Resource") + return env.NewError("toolbar-action: arg 1: " + "expected native of type fyne.Resource, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("toolbar-action: arg 1: expected integer to be 0 or nil") + return env.NewError("toolbar-action: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("toolbar-action: arg 1: expected native") + return env.NewError("toolbar-action: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func() switch fn := arg1.(type) { case env.Function: if fn.Argsn != 0 { ps.FailureFlag = true - return env.NewError("toolbar-action: arg 2: function has invalid number of arguments (expected 0)") + return env.NewError("toolbar-action: arg 2: " + "expected 0 function arguments, but got " + strconv.Itoa(fn.Argsn)) } arg1Val = func() { actualFn := fn @@ -173489,12 +166739,12 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("toolbar-action: arg 2: expected integer to be 0 or nil") + return env.NewError("toolbar-action: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("toolbar-action: arg 2: expected function or nil") + return env.NewError("toolbar-action: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } res0 := widget.NewToolbarAction(arg0Val, arg1Val) var res0Obj env.Object @@ -173531,14 +166781,14 @@ var Builtins = map[string]*env.Builtin{ case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("tree: arg 1: function has invalid number of arguments (expected 1)") + return env.NewError("tree: arg 1: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg0Val = func(arg0 widget.TreeNodeID) []widget.TreeNodeID { - var arg0Val env.Object - arg0Val = *env.NewString(string(arg0)) + arg0Val = func(farg0 widget.TreeNodeID) []widget.TreeNodeID { + var farg0Val env.Object + farg0Val = *env.NewString(string(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) var res []widget.TreeNodeID switch v := ps.Res.(type) { case env.Block: @@ -173555,11 +166805,12 @@ var Builtins = map[string]*env.Builtin{ res[i] = natVal } else { var u string - if v, ok := it.(env.String); ok { - u = string(v.Value) + if vc, ok := it.(env.String); ok { + u = string(vc.Value) } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "tree: arg 1: callback result: block item: expected string", + "tree: arg 1: callback result: "+"block item: "+"expected string, but got "+objectDebugString(ps.Idx, it), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -173569,21 +166820,11 @@ var Builtins = map[string]*env.Builtin{ } } } - case env.Native: - var ok bool - res, ok = v.Value.([]widget.TreeNodeID) - if !ok { - fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "tree: arg 1: callback result: expected native of type []widget.TreeNodeID", - actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), - actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), - ) - return res - } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "tree: arg 1: callback result: expected integer to be 0 or nil", + "tree: arg 1: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -173591,8 +166832,9 @@ var Builtins = map[string]*env.Builtin{ } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "tree: arg 1: callback result: expected block, native or nil", + "tree: arg 1: callback result: "+"expected block or nil, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -173603,32 +166845,33 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("tree: arg 1: expected integer to be 0 or nil") + return env.NewError("tree: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("tree: arg 1: expected function or nil") + return env.NewError("tree: arg 1: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } var arg1Val func(widget.TreeNodeID) bool switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("tree: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("tree: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg1Val = func(arg0 widget.TreeNodeID) bool { - var arg0Val env.Object - arg0Val = *env.NewString(string(arg0)) + arg1Val = func(farg0 widget.TreeNodeID) bool { + var farg0Val env.Object + farg0Val = *env.NewString(string(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) var res bool - if v, ok := ps.Res.(env.Integer); ok { - res = v.Value != 0 + if vc, ok := ps.Res.(env.Integer); ok { + res = vc.Value != 0 } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "tree: arg 2: callback result: expected integer", + "tree: arg 2: callback result: "+"expected integer, but got "+objectDebugString(ps.Idx, ps.Res), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -173639,45 +166882,47 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("tree: arg 2: expected integer to be 0 or nil") + return env.NewError("tree: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("tree: arg 2: expected function or nil") + return env.NewError("tree: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } var arg2Val func(bool) fyne.CanvasObject switch fn := arg2.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("tree: arg 3: function has invalid number of arguments (expected 1)") + return env.NewError("tree: arg 3: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg2Val = func(arg0 bool) fyne.CanvasObject { - var arg0Val env.Object - arg0Val = *env.NewInteger(boolToInt64(arg0)) + arg2Val = func(farg0 bool) fyne.CanvasObject { + var farg0Val env.Object + farg0Val = *env.NewInteger(boolToInt64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) var res fyne.CanvasObject switch v := ps.Res.(type) { case env.RyeCtx: var err error res, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "tree: arg 3: callback result: "+err.Error()+"", + "tree: arg 3: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "tree: arg 3: callback result: expected native of type fyne.CanvasObject", + "tree: arg 3: callback result: "+"expected native of type fyne.CanvasObject, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -173685,8 +166930,9 @@ var Builtins = map[string]*env.Builtin{ } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "tree: arg 3: callback result: expected integer to be 0 or nil", + "tree: arg 3: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -173694,8 +166940,9 @@ var Builtins = map[string]*env.Builtin{ } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "tree: arg 3: callback result: expected native", + "tree: arg 3: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -173706,55 +166953,38 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("tree: arg 3: expected integer to be 0 or nil") + return env.NewError("tree: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("tree: arg 3: expected function or nil") + return env.NewError("tree: arg 3: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } var arg3Val func(widget.TreeNodeID, bool, fyne.CanvasObject) switch fn := arg3.(type) { case env.Function: if fn.Argsn != 3 { ps.FailureFlag = true - return env.NewError("tree: arg 4: function has invalid number of arguments (expected 3)") + return env.NewError("tree: arg 4: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg3Val = func(arg0 widget.TreeNodeID, arg1 bool, arg2 fyne.CanvasObject) { - var arg0Val, arg1Val, arg2Val env.Object - arg0Val = *env.NewString(string(arg0)) - arg1Val = *env.NewInteger(boolToInt64(arg1)) - { - typ := reflect.TypeOf(arg2) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg2Val = *env.NewNative(ps.Idx, arg2, typRyeName) - } else { - arg2Val = *env.NewNative(ps.Idx, arg2, "Go(fyne.CanvasObject)") - } - } + arg3Val = func(farg0 widget.TreeNodeID, farg1 bool, farg2 fyne.CanvasObject) { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = *env.NewString(string(farg0)) + farg1Val = *env.NewInteger(boolToInt64(farg1)) + farg2Val = ifaceToNative(ps.Idx, farg2, "Go(fyne.CanvasObject)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val, farg1Val, farg2Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("tree: arg 4: expected integer to be 0 or nil") + return env.NewError("tree: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("tree: arg 4: expected function or nil") + return env.NewError("tree: arg 4: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } res0 := widget.NewTree(arg0Val, arg1Val, arg2Val, arg3Val) var res0Obj env.Object @@ -173773,57 +167003,59 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_binding_DataTree(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("tree-with-data: arg 1: " + err.Error() + "") + return env.NewError("tree-with-data: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(binding.DataTree) - if !ok { + if vc, ok := v.Value.(binding.DataTree); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("tree-with-data: arg 1: expected native of type binding.DataTree") + return env.NewError("tree-with-data: arg 1: " + "expected native of type binding.DataTree, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("tree-with-data: arg 1: expected integer to be 0 or nil") + return env.NewError("tree-with-data: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("tree-with-data: arg 1: expected native") + return env.NewError("tree-with-data: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val func(bool) fyne.CanvasObject switch fn := arg1.(type) { case env.Function: if fn.Argsn != 1 { ps.FailureFlag = true - return env.NewError("tree-with-data: arg 2: function has invalid number of arguments (expected 1)") + return env.NewError("tree-with-data: arg 2: " + "expected 1 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg1Val = func(arg0 bool) fyne.CanvasObject { - var arg0Val env.Object - arg0Val = *env.NewInteger(boolToInt64(arg0)) + arg1Val = func(farg0 bool) fyne.CanvasObject { + var farg0Val env.Object + farg0Val = *env.NewInteger(boolToInt64(farg0)) actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val) var res fyne.CanvasObject switch v := ps.Res.(type) { case env.RyeCtx: var err error res, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "tree-with-data: arg 2: callback result: "+err.Error()+"", + "tree-with-data: arg 2: callback result: "+err.Error(), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) return res } case env.Native: - var ok bool - res, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + res = vc + } else { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "tree-with-data: arg 2: callback result: expected native of type fyne.CanvasObject", + "tree-with-data: arg 2: callback result: "+"expected native of type fyne.CanvasObject, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -173831,8 +167063,9 @@ var Builtins = map[string]*env.Builtin{ } case env.Integer: if v.Value != 0 { + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "tree-with-data: arg 2: callback result: expected integer to be 0 or nil", + "tree-with-data: arg 2: callback result: "+"expected integer to be 0 or nil, but got "+strconv.FormatInt(v.Value, 10), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -173840,8 +167073,9 @@ var Builtins = map[string]*env.Builtin{ } res = nil default: + ps.FailureFlag = true fmt.Printf("\033[31mError: \033[1m%v\033[m\n\033[31mFrom function \033[1m%v { %v }\033[m\n", - "tree-with-data: arg 2: callback result: expected native", + "tree-with-data: arg 2: callback result: "+"expected native, but got "+objectDebugString(ps.Idx, v), actualFn.Spec.Series.PositionAndSurroundingElements(*ps.Idx), actualFn.Body.Series.PositionAndSurroundingElements(*ps.Idx), ) @@ -173852,72 +167086,38 @@ var Builtins = map[string]*env.Builtin{ case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("tree-with-data: arg 2: expected integer to be 0 or nil") + return env.NewError("tree-with-data: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("tree-with-data: arg 2: expected function or nil") + return env.NewError("tree-with-data: arg 2: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } var arg2Val func(binding.DataItem, bool, fyne.CanvasObject) switch fn := arg2.(type) { case env.Function: if fn.Argsn != 3 { ps.FailureFlag = true - return env.NewError("tree-with-data: arg 3: function has invalid number of arguments (expected 3)") + return env.NewError("tree-with-data: arg 3: " + "expected 3 function arguments, but got " + strconv.Itoa(fn.Argsn)) } - arg2Val = func(arg0 binding.DataItem, arg1 bool, arg2 fyne.CanvasObject) { - var arg0Val, arg1Val, arg2Val env.Object - { - typ := reflect.TypeOf(arg0) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg0Val = *env.NewNative(ps.Idx, arg0, typRyeName) - } else { - arg0Val = *env.NewNative(ps.Idx, arg0, "Go(binding.DataItem)") - } - } - arg1Val = *env.NewInteger(boolToInt64(arg1)) - { - typ := reflect.TypeOf(arg2) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - arg2Val = *env.NewNative(ps.Idx, arg2, typRyeName) - } else { - arg2Val = *env.NewNative(ps.Idx, arg2, "Go(fyne.CanvasObject)") - } - } + arg2Val = func(farg0 binding.DataItem, farg1 bool, farg2 fyne.CanvasObject) { + var farg0Val, farg1Val, farg2Val env.Object + farg0Val = ifaceToNative(ps.Idx, farg0, "Go(binding.DataItem)") + farg1Val = *env.NewInteger(boolToInt64(farg1)) + farg2Val = ifaceToNative(ps.Idx, farg2, "Go(fyne.CanvasObject)") actualFn := fn _ = actualFn - evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, arg0Val, arg1Val, arg2Val) + evaldo.CallFunctionArgsN(fn, ps, ps.Ctx, farg0Val, farg1Val, farg2Val) } case env.Integer: if fn.Value != 0 { ps.FailureFlag = true - return env.NewError("tree-with-data: arg 3: expected integer to be 0 or nil") + return env.NewError("tree-with-data: arg 3: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(fn.Value, 10)) } arg2Val = nil default: ps.FailureFlag = true - return env.NewError("tree-with-data: arg 3: expected function or nil") + return env.NewError("tree-with-data: arg 3: " + "expected function or nil, but got " + objectDebugString(ps.Idx, fn)) } res0 := widget.NewTreeWithData(arg0Val, arg1Val, arg2Val) var res0Obj env.Object @@ -173934,45 +167134,38 @@ var Builtins = map[string]*env.Builtin{ case env.Block: if len(v.Series.S)%2 != 0 { ps.FailureFlag = true - return env.NewError("tree-with-strings: arg 1: expected block to have length of multiple of 2") + return env.NewError("tree-with-strings: arg 1: " + "expected block to have length of multiple of 2, but got block with length " + strconv.Itoa(len(v.Series.S))) } arg0Val = make(map[string][]string, len(v.Series.S)/2) for i := 0; i < len(v.Series.S); i += 2 { var mapK string - if v, ok := v.Series.S[i+0].(env.String); ok { - mapK = string(v.Value) + if vc, ok := v.Series.S[i+0].(env.String); ok { + mapK = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("tree-with-strings: arg 1: map key: expected string") + return env.NewError("tree-with-strings: arg 1: " + "map key: " + "expected string, but got " + objectDebugString(ps.Idx, v.Series.S[i+0])) } var mapV []string switch v := v.Series.S[i+1].(type) { case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("tree-with-strings: arg 1: map value: block item: expected string") + return env.NewError("tree-with-strings: arg 1: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("tree-with-strings: arg 1: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("tree-with-strings: arg 1: map value: expected integer to be 0 or nil") + return env.NewError("tree-with-strings: arg 1: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("tree-with-strings: arg 1: map value: expected block, native or nil") + return env.NewError("tree-with-strings: arg 1: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg0Val[mapK] = mapV } @@ -173985,48 +167178,34 @@ var Builtins = map[string]*env.Builtin{ case env.Block: mapV = make([]string, len(v.Series.S)) for i, it := range v.Series.S { - if v, ok := it.(env.String); ok { - mapV[i] = string(v.Value) + if vc, ok := it.(env.String); ok { + mapV[i] = string(vc.Value) } else { ps.FailureFlag = true - return env.NewError("tree-with-strings: arg 1: map value: block item: expected string") + return env.NewError("tree-with-strings: arg 1: " + "map value: " + "block item: " + "expected string, but got " + objectDebugString(ps.Idx, it)) } } - case env.Native: - var ok bool - mapV, ok = v.Value.([]string) - if !ok { - ps.FailureFlag = true - return env.NewError("tree-with-strings: arg 1: map value: expected native of type []string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("tree-with-strings: arg 1: map value: expected integer to be 0 or nil") + return env.NewError("tree-with-strings: arg 1: " + "map value: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } mapV = nil default: ps.FailureFlag = true - return env.NewError("tree-with-strings: arg 1: map value: expected block, native or nil") + return env.NewError("tree-with-strings: arg 1: " + "map value: " + "expected block or nil, but got " + objectDebugString(ps.Idx, v)) } arg0Val[mapK] = mapV } - case env.Native: - var ok bool - arg0Val, ok = v.Value.(map[string][]string) - if !ok { - ps.FailureFlag = true - return env.NewError("tree-with-strings: arg 1: expected native of type map[string][]string") - } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("tree-with-strings: arg 1: expected integer to be 0 or nil") + return env.NewError("tree-with-strings: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("tree-with-strings: arg 1: expected native, block, dict or nil") + return env.NewError("tree-with-strings: arg 1: " + "expected block, dict or nil, but got " + objectDebugString(ps.Idx, v)) } res0 := widget.NewTreeWithStrings(arg0Val) var res0Obj env.Object @@ -174045,24 +167224,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("show-modal-pop-up: arg 1: " + err.Error() + "") + return env.NewError("show-modal-pop-up: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("show-modal-pop-up: arg 1: expected native of type fyne.CanvasObject") + return env.NewError("show-modal-pop-up: arg 1: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("show-modal-pop-up: arg 1: expected integer to be 0 or nil") + return env.NewError("show-modal-pop-up: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("show-modal-pop-up: arg 1: expected native") + return env.NewError("show-modal-pop-up: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Canvas switch v := arg1.(type) { @@ -174071,24 +167250,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("show-modal-pop-up: arg 2: " + err.Error() + "") + return env.NewError("show-modal-pop-up: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("show-modal-pop-up: arg 2: expected native of type fyne.Canvas") + return env.NewError("show-modal-pop-up: arg 2: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("show-modal-pop-up: arg 2: expected integer to be 0 or nil") + return env.NewError("show-modal-pop-up: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("show-modal-pop-up: arg 2: expected native") + return env.NewError("show-modal-pop-up: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } widget.ShowModalPopUp(arg0Val, arg1Val) return nil @@ -174105,24 +167284,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("show-pop-up: arg 1: " + err.Error() + "") + return env.NewError("show-pop-up: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("show-pop-up: arg 1: expected native of type fyne.CanvasObject") + return env.NewError("show-pop-up: arg 1: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("show-pop-up: arg 1: expected integer to be 0 or nil") + return env.NewError("show-pop-up: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("show-pop-up: arg 1: expected native") + return env.NewError("show-pop-up: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Canvas switch v := arg1.(type) { @@ -174131,24 +167310,24 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("show-pop-up: arg 2: " + err.Error() + "") + return env.NewError("show-pop-up: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("show-pop-up: arg 2: expected native of type fyne.Canvas") + return env.NewError("show-pop-up: arg 2: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("show-pop-up: arg 2: expected integer to be 0 or nil") + return env.NewError("show-pop-up: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("show-pop-up: arg 2: expected native") + return env.NewError("show-pop-up: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } widget.ShowPopUp(arg0Val, arg1Val) return nil @@ -174165,24 +167344,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("show-pop-up-at-position: arg 1: " + err.Error() + "") + return env.NewError("show-pop-up-at-position: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("show-pop-up-at-position: arg 1: expected native of type fyne.CanvasObject") + return env.NewError("show-pop-up-at-position: arg 1: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("show-pop-up-at-position: arg 1: expected integer to be 0 or nil") + return env.NewError("show-pop-up-at-position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("show-pop-up-at-position: arg 1: expected native") + return env.NewError("show-pop-up-at-position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Canvas switch v := arg1.(type) { @@ -174191,45 +167370,39 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("show-pop-up-at-position: arg 2: " + err.Error() + "") + return env.NewError("show-pop-up-at-position: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("show-pop-up-at-position: arg 2: expected native of type fyne.Canvas") + return env.NewError("show-pop-up-at-position: arg 2: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("show-pop-up-at-position: arg 2: expected integer to be 0 or nil") + return env.NewError("show-pop-up-at-position: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("show-pop-up-at-position: arg 2: expected native") + return env.NewError("show-pop-up-at-position: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg2Val *fyne.Position + var arg2Val fyne.Position switch v := arg2.(type) { case env.Native: - var ok bool - arg2Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("show-pop-up-at-position: arg 3: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg2Val = *vc + } else { ps.FailureFlag = true - return env.NewError("show-pop-up-at-position: arg 3: expected integer to be 0 or nil") + return env.NewError("show-pop-up-at-position: arg 3: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg2Val = nil default: ps.FailureFlag = true - return env.NewError("show-pop-up-at-position: arg 3: expected native") + return env.NewError("show-pop-up-at-position: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - widget.ShowPopUpAtPosition(arg0Val, arg1Val, *arg2Val) + widget.ShowPopUpAtPosition(arg0Val, arg1Val, arg2Val) return nil }, }, @@ -174244,24 +167417,24 @@ var Builtins = map[string]*env.Builtin{ arg0Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("show-pop-up-at-relative-position: arg 1: " + err.Error() + "") + return env.NewError("show-pop-up-at-relative-position: arg 1: " + err.Error()) } case env.Native: - var ok bool - arg0Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("show-pop-up-at-relative-position: arg 1: expected native of type fyne.CanvasObject") + return env.NewError("show-pop-up-at-relative-position: arg 1: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("show-pop-up-at-relative-position: arg 1: expected integer to be 0 or nil") + return env.NewError("show-pop-up-at-relative-position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("show-pop-up-at-relative-position: arg 1: expected native") + return env.NewError("show-pop-up-at-relative-position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Canvas switch v := arg1.(type) { @@ -174270,43 +167443,37 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("show-pop-up-at-relative-position: arg 2: " + err.Error() + "") + return env.NewError("show-pop-up-at-relative-position: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("show-pop-up-at-relative-position: arg 2: expected native of type fyne.Canvas") + return env.NewError("show-pop-up-at-relative-position: arg 2: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("show-pop-up-at-relative-position: arg 2: expected integer to be 0 or nil") + return env.NewError("show-pop-up-at-relative-position: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("show-pop-up-at-relative-position: arg 2: expected native") + return env.NewError("show-pop-up-at-relative-position: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg2Val *fyne.Position + var arg2Val fyne.Position switch v := arg2.(type) { case env.Native: - var ok bool - arg2Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("show-pop-up-at-relative-position: arg 3: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg2Val = *vc + } else { ps.FailureFlag = true - return env.NewError("show-pop-up-at-relative-position: arg 3: expected integer to be 0 or nil") + return env.NewError("show-pop-up-at-relative-position: arg 3: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg2Val = nil default: ps.FailureFlag = true - return env.NewError("show-pop-up-at-relative-position: arg 3: expected native") + return env.NewError("show-pop-up-at-relative-position: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg3Val fyne.CanvasObject switch v := arg3.(type) { @@ -174315,26 +167482,26 @@ var Builtins = map[string]*env.Builtin{ arg3Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("show-pop-up-at-relative-position: arg 4: " + err.Error() + "") + return env.NewError("show-pop-up-at-relative-position: arg 4: " + err.Error()) } case env.Native: - var ok bool - arg3Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg3Val = vc + } else { ps.FailureFlag = true - return env.NewError("show-pop-up-at-relative-position: arg 4: expected native of type fyne.CanvasObject") + return env.NewError("show-pop-up-at-relative-position: arg 4: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("show-pop-up-at-relative-position: arg 4: expected integer to be 0 or nil") + return env.NewError("show-pop-up-at-relative-position: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("show-pop-up-at-relative-position: arg 4: expected native") + return env.NewError("show-pop-up-at-relative-position: arg 4: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - widget.ShowPopUpAtRelativePosition(arg0Val, arg1Val, *arg2Val, arg3Val) + widget.ShowPopUpAtRelativePosition(arg0Val, arg1Val, arg2Val, arg3Val) return nil }, }, @@ -174345,21 +167512,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.Menu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Menu) - if !ok { + if vc, ok := v.Value.(*fyne.Menu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("show-pop-up-menu-at-position: arg 1: expected native of type *fyne.Menu") + return env.NewError("show-pop-up-menu-at-position: arg 1: " + "expected native of type *fyne.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("show-pop-up-menu-at-position: arg 1: expected integer to be 0 or nil") + return env.NewError("show-pop-up-menu-at-position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("show-pop-up-menu-at-position: arg 1: expected native") + return env.NewError("show-pop-up-menu-at-position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Canvas switch v := arg1.(type) { @@ -174368,45 +167535,39 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("show-pop-up-menu-at-position: arg 2: " + err.Error() + "") + return env.NewError("show-pop-up-menu-at-position: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("show-pop-up-menu-at-position: arg 2: expected native of type fyne.Canvas") + return env.NewError("show-pop-up-menu-at-position: arg 2: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("show-pop-up-menu-at-position: arg 2: expected integer to be 0 or nil") + return env.NewError("show-pop-up-menu-at-position: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("show-pop-up-menu-at-position: arg 2: expected native") + return env.NewError("show-pop-up-menu-at-position: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg2Val *fyne.Position + var arg2Val fyne.Position switch v := arg2.(type) { case env.Native: - var ok bool - arg2Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("show-pop-up-menu-at-position: arg 3: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg2Val = *vc + } else { ps.FailureFlag = true - return env.NewError("show-pop-up-menu-at-position: arg 3: expected integer to be 0 or nil") + return env.NewError("show-pop-up-menu-at-position: arg 3: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg2Val = nil default: ps.FailureFlag = true - return env.NewError("show-pop-up-menu-at-position: arg 3: expected native") + return env.NewError("show-pop-up-menu-at-position: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - widget.ShowPopUpMenuAtPosition(arg0Val, arg1Val, *arg2Val) + widget.ShowPopUpMenuAtPosition(arg0Val, arg1Val, arg2Val) return nil }, }, @@ -174417,21 +167578,21 @@ var Builtins = map[string]*env.Builtin{ var arg0Val *fyne.Menu switch v := arg0.(type) { case env.Native: - var ok bool - arg0Val, ok = v.Value.(*fyne.Menu) - if !ok { + if vc, ok := v.Value.(*fyne.Menu); ok { + arg0Val = vc + } else { ps.FailureFlag = true - return env.NewError("show-pop-up-menu-at-relative-position: arg 1: expected native of type *fyne.Menu") + return env.NewError("show-pop-up-menu-at-relative-position: arg 1: " + "expected native of type *fyne.Menu, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("show-pop-up-menu-at-relative-position: arg 1: expected integer to be 0 or nil") + return env.NewError("show-pop-up-menu-at-relative-position: arg 1: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg0Val = nil default: ps.FailureFlag = true - return env.NewError("show-pop-up-menu-at-relative-position: arg 1: expected native") + return env.NewError("show-pop-up-menu-at-relative-position: arg 1: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg1Val fyne.Canvas switch v := arg1.(type) { @@ -174440,43 +167601,37 @@ var Builtins = map[string]*env.Builtin{ arg1Val, err = ctxTo_fyne_Canvas(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("show-pop-up-menu-at-relative-position: arg 2: " + err.Error() + "") + return env.NewError("show-pop-up-menu-at-relative-position: arg 2: " + err.Error()) } case env.Native: - var ok bool - arg1Val, ok = v.Value.(fyne.Canvas) - if !ok { + if vc, ok := v.Value.(fyne.Canvas); ok { + arg1Val = vc + } else { ps.FailureFlag = true - return env.NewError("show-pop-up-menu-at-relative-position: arg 2: expected native of type fyne.Canvas") + return env.NewError("show-pop-up-menu-at-relative-position: arg 2: " + "expected native of type fyne.Canvas, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("show-pop-up-menu-at-relative-position: arg 2: expected integer to be 0 or nil") + return env.NewError("show-pop-up-menu-at-relative-position: arg 2: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg1Val = nil default: ps.FailureFlag = true - return env.NewError("show-pop-up-menu-at-relative-position: arg 2: expected native") + return env.NewError("show-pop-up-menu-at-relative-position: arg 2: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - var arg2Val *fyne.Position + var arg2Val fyne.Position switch v := arg2.(type) { case env.Native: - var ok bool - arg2Val, ok = v.Value.(*fyne.Position) - if !ok { - ps.FailureFlag = true - return env.NewError("show-pop-up-menu-at-relative-position: arg 3: expected native of type *fyne.Position") - } - case env.Integer: - if v.Value != 0 { + if vc, ok := v.Value.(*fyne.Position); ok { + arg2Val = *vc + } else { ps.FailureFlag = true - return env.NewError("show-pop-up-menu-at-relative-position: arg 3: expected integer to be 0 or nil") + return env.NewError("show-pop-up-menu-at-relative-position: arg 3: " + "expected native of type *fyne.Position, but got " + objectDebugString(ps.Idx, v)) } - arg2Val = nil default: ps.FailureFlag = true - return env.NewError("show-pop-up-menu-at-relative-position: arg 3: expected native") + return env.NewError("show-pop-up-menu-at-relative-position: arg 3: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } var arg3Val fyne.CanvasObject switch v := arg3.(type) { @@ -174485,26 +167640,26 @@ var Builtins = map[string]*env.Builtin{ arg3Val, err = ctxTo_fyne_CanvasObject(ps, v) if err != nil { ps.FailureFlag = true - return env.NewError("show-pop-up-menu-at-relative-position: arg 4: " + err.Error() + "") + return env.NewError("show-pop-up-menu-at-relative-position: arg 4: " + err.Error()) } case env.Native: - var ok bool - arg3Val, ok = v.Value.(fyne.CanvasObject) - if !ok { + if vc, ok := v.Value.(fyne.CanvasObject); ok { + arg3Val = vc + } else { ps.FailureFlag = true - return env.NewError("show-pop-up-menu-at-relative-position: arg 4: expected native of type fyne.CanvasObject") + return env.NewError("show-pop-up-menu-at-relative-position: arg 4: " + "expected native of type fyne.CanvasObject, but got " + objectDebugString(ps.Idx, v)) } case env.Integer: if v.Value != 0 { ps.FailureFlag = true - return env.NewError("show-pop-up-menu-at-relative-position: arg 4: expected integer to be 0 or nil") + return env.NewError("show-pop-up-menu-at-relative-position: arg 4: " + "expected integer to be 0 or nil, but got " + strconv.FormatInt(v.Value, 10)) } arg3Val = nil default: ps.FailureFlag = true - return env.NewError("show-pop-up-menu-at-relative-position: arg 4: expected native") + return env.NewError("show-pop-up-menu-at-relative-position: arg 4: " + "expected native, but got " + objectDebugString(ps.Idx, v)) } - widget.ShowPopUpMenuAtRelativePosition(arg0Val, arg1Val, *arg2Val, arg3Val) + widget.ShowPopUpMenuAtRelativePosition(arg0Val, arg1Val, arg2Val, arg3Val) return nil }, }, @@ -174522,24 +167677,7 @@ var Builtins = map[string]*env.Builtin{ Argsn: 0, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var resObj env.Object - { - typ := reflect.TypeOf(widget.TextGridStyleDefault) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - resObj = *env.NewNative(ps.Idx, widget.TextGridStyleDefault, typRyeName) - } else { - resObj = *env.NewNative(ps.Idx, widget.TextGridStyleDefault, "Go(widget.TextGridStyle)") - } - } + resObj = ifaceToNative(ps.Idx, widget.TextGridStyleDefault, "Go(widget.TextGridStyle)") return resObj }, }, @@ -174548,24 +167686,7 @@ var Builtins = map[string]*env.Builtin{ Argsn: 0, Fn: func(ps *env.ProgramState, arg0, arg1, arg2, arg3, arg4 env.Object) env.Object { var resObj env.Object - { - typ := reflect.TypeOf(widget.TextGridStyleWhitespace) - var typRyeName string - var ok bool - if typ != nil { - var typPfx string - if typ.Kind() == reflect.Pointer { - typPfx = "*" - typ = typ.Elem() - } - typRyeName, ok = ryeStructNameLookup[typ.PkgPath()+"."+typPfx+typ.Name()] - } - if ok { - resObj = *env.NewNative(ps.Idx, widget.TextGridStyleWhitespace, typRyeName) - } else { - resObj = *env.NewNative(ps.Idx, widget.TextGridStyleWhitespace, "Go(widget.TextGridStyle)") - } - } + resObj = ifaceToNative(ps.Idx, widget.TextGridStyleWhitespace, "Go(widget.TextGridStyle)") return resObj }, }, diff --git a/current/fyne_io_fyne_v2/generated.not.go b/current/fyne_io_fyne_v2/generated.not.go new file mode 100644 index 0000000..d9e68d9 --- /dev/null +++ b/current/fyne_io_fyne_v2/generated.not.go @@ -0,0 +1,9 @@ +// Code generated by ryegen. DO NOT EDIT. + +//go:build b_no_fyne + +package fyne_io_fyne_v2 + +import "github.com/refaktor/rye/env" + +var Builtins = map[string]*env.Builtin{} diff --git a/generate/README.md b/fyne/README.md similarity index 100% rename from generate/README.md rename to fyne/README.md diff --git a/generate/bindings.txt b/fyne/bindings.txt similarity index 96% rename from generate/bindings.txt rename to fyne/bindings.txt index 4cd6e49..f4b3ce5 100644 --- a/generate/bindings.txt +++ b/fyne/bindings.txt @@ -136,6 +136,8 @@ Go(*canvas.Text)//text-style! "Set *canvas.Text TextS Go(*canvas.Text)//text-style? "Get *canvas.Text TextStyle value" Go(*canvas.Text)//text? "Get *canvas.Text Text value" Go(*container.AppTabs)//append "(*container.AppTabs).Append" +Go(*container.AppTabs)//base-widget! "Set *container.AppTabs BaseWidget value" +Go(*container.AppTabs)//base-widget? "Get *container.AppTabs BaseWidget value" Go(*container.AppTabs)//create-renderer "(*container.AppTabs).CreateRenderer" Go(*container.AppTabs)//current-tab "(*container.AppTabs).CurrentTab" Go(*container.AppTabs)//current-tab-index "(*container.AppTabs).CurrentTabIndex" @@ -174,6 +176,8 @@ Go(*container.AppTabs)//show "(*container.AppTabs).S Go(*container.AppTabs)//size "(*container.AppTabs).Size" Go(*container.AppTabs)//visible "(*container.AppTabs).Visible" Go(*container.DocTabs)//append "(*container.DocTabs).Append" +Go(*container.DocTabs)//base-widget! "Set *container.DocTabs BaseWidget value" +Go(*container.DocTabs)//base-widget? "Get *container.DocTabs BaseWidget value" Go(*container.DocTabs)//close-intercept! "Set *container.DocTabs CloseIntercept value" Go(*container.DocTabs)//close-intercept? "Get *container.DocTabs CloseIntercept value" Go(*container.DocTabs)//create-renderer "(*container.DocTabs).CreateRenderer" @@ -211,6 +215,8 @@ Go(*container.DocTabs)//set-tab-location "(*container.DocTabs).S Go(*container.DocTabs)//show "(*container.DocTabs).Show" Go(*container.DocTabs)//size "(*container.DocTabs).Size" Go(*container.DocTabs)//visible "(*container.DocTabs).Visible" +Go(*container.Split)//base-widget! "Set *container.Split BaseWidget value" +Go(*container.Split)//base-widget? "Get *container.Split BaseWidget value" Go(*container.Split)//create-renderer "(*container.Split).CreateRenderer" Go(*container.Split)//extend-base-widget "(*container.Split).ExtendBaseWidget" Go(*container.Split)//hidden! "Set *container.Split Hidden value" @@ -253,6 +259,8 @@ Go(*desktop.MouseEvent)//button! "Set *desktop.MouseEven Go(*desktop.MouseEvent)//button? "Get *desktop.MouseEvent Button value" Go(*desktop.MouseEvent)//modifier! "Set *desktop.MouseEvent Modifier value" Go(*desktop.MouseEvent)//modifier? "Get *desktop.MouseEvent Modifier value" +Go(*desktop.MouseEvent)//point-event! "Set *desktop.MouseEvent PointEvent value" +Go(*desktop.MouseEvent)//point-event? "Get *desktop.MouseEvent PointEvent value" Go(*desktop.MouseEvent)//position! "Set *desktop.MouseEvent Position value" Go(*desktop.MouseEvent)//position? "Get *desktop.MouseEvent Position value" Go(*dialog.ColorPickerDialog)//advanced! "Set *dialog.ColorPickerDialog Advanced value" @@ -263,6 +271,8 @@ Go(*dialog.ColorPickerDialog)//show "(*dialog.ColorPickerDi Go(*dialog.ConfirmDialog)//set-confirm-importance "(*dialog.ConfirmDialog).SetConfirmImportance" Go(*dialog.ConfirmDialog)//set-confirm-text "(*dialog.ConfirmDialog).SetConfirmText" Go(*dialog.CustomDialog)//set-buttons "(*dialog.CustomDialog).SetButtons" +Go(*dialog.EntryDialog)//form-dialog! "Set *dialog.EntryDialog FormDialog value" +Go(*dialog.EntryDialog)//form-dialog? "Get *dialog.EntryDialog FormDialog value" Go(*dialog.EntryDialog)//set-on-closed "(*dialog.EntryDialog).SetOnClosed" Go(*dialog.EntryDialog)//set-placeholder "(*dialog.EntryDialog).SetPlaceholder" Go(*dialog.EntryDialog)//set-text "(*dialog.EntryDialog).SetText" @@ -326,14 +336,18 @@ Go(*fyne.Container)//resize "(*fyne.Container).Resi Go(*fyne.Container)//show "(*fyne.Container).Show" Go(*fyne.Container)//size "(*fyne.Container).Size" Go(*fyne.Container)//visible "(*fyne.Container).Visible" +Go(*fyne.Delta)//components "fyne.Delta.Components" Go(*fyne.Delta)//dx! "Set *fyne.Delta DX value" Go(*fyne.Delta)//dx? "Get *fyne.Delta DX value" Go(*fyne.Delta)//dy! "Set *fyne.Delta DY value" Go(*fyne.Delta)//dy? "Get *fyne.Delta DY value" +Go(*fyne.Delta)//is-zero "fyne.Delta.IsZero" Go(*fyne.DragEvent)//absolute-position! "Set *fyne.DragEvent AbsolutePosition value" Go(*fyne.DragEvent)//absolute-position? "Get *fyne.DragEvent AbsolutePosition value" Go(*fyne.DragEvent)//dragged! "Set *fyne.DragEvent Dragged value" Go(*fyne.DragEvent)//dragged? "Get *fyne.DragEvent Dragged value" +Go(*fyne.DragEvent)//point-event! "Set *fyne.DragEvent PointEvent value" +Go(*fyne.DragEvent)//point-event? "Get *fyne.DragEvent PointEvent value" Go(*fyne.DragEvent)//position! "Set *fyne.DragEvent Position value" Go(*fyne.DragEvent)//position? "Get *fyne.DragEvent Position value" Go(*fyne.HardwareKey)//scan-code! "Set *fyne.HardwareKey ScanCode value" @@ -376,12 +390,20 @@ Go(*fyne.PointEvent)//absolute-position! "Set *fyne.PointEvent A Go(*fyne.PointEvent)//absolute-position? "Get *fyne.PointEvent AbsolutePosition value" Go(*fyne.PointEvent)//position! "Set *fyne.PointEvent Position value" Go(*fyne.PointEvent)//position? "Get *fyne.PointEvent Position value" +Go(*fyne.Position)//add "fyne.Position.Add" +Go(*fyne.Position)//add-xy "fyne.Position.AddXY" +Go(*fyne.Position)//components "fyne.Position.Components" +Go(*fyne.Position)//is-zero "fyne.Position.IsZero" +Go(*fyne.Position)//subtract "fyne.Position.Subtract" +Go(*fyne.Position)//subtract-xy "fyne.Position.SubtractXY" Go(*fyne.Position)//x! "Set *fyne.Position X value" Go(*fyne.Position)//x? "Get *fyne.Position X value" Go(*fyne.Position)//y! "Set *fyne.Position Y value" Go(*fyne.Position)//y? "Get *fyne.Position Y value" Go(*fyne.ScrollEvent)//absolute-position! "Set *fyne.ScrollEvent AbsolutePosition value" Go(*fyne.ScrollEvent)//absolute-position? "Get *fyne.ScrollEvent AbsolutePosition value" +Go(*fyne.ScrollEvent)//point-event! "Set *fyne.ScrollEvent PointEvent value" +Go(*fyne.ScrollEvent)//point-event? "Get *fyne.ScrollEvent PointEvent value" Go(*fyne.ScrollEvent)//position! "Set *fyne.ScrollEvent Position value" Go(*fyne.ScrollEvent)//position? "Get *fyne.ScrollEvent Position value" Go(*fyne.ScrollEvent)//scrolled! "Set *fyne.ScrollEvent Scrolled value" @@ -407,8 +429,16 @@ Go(*fyne.ShortcutPaste)//shortcut-name "(*fyne.ShortcutPaste). Go(*fyne.ShortcutSelectAll)//key "(*fyne.ShortcutSelectAll).Key" Go(*fyne.ShortcutSelectAll)//mod "(*fyne.ShortcutSelectAll).Mod" Go(*fyne.ShortcutSelectAll)//shortcut-name "(*fyne.ShortcutSelectAll).ShortcutName" +Go(*fyne.Size)//add "fyne.Size.Add" +Go(*fyne.Size)//add-width-height "fyne.Size.AddWidthHeight" +Go(*fyne.Size)//components "fyne.Size.Components" Go(*fyne.Size)//height! "Set *fyne.Size Height value" Go(*fyne.Size)//height? "Get *fyne.Size Height value" +Go(*fyne.Size)//is-zero "fyne.Size.IsZero" +Go(*fyne.Size)//max "fyne.Size.Max" +Go(*fyne.Size)//min "fyne.Size.Min" +Go(*fyne.Size)//subtract "fyne.Size.Subtract" +Go(*fyne.Size)//subtract-width-height "fyne.Size.SubtractWidthHeight" Go(*fyne.Size)//width! "Set *fyne.Size Width value" Go(*fyne.Size)//width? "Get *fyne.Size Width value" Go(*fyne.StaticResource)//content "(*fyne.StaticResource).Content" @@ -451,6 +481,8 @@ Go(*layout.Spacer)//size "(*layout.Spacer).Size" Go(*layout.Spacer)//visible "(*layout.Spacer).Visible" Go(*mobile.TouchEvent)//absolute-position! "Set *mobile.TouchEvent AbsolutePosition value" Go(*mobile.TouchEvent)//absolute-position? "Get *mobile.TouchEvent AbsolutePosition value" +Go(*mobile.TouchEvent)//point-event! "Set *mobile.TouchEvent PointEvent value" +Go(*mobile.TouchEvent)//point-event? "Get *mobile.TouchEvent PointEvent value" Go(*mobile.TouchEvent)//position! "Set *mobile.TouchEvent Position value" Go(*mobile.TouchEvent)//position? "Get *mobile.TouchEvent Position value" Go(*storage.ExtensionFileFilter)//extensions! "Set *storage.ExtensionFileFilter Extensions value" @@ -476,6 +508,8 @@ Go(*theme.ThemedResource)//content "(*theme.ThemedResource Go(*theme.ThemedResource)//error "(*theme.ThemedResource).Error" Go(*theme.ThemedResource)//name "(*theme.ThemedResource).Name" Go(*widget.Accordion)//append "(*widget.Accordion).Append" +Go(*widget.Accordion)//base-widget! "Set *widget.Accordion BaseWidget value" +Go(*widget.Accordion)//base-widget? "Get *widget.Accordion BaseWidget value" Go(*widget.Accordion)//close "(*widget.Accordion).Close" Go(*widget.Accordion)//close-all "(*widget.Accordion).CloseAll" Go(*widget.Accordion)//create-renderer "(*widget.Accordion).CreateRenderer" @@ -519,9 +553,13 @@ Go(*widget.BaseWidget)//size "(*widget.BaseWidget).S Go(*widget.BaseWidget)//visible "(*widget.BaseWidget).Visible" Go(*widget.Button)//alignment! "Set *widget.Button Alignment value" Go(*widget.Button)//alignment? "Get *widget.Button Alignment value" +Go(*widget.Button)//base-widget! "Set *widget.Button BaseWidget value" +Go(*widget.Button)//base-widget? "Get *widget.Button BaseWidget value" Go(*widget.Button)//create-renderer "(*widget.Button).CreateRenderer" Go(*widget.Button)//cursor "(*widget.Button).Cursor" Go(*widget.Button)//disable "(*widget.Button).Disable" +Go(*widget.Button)//disableable-widget! "Set *widget.Button DisableableWidget value" +Go(*widget.Button)//disableable-widget? "Get *widget.Button DisableableWidget value" Go(*widget.Button)//disabled "(*widget.Button).Disabled" Go(*widget.Button)//enable "(*widget.Button).Enable" Go(*widget.Button)//extend-base-widget "(*widget.Button).ExtendBaseWidget" @@ -556,6 +594,8 @@ Go(*widget.Button)//text? "Get *widget.Button Tex Go(*widget.Button)//typed-key "(*widget.Button).TypedKey" Go(*widget.Button)//typed-rune "(*widget.Button).TypedRune" Go(*widget.Button)//visible "(*widget.Button).Visible" +Go(*widget.Card)//base-widget! "Set *widget.Card BaseWidget value" +Go(*widget.Card)//base-widget? "Get *widget.Card BaseWidget value" Go(*widget.Card)//content! "Set *widget.Card Content value" Go(*widget.Card)//content? "Get *widget.Card Content value" Go(*widget.Card)//create-renderer "(*widget.Card).CreateRenderer" @@ -581,11 +621,15 @@ Go(*widget.Card)//subtitle? "Get *widget.Card Subti Go(*widget.Card)//title! "Set *widget.Card Title value" Go(*widget.Card)//title? "Get *widget.Card Title value" Go(*widget.Card)//visible "(*widget.Card).Visible" +Go(*widget.Check)//base-widget! "Set *widget.Check BaseWidget value" +Go(*widget.Check)//base-widget? "Get *widget.Check BaseWidget value" Go(*widget.Check)//bind "(*widget.Check).Bind" Go(*widget.Check)//checked! "Set *widget.Check Checked value" Go(*widget.Check)//checked? "Get *widget.Check Checked value" Go(*widget.Check)//create-renderer "(*widget.Check).CreateRenderer" Go(*widget.Check)//disable "(*widget.Check).Disable" +Go(*widget.Check)//disableable-widget! "Set *widget.Check DisableableWidget value" +Go(*widget.Check)//disableable-widget? "Get *widget.Check DisableableWidget value" Go(*widget.Check)//disabled "(*widget.Check).Disabled" Go(*widget.Check)//enable "(*widget.Check).Enable" Go(*widget.Check)//extend-base-widget "(*widget.Check).ExtendBaseWidget" @@ -616,8 +660,12 @@ Go(*widget.Check)//typed-rune "(*widget.Check).TypedR Go(*widget.Check)//unbind "(*widget.Check).Unbind" Go(*widget.Check)//visible "(*widget.Check).Visible" Go(*widget.CheckGroup)//append "(*widget.CheckGroup).Append" +Go(*widget.CheckGroup)//base-widget! "Set *widget.CheckGroup BaseWidget value" +Go(*widget.CheckGroup)//base-widget? "Get *widget.CheckGroup BaseWidget value" Go(*widget.CheckGroup)//create-renderer "(*widget.CheckGroup).CreateRenderer" Go(*widget.CheckGroup)//disable "(*widget.CheckGroup).Disable" +Go(*widget.CheckGroup)//disableable-widget! "Set *widget.CheckGroup DisableableWidget value" +Go(*widget.CheckGroup)//disableable-widget? "Get *widget.CheckGroup DisableableWidget value" Go(*widget.CheckGroup)//disabled "(*widget.CheckGroup).Disabled" Go(*widget.CheckGroup)//enable "(*widget.CheckGroup).Enable" Go(*widget.CheckGroup)//extend-base-widget "(*widget.CheckGroup).ExtendBaseWidget" @@ -650,6 +698,8 @@ Go(*widget.CustomTextGridStyle)//bg-color? "Get *widget.CustomText Go(*widget.CustomTextGridStyle)//fg-color! "Set *widget.CustomTextGridStyle FGColor value" Go(*widget.CustomTextGridStyle)//fg-color? "Get *widget.CustomTextGridStyle FGColor value" Go(*widget.CustomTextGridStyle)//text-color "(*widget.CustomTextGridStyle).TextColor" +Go(*widget.DisableableWidget)//base-widget! "Set *widget.DisableableWidget BaseWidget value" +Go(*widget.DisableableWidget)//base-widget? "Get *widget.DisableableWidget BaseWidget value" Go(*widget.DisableableWidget)//disable "(*widget.DisableableWidget).Disable" Go(*widget.DisableableWidget)//disabled "(*widget.DisableableWidget).Disabled" Go(*widget.DisableableWidget)//enable "(*widget.DisableableWidget).Enable" @@ -669,6 +719,8 @@ Go(*widget.Entry)//accepts-tab "(*widget.Entry).Accept Go(*widget.Entry)//action-item! "Set *widget.Entry ActionItem value" Go(*widget.Entry)//action-item? "Get *widget.Entry ActionItem value" Go(*widget.Entry)//append "(*widget.Entry).Append" +Go(*widget.Entry)//base-widget! "Set *widget.Entry BaseWidget value" +Go(*widget.Entry)//base-widget? "Get *widget.Entry BaseWidget value" Go(*widget.Entry)//bind "(*widget.Entry).Bind" Go(*widget.Entry)//create-renderer "(*widget.Entry).CreateRenderer" Go(*widget.Entry)//cursor "(*widget.Entry).Cursor" @@ -677,6 +729,8 @@ Go(*widget.Entry)//cursor-column? "Get *widget.Entry Curs Go(*widget.Entry)//cursor-row! "Set *widget.Entry CursorRow value" Go(*widget.Entry)//cursor-row? "Get *widget.Entry CursorRow value" Go(*widget.Entry)//disable "(*widget.Entry).Disable" +Go(*widget.Entry)//disableable-widget! "Set *widget.Entry DisableableWidget value" +Go(*widget.Entry)//disableable-widget? "Get *widget.Entry DisableableWidget value" Go(*widget.Entry)//disabled "(*widget.Entry).Disabled" Go(*widget.Entry)//double-tapped "(*widget.Entry).DoubleTapped" Go(*widget.Entry)//drag-end "(*widget.Entry).DragEnd" @@ -710,8 +764,6 @@ Go(*widget.Entry)//place-holder? "Get *widget.Entry Plac Go(*widget.Entry)//position "(*widget.Entry).Position" Go(*widget.Entry)//refresh "(*widget.Entry).Refresh" Go(*widget.Entry)//resize "(*widget.Entry).Resize" -Go(*widget.Entry)//scroll! "Set *widget.Entry Scroll value" -Go(*widget.Entry)//scroll? "Get *widget.Entry Scroll value" Go(*widget.Entry)//selected-text "(*widget.Entry).SelectedText" Go(*widget.Entry)//set-min-rows-visible "(*widget.Entry).SetMinRowsVisible" Go(*widget.Entry)//set-on-validation-changed "(*widget.Entry).SetOnValidationChanged" @@ -739,6 +791,8 @@ Go(*widget.Entry)//validator? "Get *widget.Entry Vali Go(*widget.Entry)//visible "(*widget.Entry).Visible" Go(*widget.Entry)//wrapping! "Set *widget.Entry Wrapping value" Go(*widget.Entry)//wrapping? "Get *widget.Entry Wrapping value" +Go(*widget.FileIcon)//base-widget! "Set *widget.FileIcon BaseWidget value" +Go(*widget.FileIcon)//base-widget? "Get *widget.FileIcon BaseWidget value" Go(*widget.FileIcon)//create-renderer "(*widget.FileIcon).CreateRenderer" Go(*widget.FileIcon)//extend-base-widget "(*widget.FileIcon).ExtendBaseWidget" Go(*widget.FileIcon)//hidden! "Set *widget.FileIcon Hidden value" @@ -760,6 +814,8 @@ Go(*widget.FileIcon)//uri? "Get *widget.FileIcon U Go(*widget.FileIcon)//visible "(*widget.FileIcon).Visible" Go(*widget.Form)//append "(*widget.Form).Append" Go(*widget.Form)//append-item "(*widget.Form).AppendItem" +Go(*widget.Form)//base-widget! "Set *widget.Form BaseWidget value" +Go(*widget.Form)//base-widget? "Get *widget.Form BaseWidget value" Go(*widget.Form)//cancel-text! "Set *widget.Form CancelText value" Go(*widget.Form)//cancel-text? "Get *widget.Form CancelText value" Go(*widget.Form)//create-renderer "(*widget.Form).CreateRenderer" @@ -794,6 +850,8 @@ Go(*widget.FormItem)//text! "Set *widget.FormItem T Go(*widget.FormItem)//text? "Get *widget.FormItem Text value" Go(*widget.FormItem)//widget! "Set *widget.FormItem Widget value" Go(*widget.FormItem)//widget? "Get *widget.FormItem Widget value" +Go(*widget.GridWrap)//base-widget! "Set *widget.GridWrap BaseWidget value" +Go(*widget.GridWrap)//base-widget? "Get *widget.GridWrap BaseWidget value" Go(*widget.GridWrap)//create-item! "Set *widget.GridWrap CreateItem value" Go(*widget.GridWrap)//create-item? "Get *widget.GridWrap CreateItem value" Go(*widget.GridWrap)//create-renderer "(*widget.GridWrap).CreateRenderer" @@ -832,6 +890,8 @@ Go(*widget.GridWrap)//update-item? "Get *widget.GridWrap U Go(*widget.GridWrap)//visible "(*widget.GridWrap).Visible" Go(*widget.Hyperlink)//alignment! "Set *widget.Hyperlink Alignment value" Go(*widget.Hyperlink)//alignment? "Get *widget.Hyperlink Alignment value" +Go(*widget.Hyperlink)//base-widget! "Set *widget.Hyperlink BaseWidget value" +Go(*widget.Hyperlink)//base-widget? "Get *widget.Hyperlink BaseWidget value" Go(*widget.Hyperlink)//create-renderer "(*widget.Hyperlink).CreateRenderer" Go(*widget.Hyperlink)//cursor "(*widget.Hyperlink).Cursor" Go(*widget.Hyperlink)//extend-base-widget "(*widget.Hyperlink).ExtendBaseWidget" @@ -882,6 +942,8 @@ Go(*widget.HyperlinkSegment)//update "(*widget.HyperlinkSegm Go(*widget.HyperlinkSegment)//url! "Set *widget.HyperlinkSegment URL value" Go(*widget.HyperlinkSegment)//url? "Get *widget.HyperlinkSegment URL value" Go(*widget.HyperlinkSegment)//visual "(*widget.HyperlinkSegment).Visual" +Go(*widget.Icon)//base-widget! "Set *widget.Icon BaseWidget value" +Go(*widget.Icon)//base-widget? "Get *widget.Icon BaseWidget value" Go(*widget.Icon)//create-renderer "(*widget.Icon).CreateRenderer" Go(*widget.Icon)//extend-base-widget "(*widget.Icon).ExtendBaseWidget" Go(*widget.Icon)//hidden! "Set *widget.Icon Hidden value" @@ -913,6 +975,8 @@ Go(*widget.ImageSegment)//update "(*widget.ImageSegment) Go(*widget.ImageSegment)//visual "(*widget.ImageSegment).Visual" Go(*widget.Label)//alignment! "Set *widget.Label Alignment value" Go(*widget.Label)//alignment? "Get *widget.Label Alignment value" +Go(*widget.Label)//base-widget! "Set *widget.Label BaseWidget value" +Go(*widget.Label)//base-widget? "Get *widget.Label BaseWidget value" Go(*widget.Label)//bind "(*widget.Label).Bind" Go(*widget.Label)//create-renderer "(*widget.Label).CreateRenderer" Go(*widget.Label)//extend-base-widget "(*widget.Label).ExtendBaseWidget" @@ -939,6 +1003,8 @@ Go(*widget.Label)//unbind "(*widget.Label).Unbind Go(*widget.Label)//visible "(*widget.Label).Visible" Go(*widget.Label)//wrapping! "Set *widget.Label Wrapping value" Go(*widget.Label)//wrapping? "Get *widget.Label Wrapping value" +Go(*widget.List)//base-widget! "Set *widget.List BaseWidget value" +Go(*widget.List)//base-widget? "Get *widget.List BaseWidget value" Go(*widget.List)//create-item! "Set *widget.List CreateItem value" Go(*widget.List)//create-item? "Get *widget.List CreateItem value" Go(*widget.List)//create-renderer "(*widget.List).CreateRenderer" @@ -989,6 +1055,8 @@ Go(*widget.ListSegment)//visual "(*widget.ListSegment). Go(*widget.Menu)//activate-last-submenu "(*widget.Menu).ActivateLastSubmenu" Go(*widget.Menu)//activate-next "(*widget.Menu).ActivateNext" Go(*widget.Menu)//activate-previous "(*widget.Menu).ActivatePrevious" +Go(*widget.Menu)//base-widget! "Set *widget.Menu BaseWidget value" +Go(*widget.Menu)//base-widget? "Get *widget.Menu BaseWidget value" Go(*widget.Menu)//create-renderer "(*widget.Menu).CreateRenderer" Go(*widget.Menu)//deactivate-child "(*widget.Menu).DeactivateChild" Go(*widget.Menu)//deactivate-last-submenu "(*widget.Menu).DeactivateLastSubmenu" @@ -1021,6 +1089,8 @@ Go(*widget.ParagraphSegment)//textual "(*widget.ParagraphSegm Go(*widget.ParagraphSegment)//unselect "(*widget.ParagraphSegment).Unselect" Go(*widget.ParagraphSegment)//update "(*widget.ParagraphSegment).Update" Go(*widget.ParagraphSegment)//visual "(*widget.ParagraphSegment).Visual" +Go(*widget.PopUp)//base-widget! "Set *widget.PopUp BaseWidget value" +Go(*widget.PopUp)//base-widget? "Get *widget.PopUp BaseWidget value" Go(*widget.PopUp)//canvas! "Set *widget.PopUp Canvas value" Go(*widget.PopUp)//canvas? "Get *widget.PopUp Canvas value" Go(*widget.PopUp)//content! "Set *widget.PopUp Content value" @@ -1045,6 +1115,8 @@ Go(*widget.PopUp)//visible "(*widget.PopUp).Visibl Go(*widget.PopUpMenu)//activate-last-submenu "(*widget.PopUpMenu).ActivateLastSubmenu" Go(*widget.PopUpMenu)//activate-next "(*widget.PopUpMenu).ActivateNext" Go(*widget.PopUpMenu)//activate-previous "(*widget.PopUpMenu).ActivatePrevious" +Go(*widget.PopUpMenu)//base-widget! "Set *widget.PopUpMenu BaseWidget value" +Go(*widget.PopUpMenu)//base-widget? "Get *widget.PopUpMenu BaseWidget value" Go(*widget.PopUpMenu)//create-renderer "(*widget.PopUpMenu).CreateRenderer" Go(*widget.PopUpMenu)//deactivate-child "(*widget.PopUpMenu).DeactivateChild" Go(*widget.PopUpMenu)//deactivate-last-submenu "(*widget.PopUpMenu).DeactivateLastSubmenu" @@ -1057,6 +1129,8 @@ Go(*widget.PopUpMenu)//hidden? "Get *widget.PopUpMenu Go(*widget.PopUpMenu)//hide "(*widget.PopUpMenu).Hide" Go(*widget.PopUpMenu)//items! "Set *widget.PopUpMenu Items value" Go(*widget.PopUpMenu)//items? "Get *widget.PopUpMenu Items value" +Go(*widget.PopUpMenu)//menu! "Set *widget.PopUpMenu Menu value" +Go(*widget.PopUpMenu)//menu? "Get *widget.PopUpMenu Menu value" Go(*widget.PopUpMenu)//min-size "(*widget.PopUpMenu).MinSize" Go(*widget.PopUpMenu)//move "(*widget.PopUpMenu).Move" Go(*widget.PopUpMenu)//on-dismiss! "Set *widget.PopUpMenu OnDismiss value" @@ -1073,6 +1147,8 @@ Go(*widget.PopUpMenu)//trigger-last "(*widget.PopUpMenu).Tr Go(*widget.PopUpMenu)//typed-key "(*widget.PopUpMenu).TypedKey" Go(*widget.PopUpMenu)//typed-rune "(*widget.PopUpMenu).TypedRune" Go(*widget.PopUpMenu)//visible "(*widget.PopUpMenu).Visible" +Go(*widget.ProgressBar)//base-widget! "Set *widget.ProgressBar BaseWidget value" +Go(*widget.ProgressBar)//base-widget? "Get *widget.ProgressBar BaseWidget value" Go(*widget.ProgressBar)//bind "(*widget.ProgressBar).Bind" Go(*widget.ProgressBar)//create-renderer "(*widget.ProgressBar).CreateRenderer" Go(*widget.ProgressBar)//extend-base-widget "(*widget.ProgressBar).ExtendBaseWidget" @@ -1097,6 +1173,8 @@ Go(*widget.ProgressBar)//unbind "(*widget.ProgressBar). Go(*widget.ProgressBar)//value! "Set *widget.ProgressBar Value value" Go(*widget.ProgressBar)//value? "Get *widget.ProgressBar Value value" Go(*widget.ProgressBar)//visible "(*widget.ProgressBar).Visible" +Go(*widget.ProgressBarInfinite)//base-widget! "Set *widget.ProgressBarInfinite BaseWidget value" +Go(*widget.ProgressBarInfinite)//base-widget? "Get *widget.ProgressBarInfinite BaseWidget value" Go(*widget.ProgressBarInfinite)//create-renderer "(*widget.ProgressBarInfinite).CreateRenderer" Go(*widget.ProgressBarInfinite)//extend-base-widget "(*widget.ProgressBarInfinite).ExtendBaseWidget" Go(*widget.ProgressBarInfinite)//hidden! "Set *widget.ProgressBarInfinite Hidden value" @@ -1114,8 +1192,12 @@ Go(*widget.ProgressBarInfinite)//start "(*widget.ProgressBarIn Go(*widget.ProgressBarInfinite)//stop "(*widget.ProgressBarInfinite).Stop" Go(*widget.ProgressBarInfinite)//visible "(*widget.ProgressBarInfinite).Visible" Go(*widget.RadioGroup)//append "(*widget.RadioGroup).Append" +Go(*widget.RadioGroup)//base-widget! "Set *widget.RadioGroup BaseWidget value" +Go(*widget.RadioGroup)//base-widget? "Get *widget.RadioGroup BaseWidget value" Go(*widget.RadioGroup)//create-renderer "(*widget.RadioGroup).CreateRenderer" Go(*widget.RadioGroup)//disable "(*widget.RadioGroup).Disable" +Go(*widget.RadioGroup)//disableable-widget! "Set *widget.RadioGroup DisableableWidget value" +Go(*widget.RadioGroup)//disableable-widget? "Get *widget.RadioGroup DisableableWidget value" Go(*widget.RadioGroup)//disabled "(*widget.RadioGroup).Disabled" Go(*widget.RadioGroup)//enable "(*widget.RadioGroup).Enable" Go(*widget.RadioGroup)//extend-base-widget "(*widget.RadioGroup).ExtendBaseWidget" @@ -1141,6 +1223,8 @@ Go(*widget.RadioGroup)//set-selected "(*widget.RadioGroup).S Go(*widget.RadioGroup)//show "(*widget.RadioGroup).Show" Go(*widget.RadioGroup)//size "(*widget.RadioGroup).Size" Go(*widget.RadioGroup)//visible "(*widget.RadioGroup).Visible" +Go(*widget.RichText)//base-widget! "Set *widget.RichText BaseWidget value" +Go(*widget.RichText)//base-widget? "Get *widget.RichText BaseWidget value" Go(*widget.RichText)//create-renderer "(*widget.RichText).CreateRenderer" Go(*widget.RichText)//extend-base-widget "(*widget.RichText).ExtendBaseWidget" Go(*widget.RichText)//hidden! "Set *widget.RichText Hidden value" @@ -1152,8 +1236,6 @@ Go(*widget.RichText)//parse-markdown "(*widget.RichText).Par Go(*widget.RichText)//position "(*widget.RichText).Position" Go(*widget.RichText)//refresh "(*widget.RichText).Refresh" Go(*widget.RichText)//resize "(*widget.RichText).Resize" -Go(*widget.RichText)//scroll! "Set *widget.RichText Scroll value" -Go(*widget.RichText)//scroll? "Get *widget.RichText Scroll value" Go(*widget.RichText)//segments! "Set *widget.RichText Segments value" Go(*widget.RichText)//segments? "Get *widget.RichText Segments value" Go(*widget.RichText)//show "(*widget.RichText).Show" @@ -1176,9 +1258,13 @@ Go(*widget.RichTextStyle)//text-style! "Set *widget.RichTextSt Go(*widget.RichTextStyle)//text-style? "Get *widget.RichTextStyle TextStyle value" Go(*widget.Select)//alignment! "Set *widget.Select Alignment value" Go(*widget.Select)//alignment? "Get *widget.Select Alignment value" +Go(*widget.Select)//base-widget! "Set *widget.Select BaseWidget value" +Go(*widget.Select)//base-widget? "Get *widget.Select BaseWidget value" Go(*widget.Select)//clear-selected "(*widget.Select).ClearSelected" Go(*widget.Select)//create-renderer "(*widget.Select).CreateRenderer" Go(*widget.Select)//disable "(*widget.Select).Disable" +Go(*widget.Select)//disableable-widget! "Set *widget.Select DisableableWidget value" +Go(*widget.Select)//disableable-widget? "Get *widget.Select DisableableWidget value" Go(*widget.Select)//disabled "(*widget.Select).Disabled" Go(*widget.Select)//enable "(*widget.Select).Enable" Go(*widget.Select)//extend-base-widget "(*widget.Select).ExtendBaseWidget" @@ -1217,6 +1303,8 @@ Go(*widget.SelectEntry)//accepts-tab "(*widget.SelectEntry). Go(*widget.SelectEntry)//action-item! "Set *widget.SelectEntry ActionItem value" Go(*widget.SelectEntry)//action-item? "Get *widget.SelectEntry ActionItem value" Go(*widget.SelectEntry)//append "(*widget.SelectEntry).Append" +Go(*widget.SelectEntry)//base-widget! "Set *widget.SelectEntry BaseWidget value" +Go(*widget.SelectEntry)//base-widget? "Get *widget.SelectEntry BaseWidget value" Go(*widget.SelectEntry)//bind "(*widget.SelectEntry).Bind" Go(*widget.SelectEntry)//create-renderer "(*widget.SelectEntry).CreateRenderer" Go(*widget.SelectEntry)//cursor "(*widget.SelectEntry).Cursor" @@ -1225,11 +1313,15 @@ Go(*widget.SelectEntry)//cursor-column? "Get *widget.SelectEntr Go(*widget.SelectEntry)//cursor-row! "Set *widget.SelectEntry CursorRow value" Go(*widget.SelectEntry)//cursor-row? "Get *widget.SelectEntry CursorRow value" Go(*widget.SelectEntry)//disable "(*widget.SelectEntry).Disable" +Go(*widget.SelectEntry)//disableable-widget! "Set *widget.SelectEntry DisableableWidget value" +Go(*widget.SelectEntry)//disableable-widget? "Get *widget.SelectEntry DisableableWidget value" Go(*widget.SelectEntry)//disabled "(*widget.SelectEntry).Disabled" Go(*widget.SelectEntry)//double-tapped "(*widget.SelectEntry).DoubleTapped" Go(*widget.SelectEntry)//drag-end "(*widget.SelectEntry).DragEnd" Go(*widget.SelectEntry)//dragged "(*widget.SelectEntry).Dragged" Go(*widget.SelectEntry)//enable "(*widget.SelectEntry).Enable" +Go(*widget.SelectEntry)//entry! "Set *widget.SelectEntry Entry value" +Go(*widget.SelectEntry)//entry? "Get *widget.SelectEntry Entry value" Go(*widget.SelectEntry)//extend-base-widget "(*widget.SelectEntry).ExtendBaseWidget" Go(*widget.SelectEntry)//focus-gained "(*widget.SelectEntry).FocusGained" Go(*widget.SelectEntry)//focus-lost "(*widget.SelectEntry).FocusLost" @@ -1258,8 +1350,6 @@ Go(*widget.SelectEntry)//place-holder? "Get *widget.SelectEntr Go(*widget.SelectEntry)//position "(*widget.SelectEntry).Position" Go(*widget.SelectEntry)//refresh "(*widget.SelectEntry).Refresh" Go(*widget.SelectEntry)//resize "(*widget.SelectEntry).Resize" -Go(*widget.SelectEntry)//scroll! "Set *widget.SelectEntry Scroll value" -Go(*widget.SelectEntry)//scroll? "Get *widget.SelectEntry Scroll value" Go(*widget.SelectEntry)//selected-text "(*widget.SelectEntry).SelectedText" Go(*widget.SelectEntry)//set-min-rows-visible "(*widget.SelectEntry).SetMinRowsVisible" Go(*widget.SelectEntry)//set-on-validation-changed "(*widget.SelectEntry).SetOnValidationChanged" @@ -1288,6 +1378,8 @@ Go(*widget.SelectEntry)//validator? "Get *widget.SelectEntr Go(*widget.SelectEntry)//visible "(*widget.SelectEntry).Visible" Go(*widget.SelectEntry)//wrapping! "Set *widget.SelectEntry Wrapping value" Go(*widget.SelectEntry)//wrapping? "Get *widget.SelectEntry Wrapping value" +Go(*widget.Separator)//base-widget! "Set *widget.Separator BaseWidget value" +Go(*widget.Separator)//base-widget? "Get *widget.Separator BaseWidget value" Go(*widget.Separator)//create-renderer "(*widget.Separator).CreateRenderer" Go(*widget.Separator)//extend-base-widget "(*widget.Separator).ExtendBaseWidget" Go(*widget.Separator)//hidden! "Set *widget.Separator Hidden value" @@ -1308,6 +1400,8 @@ Go(*widget.SeparatorSegment)//textual "(*widget.SeparatorSegm Go(*widget.SeparatorSegment)//unselect "(*widget.SeparatorSegment).Unselect" Go(*widget.SeparatorSegment)//update "(*widget.SeparatorSegment).Update" Go(*widget.SeparatorSegment)//visual "(*widget.SeparatorSegment).Visual" +Go(*widget.Slider)//base-widget! "Set *widget.Slider BaseWidget value" +Go(*widget.Slider)//base-widget? "Get *widget.Slider BaseWidget value" Go(*widget.Slider)//bind "(*widget.Slider).Bind" Go(*widget.Slider)//create-renderer "(*widget.Slider).CreateRenderer" Go(*widget.Slider)//drag-end "(*widget.Slider).DragEnd" @@ -1348,6 +1442,8 @@ Go(*widget.Slider)//unbind "(*widget.Slider).Unbin Go(*widget.Slider)//value! "Set *widget.Slider Value value" Go(*widget.Slider)//value? "Get *widget.Slider Value value" Go(*widget.Slider)//visible "(*widget.Slider).Visible" +Go(*widget.Table)//base-widget! "Set *widget.Table BaseWidget value" +Go(*widget.Table)//base-widget? "Get *widget.Table BaseWidget value" Go(*widget.Table)//create-cell! "Set *widget.Table CreateCell value" Go(*widget.Table)//create-cell? "Get *widget.Table CreateCell value" Go(*widget.Table)//create-header! "Set *widget.Table CreateHeader value" @@ -1414,6 +1510,8 @@ Go(*widget.TableCellID)//col! "Set *widget.TableCellI Go(*widget.TableCellID)//col? "Get *widget.TableCellID Col value" Go(*widget.TableCellID)//row! "Set *widget.TableCellID Row value" Go(*widget.TableCellID)//row? "Get *widget.TableCellID Row value" +Go(*widget.TextGrid)//base-widget! "Set *widget.TextGrid BaseWidget value" +Go(*widget.TextGrid)//base-widget? "Get *widget.TextGrid BaseWidget value" Go(*widget.TextGrid)//create-renderer "(*widget.TextGrid).CreateRenderer" Go(*widget.TextGrid)//extend-base-widget "(*widget.TextGrid).ExtendBaseWidget" Go(*widget.TextGrid)//hidden! "Set *widget.TextGrid Hidden value" @@ -1464,6 +1562,8 @@ Go(*widget.TextSegment)//unselect "(*widget.TextSegment). Go(*widget.TextSegment)//update "(*widget.TextSegment).Update" Go(*widget.TextSegment)//visual "(*widget.TextSegment).Visual" Go(*widget.Toolbar)//append "(*widget.Toolbar).Append" +Go(*widget.Toolbar)//base-widget! "Set *widget.Toolbar BaseWidget value" +Go(*widget.Toolbar)//base-widget? "Get *widget.Toolbar BaseWidget value" Go(*widget.Toolbar)//create-renderer "(*widget.Toolbar).CreateRenderer" Go(*widget.Toolbar)//extend-base-widget "(*widget.Toolbar).ExtendBaseWidget" Go(*widget.Toolbar)//hidden! "Set *widget.Toolbar Hidden value" @@ -1488,6 +1588,8 @@ Go(*widget.ToolbarAction)//set-icon "(*widget.ToolbarAction Go(*widget.ToolbarAction)//toolbar-object "(*widget.ToolbarAction).ToolbarObject" Go(*widget.ToolbarSeparator)//toolbar-object "(*widget.ToolbarSeparator).ToolbarObject" Go(*widget.ToolbarSpacer)//toolbar-object "(*widget.ToolbarSpacer).ToolbarObject" +Go(*widget.Tree)//base-widget! "Set *widget.Tree BaseWidget value" +Go(*widget.Tree)//base-widget? "Get *widget.Tree BaseWidget value" Go(*widget.Tree)//child-ui-ds! "Set *widget.Tree ChildUIDs value" Go(*widget.Tree)//child-ui-ds? "Get *widget.Tree ChildUIDs value" Go(*widget.Tree)//close-all-branches "(*widget.Tree).CloseAllBranches" @@ -2047,8 +2149,6 @@ Go(fyne.CloudProvider)//provider-name "fyne.CloudProvider.Pro Go(fyne.CloudProvider)//setup "fyne.CloudProvider.Setup" Go(fyne.CloudProviderPreferences)//cloud-preferences "fyne.CloudProviderPreferences.CloudPreferences" Go(fyne.CloudProviderStorage)//cloud-storage "fyne.CloudProviderStorage.CloudStorage" -Go(fyne.Delta)//components "fyne.Delta.Components" -Go(fyne.Delta)//is-zero "fyne.Delta.IsZero" Go(fyne.Device)//has-keyboard "fyne.Device.HasKeyboard" Go(fyne.Device)//is-browser "fyne.Device.IsBrowser" Go(fyne.Device)//is-mobile "fyne.Device.IsMobile" @@ -2118,12 +2218,6 @@ Go(fyne.OverlayStack)//add "fyne.OverlayStack.Add" Go(fyne.OverlayStack)//list "fyne.OverlayStack.List" Go(fyne.OverlayStack)//remove "fyne.OverlayStack.Remove" Go(fyne.OverlayStack)//top "fyne.OverlayStack.Top" -Go(fyne.Position)//add "fyne.Position.Add" -Go(fyne.Position)//add-xy "fyne.Position.AddXY" -Go(fyne.Position)//components "fyne.Position.Components" -Go(fyne.Position)//is-zero "fyne.Position.IsZero" -Go(fyne.Position)//subtract "fyne.Position.Subtract" -Go(fyne.Position)//subtract-xy "fyne.Position.SubtractXY" Go(fyne.Preferences)//add-change-listener "fyne.Preferences.AddChangeListener" Go(fyne.Preferences)//bool "fyne.Preferences.Bool" Go(fyne.Preferences)//bool-list "fyne.Preferences.BoolList" @@ -2165,14 +2259,6 @@ Go(fyne.Settings)//theme "fyne.Settings.Theme" Go(fyne.Settings)//theme-variant "fyne.Settings.ThemeVariant" Go(fyne.Shortcut)//shortcut-name "fyne.Shortcut.ShortcutName" Go(fyne.Shortcutable)//typed-shortcut "fyne.Shortcutable.TypedShortcut" -Go(fyne.Size)//add "fyne.Size.Add" -Go(fyne.Size)//add-width-height "fyne.Size.AddWidthHeight" -Go(fyne.Size)//components "fyne.Size.Components" -Go(fyne.Size)//is-zero "fyne.Size.IsZero" -Go(fyne.Size)//max "fyne.Size.Max" -Go(fyne.Size)//min "fyne.Size.Min" -Go(fyne.Size)//subtract "fyne.Size.Subtract" -Go(fyne.Size)//subtract-width-height "fyne.Size.SubtractWidthHeight" Go(fyne.Storage)//create "fyne.Storage.Create" Go(fyne.Storage)//list "fyne.Storage.List" Go(fyne.Storage)//open "fyne.Storage.Open" diff --git a/generate/config.toml b/fyne/config.toml similarity index 81% rename from generate/config.toml rename to fyne/config.toml index a7f7ea3..03bfacf 100644 --- a/generate/config.toml +++ b/fyne/config.toml @@ -7,8 +7,8 @@ version = "v2.4.4" # Auto-remove "New" part of functions (e.g. widget.NewLabel => widget-label, app.New => app). cut-new = true -## Require a build flag to enable binding (optional). -#build-flag = "b_mygolib" +# Add a build flag to exclude the binding (optional). +dont-build-flag = "b_no_fyne" # Descending priority. Packages not listed will always be prefixed. # In case of conflicting function names, only the function from the @@ -26,3 +26,6 @@ no-prefix = [ # ["my-fyne", "fyne.io/fyne/v2"], # ["my-widget", "fyne.io/fyne/v2/widget"], #] + +## Generate bindings for selected parts of the go standard library. +#include-std-libs = ["image"] diff --git a/generate/gen.go b/fyne/gen.go similarity index 100% rename from generate/gen.go rename to fyne/gen.go diff --git a/go.mod b/go.mod index dcb1e54..d754ba5 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/refaktor/rye-front -go 1.22.0 +go 1.23 // toolchain go1.23.0 @@ -11,8 +11,8 @@ replace github.com/refaktor/rye => ../rye require ( fyne.io/fyne/v2 v2.4.4 github.com/hajimehoshi/ebiten/v2 v2.6.3 - github.com/refaktor/rye v0.0.23 - github.com/refaktor/ryegen v0.1.0 + github.com/refaktor/rye v0.0.25-0.20241008135859-3e401118b002 + github.com/refaktor/ryegen v0.1.1-0.20241009014844-8c047bebf475 github.com/webview/webview_go v0.0.0-20230901181450-5a14030a9070 ) @@ -22,24 +22,24 @@ require ( github.com/BurntSushi/toml v1.4.0 // indirect github.com/RoaringBitmap/roaring v1.9.3 // indirect github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be // indirect - github.com/aws/aws-sdk-go-v2 v1.30.5 // indirect - github.com/aws/aws-sdk-go-v2/config v1.27.33 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.17.32 // indirect - github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.13 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.17 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.17 // indirect + github.com/aws/aws-sdk-go-v2 v1.31.0 // indirect + github.com/aws/aws-sdk-go-v2/config v1.27.39 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.17.37 // indirect + github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.14 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.18 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.18 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.19 // indirect - github.com/aws/aws-sdk-go-v2/service/ses v1.26.2 // indirect - github.com/aws/aws-sdk-go-v2/service/sso v1.22.7 // indirect - github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.7 // indirect - github.com/aws/aws-sdk-go-v2/service/sts v1.30.7 // indirect - github.com/aws/smithy-go v1.20.4 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.5 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.20 // indirect + github.com/aws/aws-sdk-go-v2/service/ses v1.27.3 // indirect + github.com/aws/aws-sdk-go-v2/service/sso v1.23.3 // indirect + github.com/aws/aws-sdk-go-v2/service/ssooidc v1.27.3 // indirect + github.com/aws/aws-sdk-go-v2/service/sts v1.31.3 // indirect + github.com/aws/smithy-go v1.21.0 // indirect github.com/bitfield/script v0.23.0 // indirect github.com/bits-and-blooms/bitset v1.12.0 // indirect github.com/blevesearch/bleve/v2 v2.4.2 // indirect - github.com/blevesearch/bleve_index_api v1.1.11 // indirect + github.com/blevesearch/bleve_index_api v1.1.12 // indirect github.com/blevesearch/geo v0.1.20 // indirect github.com/blevesearch/go-faiss v1.0.20 // indirect github.com/blevesearch/go-porterstemmer v1.0.3 // indirect @@ -83,7 +83,7 @@ require ( github.com/golang/snappy v0.0.4 // indirect github.com/gopherjs/gopherjs v1.17.2 // indirect github.com/gorilla/securecookie v1.1.2 // indirect - github.com/gorilla/sessions v1.3.0 // indirect + github.com/gorilla/sessions v1.4.0 // indirect github.com/iancoleman/strcase v0.3.0 // indirect github.com/itchyny/gojq v0.12.13 // indirect github.com/itchyny/timefmt-go v0.1.5 // indirect @@ -100,7 +100,7 @@ require ( github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.16 // indirect - github.com/mattn/go-sqlite3 v1.14.22 // indirect + github.com/mattn/go-sqlite3 v1.14.23 // indirect github.com/mhale/smtpd v0.8.3 // indirect github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 // indirect github.com/modern-go/reflect2 v1.0.1 // indirect @@ -112,7 +112,7 @@ require ( github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect github.com/refaktor/go-peg v0.0.0-20220116201714-31e3dfa8dc7d // indirect github.com/rivo/uniseg v0.4.4 // indirect - github.com/sashabaranov/go-openai v1.29.0 // indirect + github.com/sashabaranov/go-openai v1.31.0 // indirect github.com/shirou/gopsutil/v3 v3.24.5 // indirect github.com/shoenig/go-m1cpu v0.1.6 // indirect github.com/srwiley/oksvg v0.0.0-20221011165216-be6e8873101c // indirect @@ -128,18 +128,18 @@ require ( github.com/yuin/goldmark v1.5.5 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.etcd.io/bbolt v1.3.7 // indirect - go.mongodb.org/mongo-driver v1.16.1 // indirect - golang.org/x/crypto v0.26.0 // indirect + go.mongodb.org/mongo-driver v1.17.0 // indirect + golang.org/x/crypto v0.27.0 // indirect golang.org/x/exp/shiny v0.0.0-20230817173708-d852ddb80c63 // indirect golang.org/x/image v0.12.0 // indirect golang.org/x/mobile v0.0.0-20230922142353-e2f452493d57 // indirect golang.org/x/mod v0.21.0 // indirect - golang.org/x/net v0.28.0 // indirect + golang.org/x/net v0.29.0 // indirect golang.org/x/sync v0.8.0 // indirect - golang.org/x/sys v0.23.0 // indirect - golang.org/x/term v0.23.0 // indirect - golang.org/x/text v0.17.0 // indirect - google.golang.org/protobuf v1.26.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/term v0.24.0 // indirect + golang.org/x/text v0.18.0 // indirect + google.golang.org/protobuf v1.33.0 // indirect gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/go.sum b/go.sum index 84f277d..5a4b4ed 100644 --- a/go.sum +++ b/go.sum @@ -55,34 +55,34 @@ github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kd github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/aws/aws-sdk-go-v2 v1.30.5 h1:mWSRTwQAb0aLE17dSzztCVJWI9+cRMgqebndjwDyK0g= -github.com/aws/aws-sdk-go-v2 v1.30.5/go.mod h1:CT+ZPWXbYrci8chcARI3OmI/qgd+f6WtuLOoaIA8PR0= -github.com/aws/aws-sdk-go-v2/config v1.27.33 h1:Nof9o/MsmH4oa0s2q9a0k7tMz5x/Yj5k06lDODWz3BU= -github.com/aws/aws-sdk-go-v2/config v1.27.33/go.mod h1:kEqdYzRb8dd8Sy2pOdEbExTTF5v7ozEXX0McgPE7xks= -github.com/aws/aws-sdk-go-v2/credentials v1.17.32 h1:7Cxhp/BnT2RcGy4VisJ9miUPecY+lyE9I8JvcZofn9I= -github.com/aws/aws-sdk-go-v2/credentials v1.17.32/go.mod h1:P5/QMF3/DCHbXGEGkdbilXHsyTBX5D3HSwcrSc9p20I= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.13 h1:pfQ2sqNpMVK6xz2RbqLEL0GH87JOwSxPV2rzm8Zsb74= -github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.13/go.mod h1:NG7RXPUlqfsCLLFfi0+IpKN4sCB9D9fw/qTaSB+xRoU= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.17 h1:pI7Bzt0BJtYA0N/JEC6B8fJ4RBrEMi1LBrkMdFYNSnQ= -github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.17/go.mod h1:Dh5zzJYMtxfIjYW+/evjQ8uj2OyR/ve2KROHGHlSFqE= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.17 h1:Mqr/V5gvrhA2gvgnF42Zh5iMiQNcOYthFYwCyrnuWlc= -github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.17/go.mod h1:aLJpZlCmjE+V+KtN1q1uyZkfnUWpQGpbsn89XPKyzfU= +github.com/aws/aws-sdk-go-v2 v1.31.0 h1:3V05LbxTSItI5kUqNwhJrrrY1BAXxXt0sN0l72QmG5U= +github.com/aws/aws-sdk-go-v2 v1.31.0/go.mod h1:ztolYtaEUtdpf9Wftr31CJfLVjOnD/CVRkKOOYgF8hA= +github.com/aws/aws-sdk-go-v2/config v1.27.39 h1:FCylu78eTGzW1ynHcongXK9YHtoXD5AiiUqq3YfJYjU= +github.com/aws/aws-sdk-go-v2/config v1.27.39/go.mod h1:wczj2hbyskP4LjMKBEZwPRO1shXY+GsQleab+ZXT2ik= +github.com/aws/aws-sdk-go-v2/credentials v1.17.37 h1:G2aOH01yW8X373JK419THj5QVqu9vKEwxSEsGxihoW0= +github.com/aws/aws-sdk-go-v2/credentials v1.17.37/go.mod h1:0ecCjlb7htYCptRD45lXJ6aJDQac6D2NlKGpZqyTG6A= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.14 h1:C/d03NAmh8C4BZXhuRNboF/DqhBkBCeDiJDcaqIT5pA= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.14/go.mod h1:7I0Ju7p9mCIdlrfS+JCgqcYD0VXz/N4yozsox+0o078= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.18 h1:kYQ3H1u0ANr9KEKlGs/jTLrBFPo8P8NaH/w7A01NeeM= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.18/go.mod h1:r506HmK5JDUh9+Mw4CfGJGSSoqIiLCndAuqXuhbv67Y= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.18 h1:Z7IdFUONvTcvS7YuhtVxN99v2cCoHRXOS4mTr0B/pUc= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.18/go.mod h1:DkKMmksZVVyat+Y+r1dEOgJEfUeA7UngIHWeKsi0yNc= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1 h1:VaRN3TlFdd6KxX1x3ILT5ynH6HvKgqdiXoTxAF4HQcQ= github.com/aws/aws-sdk-go-v2/internal/ini v1.8.1/go.mod h1:FbtygfRFze9usAadmnGJNc8KsP346kEe+y2/oyhGAGc= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4 h1:KypMCbLPPHEmf9DgMGw51jMj77VfGPAN2Kv4cfhlfgI= -github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.4/go.mod h1:Vz1JQXliGcQktFTN/LN6uGppAIRoLBR2bMvIMP0gOjc= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.19 h1:rfprUlsdzgl7ZL2KlXiUAoJnI/VxfHCvDFr2QDFj6u4= -github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.19/go.mod h1:SCWkEdRq8/7EK60NcvvQ6NXKuTcchAD4ROAsC37VEZE= -github.com/aws/aws-sdk-go-v2/service/ses v1.26.2 h1:hGWgo0Ckz68QbnzET2ZlirsgIhSwa055Nlhbosr2944= -github.com/aws/aws-sdk-go-v2/service/ses v1.26.2/go.mod h1:PS2N1JNb+LsgIQA7Iu8PyoXWOUC5HAbt3esVYzWdVEg= -github.com/aws/aws-sdk-go-v2/service/sso v1.22.7 h1:pIaGg+08llrP7Q5aiz9ICWbY8cqhTkyy+0SHvfzQpTc= -github.com/aws/aws-sdk-go-v2/service/sso v1.22.7/go.mod h1:eEygMHnTKH/3kNp9Jr1n3PdejuSNcgwLe1dWgQtO0VQ= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.7 h1:/Cfdu0XV3mONYKaOt1Gr0k1KvQzkzPyiKUdlWJqy+J4= -github.com/aws/aws-sdk-go-v2/service/ssooidc v1.26.7/go.mod h1:bCbAxKDqNvkHxRaIMnyVPXPo+OaPRwvmgzMxbz1VKSA= -github.com/aws/aws-sdk-go-v2/service/sts v1.30.7 h1:NKTa1eqZYw8tiHSRGpP0VtTdub/8KNk8sDkNPFaOKDE= -github.com/aws/aws-sdk-go-v2/service/sts v1.30.7/go.mod h1:NXi1dIAGteSaRLqYgarlhP/Ij0cFT+qmCwiJqWh/U5o= -github.com/aws/smithy-go v1.20.4 h1:2HK1zBdPgRbjFOHlfeQZfpC4r72MOb9bZkiFwggKO+4= -github.com/aws/smithy-go v1.20.4/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.5 h1:QFASJGfT8wMXtuP3D5CRmMjARHv9ZmzFUMJznHDOY3w= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.5/go.mod h1:QdZ3OmoIjSX+8D1OPAzPxDfjXASbBMDsz9qvtyIhtik= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.20 h1:Xbwbmk44URTiHNx6PNo0ujDE6ERlsCKJD3u1zfnzAPg= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.11.20/go.mod h1:oAfOFzUB14ltPZj1rWwRc3d/6OgD76R8KlvU3EqM9Fg= +github.com/aws/aws-sdk-go-v2/service/ses v1.27.3 h1:i7k9FzwUfv9seln228iz+69OyXZ0FMqhwotSeAlRC7A= +github.com/aws/aws-sdk-go-v2/service/ses v1.27.3/go.mod h1:WJjeWePq/vToxtM4fKbGHiXvInPARrWn8XJ0NOu4KtY= +github.com/aws/aws-sdk-go-v2/service/sso v1.23.3 h1:rs4JCczF805+FDv2tRhZ1NU0RB2H6ryAvsWPanAr72Y= +github.com/aws/aws-sdk-go-v2/service/sso v1.23.3/go.mod h1:XRlMvmad0ZNL+75C5FYdMvbbLkd6qiqz6foR1nA1PXY= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.27.3 h1:S7EPdMVZod8BGKQQPTBK+FcX9g7bKR7c4+HxWqHP7Vg= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.27.3/go.mod h1:FnvDM4sfa+isJ3kDXIzAB9GAwVSzFzSy97uZ3IsHo4E= +github.com/aws/aws-sdk-go-v2/service/sts v1.31.3 h1:VzudTFrDCIDakXtemR7l6Qzt2+JYsVqo2MxBPt5k8T8= +github.com/aws/aws-sdk-go-v2/service/sts v1.31.3/go.mod h1:yMWe0F+XG0DkRZK5ODZhG7BEFYhLXi2dqGsv6tX0cgI= +github.com/aws/smithy-go v1.21.0 h1:H7L8dtDRk0P1Qm6y0ji7MCYMQObJ5R9CRpyPhRUkLYA= +github.com/aws/smithy-go v1.21.0/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bitfield/script v0.23.0 h1:N0R5yLEl6wJIS9PR/A6xXwjMsplMubyxdi05N5l0X28= github.com/bitfield/script v0.23.0/go.mod h1:fv+6x4OzVsRs6qAlc7wiGq8fq1b5orhtQdtW0dwjUHI= @@ -91,8 +91,8 @@ github.com/bits-and-blooms/bitset v1.12.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6 github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= github.com/blevesearch/bleve/v2 v2.4.2 h1:NooYP1mb3c0StkiY9/xviiq2LGSaE8BQBCc/pirMx0U= github.com/blevesearch/bleve/v2 v2.4.2/go.mod h1:ATNKj7Yl2oJv/lGuF4kx39bST2dveX6w0th2FFYLkc8= -github.com/blevesearch/bleve_index_api v1.1.11 h1:OTNpRnxPWFIhMSgBUBlkD7RVWYrfsojtQeACb8tGGpw= -github.com/blevesearch/bleve_index_api v1.1.11/go.mod h1:PbcwjIcRmjhGbkS/lJCpfgVSMROV6TRubGGAODaK1W8= +github.com/blevesearch/bleve_index_api v1.1.12 h1:P4bw9/G/5rulOF7SJ9l4FsDoo7UFJ+5kexNy1RXfegY= +github.com/blevesearch/bleve_index_api v1.1.12/go.mod h1:PbcwjIcRmjhGbkS/lJCpfgVSMROV6TRubGGAODaK1W8= github.com/blevesearch/geo v0.1.20 h1:paaSpu2Ewh/tn5DKn/FB5SzvH0EWupxHEIwbCk/QPqM= github.com/blevesearch/geo v0.1.20/go.mod h1:DVG2QjwHNMFmjo+ZgzrIq2sfCh6rIHzy9d9d0B59I6w= github.com/blevesearch/go-faiss v1.0.20 h1:AIkdTQFWuZ5LQmKQSebgMR4RynGNw8ZseJXaan5kvtI= @@ -280,8 +280,8 @@ github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25d github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k= github.com/gorilla/securecookie v1.1.2 h1:YCIWL56dvtr73r6715mJs5ZvhtnY73hBvEF8kXD8ePA= github.com/gorilla/securecookie v1.1.2/go.mod h1:NfCASbcHqRSY+3a8tlWJwsQap2VX5pwzwo4h3eOamfo= -github.com/gorilla/sessions v1.3.0 h1:XYlkq7KcpOB2ZhHBPv5WpjMIxrQosiZanfoy1HLZFzg= -github.com/gorilla/sessions v1.3.0/go.mod h1:ePLdVu+jbEgHH+KWw8I1z2wqd0BAdAQh/8LRvBeoNcQ= +github.com/gorilla/sessions v1.4.0 h1:kpIYOp/oi6MG/p5PgxApU8srsSw9tuFbt46Lt7auzqQ= +github.com/gorilla/sessions v1.4.0/go.mod h1:FLWm50oby91+hl7p/wRxDth9bWSuk0qVL2emc7lT5ik= github.com/goxjs/gl v0.0.0-20210104184919-e3fafc6f8f2a/go.mod h1:dy/f2gjY09hwVfIyATps4G2ai7/hLwLkc5TrPqONuXY= github.com/goxjs/glfw v0.0.0-20191126052801-d2efb5f20838/go.mod h1:oS8P8gVOT4ywTcjV6wZlOU4GuVFQ8F5328KY3MJ79CY= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= @@ -363,8 +363,8 @@ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= -github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= -github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= +github.com/mattn/go-sqlite3 v1.14.23 h1:gbShiuAP1W5j9UOksQ06aiiqPMxYecovVGwmTxWtuw0= +github.com/mattn/go-sqlite3 v1.14.23/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= github.com/mhale/smtpd v0.8.3 h1:8j8YNXajksoSLZja3HdwvYVZPuJSqAxFsib3adzRRt8= github.com/mhale/smtpd v0.8.3/go.mod h1:MQl+y2hwIEQCXtNhe5+55n0GZOjSmeqORDIXbqUL3x4= github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= @@ -403,8 +403,10 @@ github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c/go.mod h1:Om github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/refaktor/go-peg v0.0.0-20220116201714-31e3dfa8dc7d h1:FXrWUGgPRzhaZIBho8zNLSrMp0VpP8E9+wbRRnJYlbE= github.com/refaktor/go-peg v0.0.0-20220116201714-31e3dfa8dc7d/go.mod h1:iIkrsFobLIWX8kQ6Oqj4cl4nwdMSE92DWpWwk9YlG9s= -github.com/refaktor/ryegen v0.1.0 h1:g74xYZHv5vnkRn+gV3Hy/28OYqi9DrnXeZzXhNF7zTk= -github.com/refaktor/ryegen v0.1.0/go.mod h1:e0SC24+QY8gh/mI/7r6jaU6MNRfC3JcnJv1RUQDJHHY= +github.com/refaktor/rye v0.0.25-0.20241008135859-3e401118b002 h1:V8GuMwY5zsjEOWL20qpBm5o5guyfuDZC0ILkZTM98n8= +github.com/refaktor/rye v0.0.25-0.20241008135859-3e401118b002/go.mod h1:2mL6Wyva2nCWnv4xmzKkOsG2QEF9vVVSG86kx3AIps4= +github.com/refaktor/ryegen v0.1.1-0.20241009014844-8c047bebf475 h1:vymsRlqNO+ULfTD6vyFg+0PUBVRAyf/cNppnLdR0HsI= +github.com/refaktor/ryegen v0.1.1-0.20241009014844-8c047bebf475/go.mod h1:e0SC24+QY8gh/mI/7r6jaU6MNRfC3JcnJv1RUQDJHHY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis= github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= @@ -414,8 +416,8 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= -github.com/sashabaranov/go-openai v1.29.0 h1:eBH6LSjtX4md5ImDCX8hNhHQvaRf22zujiERoQpsvLo= -github.com/sashabaranov/go-openai v1.29.0/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg= +github.com/sashabaranov/go-openai v1.31.0 h1:rGe77x7zUeCjtS2IS7NCY6Tp4bQviXNMhkQM6hz/UC4= +github.com/sashabaranov/go-openai v1.31.0/go.mod h1:lj5b/K+zjTSFxVLijLSTDZuP7adOgerWeFyZLUhAKRg= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/shirou/gopsutil/v3 v3.24.5 h1:i0t8kL+kQTvpAYToeuiVk3TgDeKOFioZO3Ztz/iZ9pI= github.com/shirou/gopsutil/v3 v3.24.5/go.mod h1:bsoOS1aStSs9ErQ1WWfxllSeS1K5D+U30r2NfcubMVk= @@ -486,8 +488,8 @@ go.etcd.io/bbolt v1.3.7/go.mod h1:N9Mkw9X8x5fupy0IKsmuqVtoGDyxsaDlbk4Rd05IAQw= go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= -go.mongodb.org/mongo-driver v1.16.1 h1:rIVLL3q0IHM39dvE+z2ulZLp9ENZKThVfuvN/IiN4l8= -go.mongodb.org/mongo-driver v1.16.1/go.mod h1:oB6AhJQvFQL4LEHyXi6aJzQJtBiTQHiAd83l0GdFaiw= +go.mongodb.org/mongo-driver v1.17.0 h1:Hp4q2MCjvY19ViwimTs00wHi7G4yzxh4/2+nTx8r40k= +go.mongodb.org/mongo-driver v1.17.0/go.mod h1:wwWm/+BuOddhcq3n68LKRmgk2wXzmF6s0SFOa0GINL4= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -509,8 +511,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw= -golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54= +golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A= +golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -597,8 +599,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= -golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -679,13 +681,13 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.23.0 h1:YfKFowiIMvtgl1UERQoTPPToxltDeZfbj4H7dVUCwmM= -golang.org/x/sys v0.23.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.23.0 h1:F6D4vR+EHoL9/sWAWgAR1H2DcHr4PareCbAaCo1RpuU= -golang.org/x/term v0.23.0/go.mod h1:DgV24QBUrK6jhZXl+20l6UWznPlwAHm1Q1mGHtydmSk= +golang.org/x/term v0.24.0 h1:Mh5cbb+Zk2hqqXNO7S1iTjEphVL+jb8ZWaqh/g+JWkM= +golang.org/x/term v0.24.0/go.mod h1:lOBK/LVxemqiMij05LGJ0tzNr8xlmwBRJ81PX6wVLH8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -697,8 +699,8 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc= -golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -864,8 +866,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk= gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=