|
|
@ -481,11 +481,19 @@ func (t *rawType) elem() *rawType { |
|
|
|
switch underlying.Kind() { |
|
|
|
case Pointer: |
|
|
|
return (*ptrType)(unsafe.Pointer(underlying)).elem |
|
|
|
case Chan, Slice, Array: |
|
|
|
case Chan, Slice, Array, Map: |
|
|
|
return (*elemType)(unsafe.Pointer(underlying)).elem |
|
|
|
default: // not implemented: Map
|
|
|
|
panic("unimplemented: (reflect.Type).Elem()") |
|
|
|
default: |
|
|
|
panic(&TypeError{"Elem"}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
func (t *rawType) key() *rawType { |
|
|
|
underlying := t.underlying() |
|
|
|
if underlying.Kind() != Map { |
|
|
|
panic(&TypeError{"Key"}) |
|
|
|
} |
|
|
|
return (*mapType)(unsafe.Pointer(underlying)).key |
|
|
|
} |
|
|
|
|
|
|
|
// Field returns the type of the i'th field of this struct type. It panics if t
|
|
|
@ -806,7 +814,7 @@ func (t *rawType) Name() string { |
|
|
|
} |
|
|
|
|
|
|
|
func (t *rawType) Key() Type { |
|
|
|
panic("unimplemented: (reflect.Type).Key()") |
|
|
|
return t.key() |
|
|
|
} |
|
|
|
|
|
|
|
func (t rawType) In(i int) Type { |
|
|
|