reflect: implement MakeChan - #5588
Conversation
|
Please add a test for this new function. For reflect, this can either be in |
TinyGo had MakeMap/MakeSlice but not MakeChan. Implement it via the runtime chanMake primitive (mirroring MakeMap), so packages that call reflect.MakeChan (e.g. github.com/ugorji/go/codec used by gin) compile and work.
|
Added It covers buffered and unbuffered creation (kind, On verification: CI has not run on this PR, so I checked the test's expectations against the host |
13e03e0 to
31537f7
Compare
reflect.MakeChancurrently panics with "unimplemented". This implements it.It completes a small gap:
MakeSlice,MakeMapandNeware all supported, so code that builds a channel reflectively is the odd one out — and it is reached by generic container and codec libraries that construct channel types from areflect.Type.Verified by building TinyGo and running the compiler test suite.