Consider a following code:
package main import "fmt" func passFuncAsArgument(a interface{}) interface{} { return a } func main() { a := func(test int) (int) { return test } // Declaring a local function literal (1) func(test int) (int) { return test } (5) // Calling a anonymous function (2) passFuncAsArgument(func(test int) (int) {return test }) // Passing anonymous function as argument (3) fmt.Println(a(5)) }
Before this patch only in (1) case a function argument will be added as declaration.
This patch extends that to (2) and (3) cases.
This has impact on semantic highlighting for example:
Before
After