This test checks completion related to function values.

-- flags --
-ignore_extra_diags

-- func_value.go --
package funcvalue

func fooFunc() int { //@item(fvFooFunc, "fooFunc", "func() int", "func")
	return 0
}

var _ = fooFunc() //@item(fvFooFuncCall, "fooFunc", "func() int", "func")

var fooVar = func() int { //@item(fvFooVar, "fooVar", "func() int", "var")
	return 0
}

var _ = fooVar() //@item(fvFooVarCall, "fooVar", "func() int", "var")

type myFunc func() int

var fooType myFunc = fooVar //@item(fvFooType, "fooType", "myFunc", "var")

var _ = fooType() //@item(fvFooTypeCall, "fooType", "func() int", "var")

func _() {
	var f func() int
	f = foo //@complete(re"() \\/\\/", fvFooFunc, fvFooType, fvFooVar)

	var i int
	i = foo //@complete(re"() \\/\\/", fvFooFuncCall, fvFooTypeCall, fvFooVarCall)
}

-- generic/func_value.go --
package funcvalue

type bar struct{}

func (b bar) Num() int {
	return 0
}

func Bar[T any]() bar {
	return bar{}
}

func BarWithArg[T any](a int) bar {
	return bar{}
}

func (b bar) Bar2() bar {
	return b
}

func _() {
	Bar[T].Num //@item(bar, "Bar[T]().Num", "func() int", "method")
	Bar[T].Bar2().Num //@item(bar2, "Bar[T]().Bar2().Num", "func() int", "method")
	var i int
	i = Num //@complete(re"() \\/\\/", bar, bar2)
}
