mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-09-10 06:29:32 +00:00
reflect: stub channel select routines/types
This commit is contained in:
@@ -1753,6 +1753,33 @@ func MakeMapWithSize(typ Type, n int) Value {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type SelectDir int
|
||||||
|
|
||||||
|
const (
|
||||||
|
_ SelectDir = iota
|
||||||
|
SelectSend // case Chan <- Send
|
||||||
|
SelectRecv // case <-Chan:
|
||||||
|
SelectDefault // default
|
||||||
|
)
|
||||||
|
|
||||||
|
type SelectCase struct {
|
||||||
|
Dir SelectDir // direction of case
|
||||||
|
Chan Value // channel to use (for send or receive)
|
||||||
|
Send Value // value to send (for send)
|
||||||
|
}
|
||||||
|
|
||||||
|
func Select(cases []SelectCase) (chosen int, recv Value, recvOK bool) {
|
||||||
|
panic("unimplemented: reflect.Select")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v Value) Send(x Value) {
|
||||||
|
panic("unimplemented: reflect.Value.Send()")
|
||||||
|
}
|
||||||
|
|
||||||
|
func (v Value) Close() {
|
||||||
|
panic("unimplemented: reflect.Value.Close()")
|
||||||
|
}
|
||||||
|
|
||||||
// MakeMap creates a new map with the specified type.
|
// MakeMap creates a new map with the specified type.
|
||||||
func MakeMap(typ Type) Value {
|
func MakeMap(typ Type) Value {
|
||||||
return MakeMapWithSize(typ, 8)
|
return MakeMapWithSize(typ, 8)
|
||||||
|
|||||||
Reference in New Issue
Block a user