github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/gnovm/tests/files/type37e.gno (about)

     1  package main
     2  
     3  type IntPtr *int
     4  type Int2 IntPtr
     5  
     6  var ip IntPtr = new(int)
     7  
     8  func (i2 Int2) Int() int {
     9  	return *i2
    10  }
    11  
    12  func main() {
    13  	println(Int2(ip).Int())
    14  }
    15  
    16  // Error:
    17  // main/files/type37e.gno:8: invalid receiver type main.Int2 (base type is pointer type)