interp: fix generic check on nil function
Related to issue https://github.com/traefik/traefik/issues/9231
This commit is contained in:
12
_test/gen10.go
Normal file
12
_test/gen10.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package main
|
||||
|
||||
func genFunc() (f func()) {
|
||||
return f
|
||||
}
|
||||
|
||||
func main() {
|
||||
println(genFunc() == nil)
|
||||
}
|
||||
|
||||
// Output:
|
||||
// true
|
||||
@@ -2213,7 +2213,7 @@ func isEmptyInterface(t *itype) bool {
|
||||
}
|
||||
|
||||
func isGeneric(t *itype) bool {
|
||||
return t.cat == funcT && t.node != nil && len(t.node.child[0].child) > 0
|
||||
return t.cat == funcT && t.node != nil && len(t.node.child) > 0 && len(t.node.child[0].child) > 0
|
||||
}
|
||||
|
||||
func isFuncSrc(t *itype) bool {
|
||||
|
||||
Reference in New Issue
Block a user