diff --git a/src/cmd/compile/internal/gc/bexport.go b/src/cmd/compile/internal/gc/bexport.go index 7c09ab5a34..e67506f4e1 100644 --- a/src/cmd/compile/internal/gc/bexport.go +++ b/src/cmd/compile/internal/gc/bexport.go @@ -43,11 +43,14 @@ func (p *exporter) markType(t *types.Type) { // the user already needs some way to construct values of // those types. switch t.Etype { - case TPTR, TARRAY, TSLICE, TCHAN: - // TODO(mdempsky): Skip marking element type for - // send-only channels? + case TPTR, TARRAY, TSLICE: p.markType(t.Elem()) + case TCHAN: + if t.ChanDir().CanRecv() { + p.markType(t.Elem()) + } + case TMAP: p.markType(t.Key()) p.markType(t.Elem())