cell-labs / cell-script

Cell Script is a new designed language for smart-contract programming on UTXO chain, currently supports CKB.
https://cellscript.io
MIT License
20 stars 6 forks source link

fix interface jump table binding, when interface is used as parameter #22

Closed douyixuan closed 1 month ago

douyixuan commented 2 months ago
type Reader interface{
    Read(p []byte) (uint32, error) 
}
type Buffer table {
    buf      []byte
    off      uint32
    lastRead uint64
}
func (b *Buffer) Read(p []byte) (n uint32, err error) {

}
func foo(r Reader) {
    n, err := r.Read()
}
func main() {
     var b Buffer
     foo(b)
     return 0
}