github.com/nspcc-dev/neo-go@v0.105.2-0.20240517133400-6be757af3eba/pkg/compiler/testdata/nestedcall/call.go (about)

     1  package nestedcall
     2  
     3  import "github.com/nspcc-dev/neo-go/pkg/compiler/testdata/nestedcall/inner"
     4  
     5  // X is what we use.
     6  const X = 42
     7  
     8  // N returns inner.A().
     9  func N() int {
    10  	return inner.Return65()
    11  }
    12  
    13  // F calls G.
    14  func F() int {
    15  	a := 1
    16  	return G() + a
    17  }
    18  
    19  // G calls x and returns y().
    20  func G() int {
    21  	x()
    22  	z := 3
    23  	return y() + z
    24  }
    25  
    26  func x() {}
    27  func y() int {
    28  	tmp := 10
    29  	return tmp
    30  }
    31  
    32  // Token is stateless token.
    33  type Token struct{}
    34  
    35  // Method is a method.
    36  func (t Token) Method() int {
    37  	return t.Inner()
    38  }
    39  
    40  // Inner is a function to be called in Method.
    41  func (t Token) Inner() int {
    42  	return 2231
    43  }