diff options
author | Ayke van Laethem <[email protected]> | 2018-11-03 16:06:44 +0100 |
---|---|---|
committer | Ayke van Laethem <[email protected]> | 2018-11-03 16:06:44 +0100 |
commit | 22914165ccff0f7ea72dd5f7b07d5f46dc72bd6e (patch) | |
tree | 0c0575370c04466a28a341b56b2801318bb1976d | |
parent | e66d457c426ed66099508b84eda87164d5a920c4 (diff) | |
download | tinygo-22914165ccff0f7ea72dd5f7b07d5f46dc72bd6e.tar.gz tinygo-22914165ccff0f7ea72dd5f7b07d5f46dc72bd6e.zip |
reflect: add more stubs for encoding/binary
Package encoding/binary uses reflect and is needed by image/png, but
image/png doesn't actually need the reflect-using parts of
encoding/binary. So stub them out for now to get it to compile.
Thanks to Stephen Solka who wrote the patch.
-rw-r--r-- | src/reflect/type.go | 13 | ||||
-rw-r--r-- | src/reflect/value.go | 8 |
2 files changed, 21 insertions, 0 deletions
diff --git a/src/reflect/type.go b/src/reflect/type.go index c57225329..538b76afa 100644 --- a/src/reflect/type.go +++ b/src/reflect/type.go @@ -65,6 +65,19 @@ func (t Type) Bits() int { panic("unimplemented: (reflect.Type).Bits()") } +func (t Type) Len() int { + panic("unimplemented: (reflect.Type).Len()") +} + +func (t Type) NumField() int { + panic("unimplemented: (reflect.Type).NumField()") +} + +func (t Type) Size() uintptr { + panic("unimplemented: (reflect.Type).Size()") +} + type StructField struct { Name string + Type Type } diff --git a/src/reflect/value.go b/src/reflect/value.go index 425569793..814fdb5cb 100644 --- a/src/reflect/value.go +++ b/src/reflect/value.go @@ -10,6 +10,10 @@ type Value struct { value *uint8 } +func Indirect(v Value) Value { + return v +} + func ValueOf(i interface{}) Value //go:linkname _ValueOf reflect.ValueOf @@ -51,6 +55,10 @@ func (v Value) Addr() Value { panic("unimplemented: (reflect.Value).Addr()") } +func (v Value) CanSet() bool { + panic("unimplemented: (reflect.Value).CanSet()") +} + func (v Value) Bool() bool { panic("unimplemented: (reflect.Value).Bool()") } |