func TestCheckCallExprNoArgIntIntTyped(t *testing.T) {
	type I int
	is := []int{1, 2, 3}
	f := func(int, bool) int { return 1 }
	ft := func(I, bool) int { return 1 }
	v1 := func(...int) int { return 1 }
	v2 := func(int, ...int) int { return 1 }
	vt := func(I, ...I) int { return 1 }
	e := func() {}
	s := func() int { return 1}
	m := func() (int, int) { return 1, 1 }
	mt := func() (int, I) { return 1, 1 }
	env := MakeSimpleEnv()
	env.Types["I"] = reflect.TypeOf(I(0))
	env.Vars["is"] = reflect.ValueOf(&is)
	env.Funcs["f"] = reflect.ValueOf(f)
	env.Funcs["ft"] = reflect.ValueOf(ft)
	env.Funcs["v1"] = reflect.ValueOf(v1)
	env.Funcs["v2"] = reflect.ValueOf(v2)
	env.Funcs["vt"] = reflect.ValueOf(vt)
	env.Funcs["e"] = reflect.ValueOf(e)
	env.Funcs["s"] = reflect.ValueOf(s)
	env.Funcs["m"] = reflect.ValueOf(m)
	env.Funcs["mt"] = reflect.ValueOf(mt)
	expectCheckError(t, `s(1, I(1))`, env,
		`too many arguments in call to s`,
	)
}
Test NoArg(1, I(1))
package eval
import (
	"testing"
	"reflect"
)
func TestCheckCallExprNoArgXX(t *testing.T) {
	type I int
	is := []int{1, 2, 3}
	f := func(int, bool) int { return 1 }
	ft := func(I, bool) int { return 1 }
	v1 := func(...int) int { return 1 }
	v2 := func(int, ...int) int { return 1 }
	vt := func(I, ...I) int { return 1 }
	e := func() {}
	s := func() int { return 1}
	m := func() (int, int) { return 1, 1 }
	mt := func() (int, I) { return 1, 1 }
	env := MakeSimpleEnv()
	env.Types["I"] = reflect.TypeOf(I(0))
	env.Vars["is"] = reflect.ValueOf(&is)
	env.Funcs["f"] = reflect.ValueOf(f)
	env.Funcs["ft"] = reflect.ValueOf(ft)
	env.Funcs["v1"] = reflect.ValueOf(v1)
	env.Funcs["v2"] = reflect.ValueOf(v2)
	env.Funcs["vt"] = reflect.ValueOf(vt)
	env.Funcs["e"] = reflect.ValueOf(e)
	env.Funcs["s"] = reflect.ValueOf(s)
	env.Funcs["m"] = reflect.ValueOf(m)
	env.Funcs["mt"] = reflect.ValueOf(mt)
	expectType(t, `s()`, env, reflect.TypeOf(s()))
}
func TestCheckCallExprNoArgXInt(t *testing.T) {
	type I int
	is := []int{1, 2, 3}
	f := func(int, bool) int { return 1 }
	ft := func(I, bool) int { return 1 }
	v1 := func(...int) int { return 1 }
	v2 := func(int, ...int) int { return 1 }
	vt := func(I, ...I) int { return 1 }
	e := func() {}
	s := func() int { return 1}
	m := func() (int, int) { return 1, 1 }
	mt := func() (int, I) { return 1, 1 }
	env := MakeSimpleEnv()
	env.Types["I"] = reflect.TypeOf(I(0))
	env.Vars["is"] = reflect.ValueOf(&is)
	env.Funcs["f"] = reflect.ValueOf(f)
	env.Funcs["ft"] = reflect.ValueOf(ft)
	env.Funcs["v1"] = reflect.ValueOf(v1)
	env.Funcs["v2"] = reflect.ValueOf(v2)
	env.Funcs["vt"] = reflect.ValueOf(vt)
	env.Funcs["e"] = reflect.ValueOf(e)
	env.Funcs["s"] = reflect.ValueOf(s)
	env.Funcs["m"] = reflect.ValueOf(m)
	env.Funcs["mt"] = reflect.ValueOf(mt)
	expectCheckError(t, `s(1)`, env,
		`too many arguments in call to s`,
	)
}
func TestCheckCallExprNoArgXFloat(t *testing.T) {
	type I int
	is := []int{1, 2, 3}
	f := func(int, bool) int { return 1 }
	ft := func(I, bool) int { return 1 }
	v1 := func(...int) int { return 1 }
	v2 := func(int, ...int) int { return 1 }
	vt := func(I, ...I) int { return 1 }
	e := func() {}
	s := func() int { return 1}
	m := func() (int, int) { return 1, 1 }
	mt := func() (int, I) { return 1, 1 }
	env := MakeSimpleEnv()
	env.Types["I"] = reflect.TypeOf(I(0))
	env.Vars["is"] = reflect.ValueOf(&is)
	env.Funcs["f"] = reflect.ValueOf(f)
	env.Funcs["ft"] = reflect.ValueOf(ft)
	env.Funcs["v1"] = reflect.ValueOf(v1)
	env.Funcs["v2"] = reflect.ValueOf(v2)
	env.Funcs["vt"] = reflect.ValueOf(vt)
	env.Funcs["e"] = reflect.ValueOf(e)
	env.Funcs["s"] = reflect.ValueOf(s)
	env.Funcs["m"] = reflect.ValueOf(m)
	env.Funcs["mt"] = reflect.ValueOf(mt)
	expectCheckError(t, `s(1.5)`, env,
		`too many arguments in call to s`,
	)
}
func TestCheckCallExprNoArgXBool(t *testing.T) {
	type I int
	is := []int{1, 2, 3}
	f := func(int, bool) int { return 1 }
	ft := func(I, bool) int { return 1 }
	v1 := func(...int) int { return 1 }
	v2 := func(int, ...int) int { return 1 }
	vt := func(I, ...I) int { return 1 }
	e := func() {}
	s := func() int { return 1}
	m := func() (int, int) { return 1, 1 }
	mt := func() (int, I) { return 1, 1 }
	env := MakeSimpleEnv()
	env.Types["I"] = reflect.TypeOf(I(0))
	env.Vars["is"] = reflect.ValueOf(&is)
	env.Funcs["f"] = reflect.ValueOf(f)
	env.Funcs["ft"] = reflect.ValueOf(ft)
	env.Funcs["v1"] = reflect.ValueOf(v1)
	env.Funcs["v2"] = reflect.ValueOf(v2)
	env.Funcs["vt"] = reflect.ValueOf(vt)
	env.Funcs["e"] = reflect.ValueOf(e)
	env.Funcs["s"] = reflect.ValueOf(s)
	env.Funcs["m"] = reflect.ValueOf(m)
	env.Funcs["mt"] = reflect.ValueOf(mt)
	expectCheckError(t, `s(true)`, env,
		`too many arguments in call to s`,
	)
}
func TestCheckCallExprNoArgXIntTyped(t *testing.T) {
	type I int
	is := []int{1, 2, 3}
	f := func(int, bool) int { return 1 }
	ft := func(I, bool) int { return 1 }
	v1 := func(...int) int { return 1 }
	v2 := func(int, ...int) int { return 1 }
	vt := func(I, ...I) int { return 1 }
	e := func() {}
	s := func() int { return 1}
	m := func() (int, int) { return 1, 1 }
	mt := func() (int, I) { return 1, 1 }
	env := MakeSimpleEnv()
	env.Types["I"] = reflect.TypeOf(I(0))
	env.Vars["is"] = reflect.ValueOf(&is)
	env.Funcs["f"] = reflect.ValueOf(f)
	env.Funcs["ft"] = reflect.ValueOf(ft)
	env.Funcs["v1"] = reflect.ValueOf(v1)
	env.Funcs["v2"] = reflect.ValueOf(v2)
	env.Funcs["vt"] = reflect.ValueOf(vt)
	env.Funcs["e"] = reflect.ValueOf(e)
	env.Funcs["s"] = reflect.ValueOf(s)
	env.Funcs["m"] = reflect.ValueOf(m)
	env.Funcs["mt"] = reflect.ValueOf(mt)
	expectCheckError(t, `s(I(1))`, env,
		`too many arguments in call to s`,
	)
}
func TestCheckCallExprNoArgXInts(t *testing.T) {
	type I int
	is := []int{1, 2, 3}
	f := func(int, bool) int { return 1 }
	ft := func(I, bool) int { return 1 }
	v1 := func(...int) int { return 1 }
	v2 := func(int, ...int) int { return 1 }
	vt := func(I, ...I) int { return 1 }
	e := func() {}
	s := func() int { return 1}
	m := func() (int, int) { return 1, 1 }
	mt := func() (int, I) { return 1, 1 }
	env := MakeSimpleEnv()
	env.Types["I"] = reflect.TypeOf(I(0))
	env.Vars["is"] = reflect.ValueOf(&is)
	env.Funcs["f"] = reflect.ValueOf(f)
	env.Funcs["ft"] = reflect.ValueOf(ft)
	env.Funcs["v1"] = reflect.ValueOf(v1)
	env.Funcs["v2"] = reflect.ValueOf(v2)
	env.Funcs["vt"] = reflect.ValueOf(vt)
	env.Funcs["e"] = reflect.ValueOf(e)
	env.Funcs["s"] = reflect.ValueOf(s)
	env.Funcs["m"] = reflect.ValueOf(m)
	env.Funcs["mt"] = reflect.ValueOf(mt)
	expectCheckError(t, `s(is...)`, env,
		`too many arguments in call to s`,
	)
}
func TestCheckCallExprNoArgXEmptyFunc(t *testing.T) {
	type I int
	is := []int{1, 2, 3}
	f := func(int, bool) int { return 1 }
	ft := func(I, bool) int { return 1 }
	v1 := func(...int) int { return 1 }
	v2 := func(int, ...int) int { return 1 }
	vt := func(I, ...I) int { return 1 }
	e := func() {}
	s := func() int { return 1}
	m := func() (int, int) { return 1, 1 }
	mt := func() (int, I) { return 1, 1 }
	env := MakeSimpleEnv()
	env.Types["I"] = reflect.TypeOf(I(0))
	env.Vars["is"] = reflect.ValueOf(&is)
	env.Funcs["f"] = reflect.ValueOf(f)
	env.Funcs["ft"] = reflect.ValueOf(ft)
	env.Funcs["v1"] = reflect.ValueOf(v1)
	env.Funcs["v2"] = reflect.ValueOf(v2)
	env.Funcs["vt"] = reflect.ValueOf(vt)
	env.Funcs["e"] = reflect.ValueOf(e)
	env.Funcs["s"] = reflect.ValueOf(s)
	env.Funcs["m"] = reflect.ValueOf(m)
	env.Funcs["mt"] = reflect.ValueOf(mt)
	expectCheckError(t, `s(e())`, env,
		`e() used as value`,
		`too many arguments in call to s`,
	)
}
func TestCheckCallExprNoArgXSingleFunc(t *testing.T) {
	type I int
	is := []int{1, 2, 3}
	f := func(int, bool) int { return 1 }
	ft := func(I, bool) int { return 1 }
	v1 := func(...int) int { return 1 }
	v2 := func(int, ...int) int { return 1 }
	vt := func(I, ...I) int { return 1 }
	e := func() {}
	s := func() int { return 1}
	m := func() (int, int) { return 1, 1 }
	mt := func() (int, I) { return 1, 1 }
	env := MakeSimpleEnv()
	env.Types["I"] = reflect.TypeOf(I(0))
	env.Vars["is"] = reflect.ValueOf(&is)
	env.Funcs["f"] = reflect.ValueOf(f)
	env.Funcs["ft"] = reflect.ValueOf(ft)
	env.Funcs["v1"] = reflect.ValueOf(v1)
	env.Funcs["v2"] = reflect.ValueOf(v2)
	env.Funcs["vt"] = reflect.ValueOf(vt)
	env.Funcs["e"] = reflect.ValueOf(e)
	env.Funcs["s"] = reflect.ValueOf(s)
	env.Funcs["m"] = reflect.ValueOf(m)
	env.Funcs["mt"] = reflect.ValueOf(mt)
	expectCheckError(t, `s(s())`, env,
		`too many arguments in call to s`,
	)
}
func TestCheckCallExprNoArgXMultiFunc(t *testing.T) {
	type I int
	is := []int{1, 2, 3}
	f := func(int, bool) int { return 1 }
	ft := func(I, bool) int { return 1 }
	v1 := func(...int) int { return 1 }
	v2 := func(int, ...int) int { return 1 }
	vt := func(I, ...I) int { return 1 }
	e := func() {}
	s := func() int { return 1}
	m := func() (int, int) { return 1, 1 }
	mt := func() (int, I) { return 1, 1 }
	env := MakeSimpleEnv()
	env.Types["I"] = reflect.TypeOf(I(0))
	env.Vars["is"] = reflect.ValueOf(&is)
	env.Funcs["f"] = reflect.ValueOf(f)
	env.Funcs["ft"] = reflect.ValueOf(ft)
	env.Funcs["v1"] = reflect.ValueOf(v1)
	env.Funcs["v2"] = reflect.ValueOf(v2)
	env.Funcs["vt"] = reflect.ValueOf(vt)
	env.Funcs["e"] = reflect.ValueOf(e)
	env.Funcs["s"] = reflect.ValueOf(s)
	env.Funcs["m"] = reflect.ValueOf(m)
	env.Funcs["mt"] = reflect.ValueOf(mt)
	expectCheckError(t, `s(m())`, env,
		`too many arguments in call to s`,
	)
}
func TestCheckCallExprNoArgXMultiFuncMixedTypes(t *testing.T) {
	type I int
	is := []int{1, 2, 3}
	f := func(int, bool) int { return 1 }
	ft := func(I, bool) int { return 1 }
	v1 := func(...int) int { return 1 }
	v2 := func(int, ...int) int { return 1 }
	vt := func(I, ...I) int { return 1 }
	e := func() {}
	s := func() int { return 1}
	m := func() (int, int) { return 1, 1 }
	mt := func() (int, I) { return 1, 1 }
	env := MakeSimpleEnv()
	env.Types["I"] = reflect.TypeOf(I(0))
	env.Vars["is"] = reflect.ValueOf(&is)
	env.Funcs["f"] = reflect.ValueOf(f)
	env.Funcs["ft"] = reflect.ValueOf(ft)
	env.Funcs["v1"] = reflect.ValueOf(v1)
	env.Funcs["v2"] = reflect.ValueOf(v2)
	env.Funcs["vt"] = reflect.ValueOf(vt)
	env.Funcs["e"] = reflect.ValueOf(e)
	env.Funcs["s"] = reflect.ValueOf(s)
	env.Funcs["m"] = reflect.ValueOf(m)
	env.Funcs["mt"] = reflect.ValueOf(mt)
	expectCheckError(t, `s(mt())`, env,
		`too many arguments in call to s`,
	)
}
func TestCheckCallExprNoArgIntX(t *testing.T) {
	type I int
	is := []int{1, 2, 3}
	f := func(int, bool) int { return 1 }
	ft := func(I, bool) int { return 1 }
	v1 := func(...int) int { return 1 }
	v2 := func(int, ...int) int { return 1 }
	vt := func(I, ...I) int { return 1 }
	e := func() {}
	s := func() int { return 1}
	m := func() (int, int) { return 1, 1 }
	mt := func() (int, I) { return 1, 1 }
	env := MakeSimpleEnv()
	env.Types["I"] = reflect.TypeOf(I(0))
	env.Vars["is"] = reflect.ValueOf(&is)
	env.Funcs["f"] = reflect.ValueOf(f)
	env.Funcs["ft"] = reflect.ValueOf(ft)
	env.Funcs["v1"] = reflect.ValueOf(v1)
	env.Funcs["v2"] = reflect.ValueOf(v2)
	env.Funcs["vt"] = reflect.ValueOf(vt)
	env.Funcs["e"] = reflect.ValueOf(e)
	env.Funcs["s"] = reflect.ValueOf(s)
	env.Funcs["m"] = reflect.ValueOf(m)
	env.Funcs["mt"] = reflect.ValueOf(mt)
	expectCheckError(t, `s(1)`, env,
		`too many arguments in call to s`,
	)
}
func TestCheckCallExprNoArgIntInt(t *testing.T) {
	type I int
	is := []int{1, 2, 3}
	f := func(int, bool) int { return 1 }
	ft := func(I, bool) int { return 1 }
	v1 := func(...int) int { return 1 }
	v2 := func(int, ...int) int { return 1 }
	vt := func(I, ...I) int { return 1 }
	e := func() {}
	s := func() int { return 1}
	m := func() (int, int) { return 1, 1 }
	mt := func() (int, I) { return 1, 1 }
	env := MakeSimpleEnv()
	env.Types["I"] = reflect.TypeOf(I(0))
	env.Vars["is"] = reflect.ValueOf(&is)
	env.Funcs["f"] = reflect.ValueOf(f)
	env.Funcs["ft"] = reflect.ValueOf(ft)
	env.Funcs["v1"] = reflect.ValueOf(v1)
	env.Funcs["v2"] = reflect.ValueOf(v2)
	env.Funcs["vt"] = reflect.ValueOf(vt)
	env.Funcs["e"] = reflect.ValueOf(e)
	env.Funcs["s"] = reflect.ValueOf(s)
	env.Funcs["m"] = reflect.ValueOf(m)
	env.Funcs["mt"] = reflect.ValueOf(mt)
	expectCheckError(t, `s(1, 1)`, env,
		`too many arguments in call to s`,
	)
}
func TestCheckCallExprNoArgIntFloat(t *testing.T) {
	type I int
	is := []int{1, 2, 3}
	f := func(int, bool) int { return 1 }
	ft := func(I, bool) int { return 1 }
	v1 := func(...int) int { return 1 }
	v2 := func(int, ...int) int { return 1 }
	vt := func(I, ...I) int { return 1 }
	e := func() {}
	s := func() int { return 1}
	m := func() (int, int) { return 1, 1 }
	mt := func() (int, I) { return 1, 1 }
	env := MakeSimpleEnv()
	env.Types["I"] = reflect.TypeOf(I(0))
	env.Vars["is"] = reflect.ValueOf(&is)
	env.Funcs["f"] = reflect.ValueOf(f)
	env.Funcs["ft"] = reflect.ValueOf(ft)
	env.Funcs["v1"] = reflect.ValueOf(v1)
	env.Funcs["v2"] = reflect.ValueOf(v2)
	env.Funcs["vt"] = reflect.ValueOf(vt)
	env.Funcs["e"] = reflect.ValueOf(e)
	env.Funcs["s"] = reflect.ValueOf(s)
	env.Funcs["m"] = reflect.ValueOf(m)
	env.Funcs["mt"] = reflect.ValueOf(mt)
	expectCheckError(t, `s(1, 1.5)`, env,
		`too many arguments in call to s`,
	)
}
func TestCheckCallExprNoArgIntBool(t *testing.T) {
	type I int
	is := []int{1, 2, 3}
	f := func(int, bool) int { return 1 }
	ft := func(I, bool) int { return 1 }
	v1 := func(...int) int { return 1 }
	v2 := func(int, ...int) int { return 1 }
	vt := func(I, ...I) int { return 1 }
	e := func() {}
	s := func() int { return 1}
	m := func() (int, int) { return 1, 1 }
	mt := func() (int, I) { return 1, 1 }
	env := MakeSimpleEnv()
	env.Types["I"] = reflect.TypeOf(I(0))
	env.Vars["is"] = reflect.ValueOf(&is)
	env.Funcs["f"] = reflect.ValueOf(f)
	env.Funcs["ft"] = reflect.ValueOf(ft)
	env.Funcs["v1"] = reflect.ValueOf(v1)
	env.Funcs["v2"] = reflect.ValueOf(v2)
	env.Funcs["vt"] = reflect.ValueOf(vt)
	env.Funcs["e"] = reflect.ValueOf(e)
	env.Funcs["s"] = reflect.ValueOf(s)
	env.Funcs["m"] = reflect.ValueOf(m)
	env.Funcs["mt"] = reflect.ValueOf(mt)
	expectCheckError(t, `s(1, true)`, env,
		`too many arguments in call to s`,
	)
}