nspcc-dev / neo-go

Go Node and SDK for the Neo blockchain
MIT License
123 stars 79 forks source link

Include anonymous functions into the list of methods in DebugInfo #3619

Open AnnaShaleva opened 1 month ago

AnnaShaleva commented 1 month ago

Current Behavior

Our compiler does not include anonymous functions into the methods list of debug info:

func PublicContractMethod() {
    var f = func() {
        runtime.Log("bla")
    }

    f()
    f()
}

See also thread under https://github.com/nspcc-dev/neo-go/issues/3559#issuecomment-2416866538.

Expected Behavior

Anonymous functions should be included into the methods list of debug info with some dynamic name that is not intersected with existing method names. A good example is given in https://github.com/nspcc-dev/neo-go/issues/3559#issuecomment-2417834451.

Possible Solution

Fix it.