mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-11 05:30:07 +00:00
8a0429036b
Set all necessary context before file traversal, not only import maps. Also, we can skip restoring import maps because all our code is processed via `For*` iterators which set necessary context. We can also refactor this a bit to have all context in one place, this will be done in #2086. Signed-off-by: Evgeniy Stratonikov <evgeniy@nspcc.ru>
43 lines
600 B
Go
43 lines
600 B
Go
package nestedcall
|
|
|
|
import "github.com/nspcc-dev/neo-go/pkg/compiler/testdata/nestedcall/inner"
|
|
|
|
// X is what we use.
|
|
const X = 42
|
|
|
|
// N returns inner.A().
|
|
func N() int {
|
|
return inner.Return65()
|
|
}
|
|
|
|
// F calls G.
|
|
func F() int {
|
|
a := 1
|
|
return G() + a
|
|
}
|
|
|
|
// G calls x and returns y().
|
|
func G() int {
|
|
x()
|
|
z := 3
|
|
return y() + z
|
|
}
|
|
|
|
func x() {}
|
|
func y() int {
|
|
tmp := 10
|
|
return tmp
|
|
}
|
|
|
|
// Token is stateless token.
|
|
type Token struct{}
|
|
|
|
// Method is a method.
|
|
func (t Token) Method() int {
|
|
return t.Inner()
|
|
}
|
|
|
|
// Inner is a function to be called in Method.
|
|
func (t Token) Inner() int {
|
|
return 2231
|
|
}
|