Files
moxa/_test/method40.go
Marc Vertes d6ad13acea interp: improve handling of embedded fields with binary methods
Only structures with one embedded field can be marked anonymous, due to golang/go#15924. Also check only that the method is defined, do not verify its complete signature, as the receiver may or not be defined in the arguments of the method.

Fixes #1537.
2023-04-13 18:16:05 +02:00

33 lines
363 B
Go

package main
import (
"bytes"
"io"
)
type TMemoryBuffer struct {
*bytes.Buffer
size int
}
func newTMemoryBuffer() *TMemoryBuffer {
return &TMemoryBuffer{}
}
var globalMemoryBuffer = newTMemoryBuffer()
type TTransport interface {
io.ReadWriter
}
func check(t TTransport) {
println("ok")
}
func main() {
check(globalMemoryBuffer)
}
// Output:
// ok